From 3a385e6dcc924eedfa158e15ed29565833126c24 Mon Sep 17 00:00:00 2001 From: Alexandre Chau Date: Mon, 20 Feb 2023 17:52:26 +0100 Subject: [PATCH] feat: add published tab stubs --- src/components/App.tsx | 10 ++++++++++ src/components/main/MainMenu.tsx | 8 ++++++++ src/components/main/PublishedItems.tsx | 22 ++++++++++++++++++++++ src/config/paths.ts | 1 + 4 files changed, 41 insertions(+) create mode 100644 src/components/main/PublishedItems.tsx diff --git a/src/components/App.tsx b/src/components/App.tsx index fd0ea62f9..7fc0e6da9 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -10,6 +10,7 @@ import { HOME_PATH, ITEMS_PATH, MEMBER_PROFILE_PATH, + PUBLISHED_ITEMS_PATH, RECYCLE_BIN_PATH, REDIRECT_PATH, SHARED_ITEMS_PATH, @@ -21,6 +22,7 @@ import { useCurrentUserContext } from './context/CurrentUserContext'; import FavoriteItems from './main/FavoriteItems'; import Home from './main/Home'; import ItemScreen from './main/ItemScreen'; +import PublishedItems from './main/PublishedItems'; import Redirect from './main/Redirect'; import MemberProfileScreen from './member/MemberProfileScreen'; @@ -57,6 +59,10 @@ const App = (): JSX.Element => { RecycleBinScreen, withAuthorizationProps, ); + const PublishedWithAuthorization = withAuthorization( + PublishedItems, + withAuthorizationProps, + ); return ( @@ -66,6 +72,10 @@ const App = (): JSX.Element => { path={FAVORITE_ITEMS_PATH} element={} /> + } + /> } /> } /> } /> diff --git a/src/components/main/MainMenu.tsx b/src/components/main/MainMenu.tsx index 04b024a16..ddf6ee6fa 100644 --- a/src/components/main/MainMenu.tsx +++ b/src/components/main/MainMenu.tsx @@ -2,6 +2,7 @@ import AutoStoriesIcon from '@mui/icons-material/AutoStories'; import DeleteIcon from '@mui/icons-material/Delete'; import FolderIcon from '@mui/icons-material/Folder'; import FolderSharedIcon from '@mui/icons-material/FolderShared'; +import PublicIcon from '@mui/icons-material/Public'; import Star from '@mui/icons-material/Star'; import { styled } from '@mui/material'; import ListItemIcon from '@mui/material/ListItemIcon'; @@ -16,6 +17,7 @@ import { useBuilderTranslation } from '../../config/i18n'; import { FAVORITE_ITEMS_PATH, HOME_PATH, + PUBLISHED_ITEMS_PATH, RECYCLE_BIN_PATH, SHARED_ITEMS_PATH, } from '../../config/paths'; @@ -91,6 +93,12 @@ const MainMenu = (): JSX.Element => { text={translateBuilder(BUILDER.FAVORITE_ITEMS_TITLE)} icon={} /> + goTo(PUBLISHED_ITEMS_PATH)} + selected={pathname === PUBLISHED_ITEMS_PATH} + text="Published items" + icon={} + /> goTo(RECYCLE_BIN_PATH)} selected={pathname === RECYCLE_BIN_PATH} diff --git a/src/components/main/PublishedItems.tsx b/src/components/main/PublishedItems.tsx new file mode 100644 index 000000000..77e60f023 --- /dev/null +++ b/src/components/main/PublishedItems.tsx @@ -0,0 +1,22 @@ +import { Box } from '@mui/material'; + +import ItemHeader from '../item/header/ItemHeader'; +import Main from './Main'; + +// todo: remove +/* eslint-disable */ + +interface Props {} + +const PublishedItems = ({}: Props): JSX.Element => { + return ( +
+ + + {} + +
+ ); +}; + +export default PublishedItems; diff --git a/src/config/paths.ts b/src/config/paths.ts index 695c20afe..cfa850795 100644 --- a/src/config/paths.ts +++ b/src/config/paths.ts @@ -3,6 +3,7 @@ import { GRAASP_PERFORM_HOST } from './constants'; export const HOME_PATH = '/'; export const SHARED_ITEMS_PATH = '/shared'; export const FAVORITE_ITEMS_PATH = '/favorite'; +export const PUBLISHED_ITEMS_PATH = '/published'; export const SIGN_UP_PATH = '/signUp'; export const ITEMS_PATH = '/items'; export const buildItemPath = (id = ':itemId'): string => `${ITEMS_PATH}/${id}`;