Skip to content

Commit

Permalink
feat: add published tab stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
codeofmochi committed Jul 5, 2023
1 parent d8a0aa3 commit 3a385e6
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
HOME_PATH,
ITEMS_PATH,
MEMBER_PROFILE_PATH,
PUBLISHED_ITEMS_PATH,
RECYCLE_BIN_PATH,
REDIRECT_PATH,
SHARED_ITEMS_PATH,
Expand All @@ -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';

Expand Down Expand Up @@ -57,6 +59,10 @@ const App = (): JSX.Element => {
RecycleBinScreen,
withAuthorizationProps,
);
const PublishedWithAuthorization = withAuthorization(
PublishedItems,
withAuthorizationProps,
);

return (
<Routes>
Expand All @@ -66,6 +72,10 @@ const App = (): JSX.Element => {
path={FAVORITE_ITEMS_PATH}
element={<FavoriteWithAuthorization />}
/>
<Route
path={PUBLISHED_ITEMS_PATH}
element={<PublishedWithAuthorization />}
/>
<Route path={buildItemPath()} element={<ItemScreen />} />
<Route path={MEMBER_PROFILE_PATH} element={<MemberWithAuthorization />} />
<Route path={RECYCLE_BIN_PATH} element={<RecycleWithAuthorization />} />
Expand Down
8 changes: 8 additions & 0 deletions src/components/main/MainMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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';
Expand Down Expand Up @@ -91,6 +93,12 @@ const MainMenu = (): JSX.Element => {
text={translateBuilder(BUILDER.FAVORITE_ITEMS_TITLE)}
icon={<Star />}
/>
<MenuItem
onClick={() => goTo(PUBLISHED_ITEMS_PATH)}
selected={pathname === PUBLISHED_ITEMS_PATH}
text="Published items"
icon={<PublicIcon />}
/>
<MenuItem
onClick={() => goTo(RECYCLE_BIN_PATH)}
selected={pathname === RECYCLE_BIN_PATH}
Expand Down
22 changes: 22 additions & 0 deletions src/components/main/PublishedItems.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<Main>
<Box mx={2}>
<ItemHeader showNavigation={false} />
{}
</Box>
</Main>
);
};

export default PublishedItems;
1 change: 1 addition & 0 deletions src/config/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
Expand Down

0 comments on commit 3a385e6

Please sign in to comment.