This repository has been archived by the owner on Jan 23, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
feat: simple tour #705
Open
spaenleh
wants to merge
3
commits into
main
Choose a base branch
from
571-simple-tour
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: simple tour #705
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import { | ||
AutoStories, | ||
Delete, | ||
Folder, | ||
FolderShared, | ||
Star, | ||
} from '@mui/icons-material'; | ||
import { Typography } from '@mui/material'; | ||
|
||
import { Step } from 'react-joyride'; | ||
|
||
import { BuildIcon } from '@graasp/ui'; | ||
|
||
import { | ||
TOUR_NAVIGATION_SIDEBAR_CLOSE_BUTTON_ID, | ||
TOUR_NAVIGATION_SIDEBAR_ID, | ||
TOUR_TUTORIALS_LINK_ID, | ||
} from '../../config/selectors'; | ||
|
||
const iconInTextStyle = { | ||
width: 20, | ||
height: 20, | ||
marginBottom: '-4px', | ||
}; | ||
|
||
// eslint-disable-next-line import/prefer-default-export | ||
export const steps: Step[] = [ | ||
{ | ||
target: 'body', | ||
placement: 'center', | ||
content: 'Welcome', | ||
locale: { skip: 'Skip' }, | ||
Comment on lines
+31
to
+32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Translations? If it's a prototype it can be done later. |
||
}, | ||
{ | ||
content: ( | ||
<Typography> | ||
This is the <BuildIcon sx={iconInTextStyle} /> Builder, it allows you to{' '} | ||
<strong>create</strong> content and <strong>build</strong> interactive | ||
capsules. | ||
</Typography> | ||
), | ||
target: 'body', | ||
}, | ||
{ | ||
content: ( | ||
<Typography align="left"> | ||
This is the navigation bar, you can use it to go to: | ||
<ul> | ||
<li> | ||
<Folder sx={iconInTextStyle} /> <strong>My Graasp</strong>: Your own | ||
items | ||
</li> | ||
<li> | ||
<FolderShared sx={iconInTextStyle} /> <strong>Shared Items</strong>: | ||
Items shared with you | ||
</li> | ||
<li> | ||
<Star sx={iconInTextStyle} /> <strong>Favorite Items</strong>: Your | ||
favorite items | ||
</li> | ||
<li> | ||
<Delete sx={iconInTextStyle} /> <strong>Trash</strong>: Items you | ||
deleted | ||
</li> | ||
</ul> | ||
</Typography> | ||
), | ||
target: `#${TOUR_NAVIGATION_SIDEBAR_ID}`, | ||
}, | ||
{ | ||
content: ( | ||
<Typography> | ||
If you need help, here are some <AutoStories sx={iconInTextStyle} />{' '} | ||
Tutorials to get you started ! | ||
</Typography> | ||
), | ||
target: `#${TOUR_TUTORIALS_LINK_ID}`, | ||
}, | ||
{ | ||
content: | ||
'With this button, you can close the side bar to free some screen space.', | ||
target: `#${TOUR_NAVIGATION_SIDEBAR_CLOSE_BUTTON_ID}`, | ||
}, | ||
]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Everything in there should have translations? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
import { AutoAwesome } from '@mui/icons-material'; | ||
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 Star from '@mui/icons-material/Star'; | ||
import { styled } from '@mui/material'; | ||
import { ListItemButton, Stack, styled } from '@mui/material'; | ||
import ListItemIcon from '@mui/material/ListItemIcon'; | ||
|
||
import { useLocation, useNavigate } from 'react-router'; | ||
|
@@ -19,11 +20,15 @@ import { | |
RECYCLE_BIN_PATH, | ||
SHARED_ITEMS_PATH, | ||
} from '../../config/paths'; | ||
import { | ||
TOUR_NAVIGATION_SIDEBAR_ID, | ||
TOUR_TUTORIALS_LINK_ID, | ||
} from '../../config/selectors'; | ||
import { useCurrentUserContext } from '../context/CurrentUserContext'; | ||
|
||
const StyledLink = styled('a')(({ theme }) => ({ | ||
position: 'absolute', | ||
bottom: 0, | ||
// position: 'absolute', | ||
// bottom: 0, | ||
Comment on lines
+30
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove. |
||
width: '100%', | ||
display: 'flex', | ||
alignItems: 'center', | ||
|
@@ -52,14 +57,32 @@ const MainMenu = (): JSX.Element => { | |
}; | ||
|
||
const resourcesLink = ( | ||
<StyledLink href={TUTORIALS_LINK} target="_blank"> | ||
<StyledLink | ||
id={TOUR_TUTORIALS_LINK_ID} | ||
href={TUTORIALS_LINK} | ||
target="_blank" | ||
> | ||
<ListItemIcon> | ||
<AutoStoriesIcon /> | ||
</ListItemIcon> | ||
{translateBuilder('Tutorials')} | ||
</StyledLink> | ||
); | ||
|
||
const tourButton = ( | ||
<ListItemButton | ||
sx={{ | ||
color: 'grey', | ||
'&:hover': { color: 'purple' }, | ||
}} | ||
> | ||
<ListItemIcon sx={{ color: 'inherit' }}> | ||
<AutoAwesome /> | ||
</ListItemIcon> | ||
{translateBuilder('Show me around')} | ||
</ListItemButton> | ||
); | ||
|
||
const renderAuthenticatedMemberMenuItems = () => { | ||
if (!member || !member.id) { | ||
return ( | ||
|
@@ -72,7 +95,7 @@ const MainMenu = (): JSX.Element => { | |
} | ||
|
||
return ( | ||
<> | ||
<div id={TOUR_NAVIGATION_SIDEBAR_ID}> | ||
<MenuItem | ||
onClick={() => goTo(HOME_PATH)} | ||
selected={pathname === HOME_PATH} | ||
|
@@ -85,6 +108,7 @@ const MainMenu = (): JSX.Element => { | |
icon={<FolderSharedIcon />} | ||
selected={pathname === SHARED_ITEMS_PATH} | ||
/> | ||
|
||
<MenuItem | ||
onClick={() => goTo(FAVORITE_ITEMS_PATH)} | ||
selected={pathname === FAVORITE_ITEMS_PATH} | ||
|
@@ -97,14 +121,19 @@ const MainMenu = (): JSX.Element => { | |
text={translateBuilder(BUILDER.RECYCLE_BIN_TITLE)} | ||
icon={<DeleteIcon />} | ||
/> | ||
</> | ||
</div> | ||
); | ||
}; | ||
|
||
return ( | ||
<GraaspMainMenu fullHeight> | ||
{renderAuthenticatedMemberMenuItems()} | ||
{resourcesLink} | ||
<Stack direction="column" height="100%" justifyContent="space-between"> | ||
{renderAuthenticatedMemberMenuItems()} | ||
<div> | ||
{tourButton} | ||
{resourcesLink} | ||
</div> | ||
</Stack> | ||
</GraaspMainMenu> | ||
); | ||
}; | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be a bit more dynamic?