Skip to content

Commit

Permalink
Restore share menu code that got overwritten
Browse files Browse the repository at this point in the history
  • Loading branch information
Snarr committed Apr 22, 2024
1 parent 85fc9af commit 0732017
Showing 1 changed file with 51 additions and 52 deletions.
103 changes: 51 additions & 52 deletions home/webapp/src/components/HomePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ export default function HomePage() {
>
<NewGameIcon />
</GameIcon>
{console.log(availableGames)}
{availableGames.map((game, index) => (
<GameIcon
key={index}
Expand All @@ -109,70 +108,70 @@ export default function HomePage() {

<GameInfoContainer>

{shareMenuOpen?
<ShareMenu>
{
shareMenuOpen
?
<ShareMenu>
<ShareMenuButton tabIndex={1}> <ClassroomIcon/> My Classroom </ShareMenuButton>
<ShareMenuButton tabIndex={1} onClick={()=>shareToCommunity()}> <CommunityIcon/> Community Hub </ShareMenuButton>
<ShareMenuButton tabIndex={1} onClick={()=>{
setShareMenuOpen(false);
document.getElementById("shareButton").focus()
}}> Nevermind </ShareMenuButton>
</ShareMenu>

:<></>}


{selectedGame != null ?
<>
:
<></>
}

<GameMetaData>
<MetaDataTitle>
<span>{selectedGame.name}</span>
</MetaDataTitle>
<MetaDataText> Author: {selectedGame.metadata[1]["author name"]}</MetaDataText>
<MetaDataText> Last Updated: {selectedGame.last_updated}</MetaDataText>

{
selectedGame != null
?
<>
<GameMetaData>
<MetaDataTitle>
<span>{selectedGame.name}</span>
</MetaDataTitle>
<MetaDataText> Author: {selectedGame.metadata[1]["author name"]}</MetaDataText>
<MetaDataText> Last Updated: {selectedGame.last_updated}</MetaDataText>
</GameMetaData>


<GameActionButtonsContainer>
<GameActionButton
tabIndex={0}
onClick={() => runGame()}
>
<PlayButtonForegroundColor>
<PlayIcon />
</PlayButtonForegroundColor>
<PlayButtonBackgroundColor />
</GameActionButton>

<GameActionButton
tabIndex={0}
onClick={() => editGame()}
>
<EditButtonForegroundColor>
<PencilIcon />
</EditButtonForegroundColor>
<EditButtonBackgroundColor />
</GameActionButton>

<GameActionButton
tabIndex={0}
onClick={() => setShareMenuOpen(true)}
id="shareButton"
>
<ShareButtonForegroundColor>
<UploadIcon />
</ShareButtonForegroundColor>
<ShareButtonBackgroundColor />
</GameActionButton>
</GameActionButtonsContainer>
</>
: <></>
<GameActionButtonsContainer>
<GameActionButton
tabIndex={0}
onClick={() => runGame()}
>
<PlayButtonForegroundColor>
<PlayIcon />
</PlayButtonForegroundColor>
<PlayButtonBackgroundColor />
</GameActionButton>
<GameActionButton
tabIndex={0}
onClick={() => editGame()}
>
<EditButtonForegroundColor>
<PencilIcon />
</EditButtonForegroundColor>
<EditButtonBackgroundColor />
</GameActionButton>

<GameActionButton
tabIndex={0}
onClick={() => setShareMenuOpen(true)}
id="shareButton"
>
<ShareButtonForegroundColor>
<UploadIcon />
</ShareButtonForegroundColor>
<ShareButtonBackgroundColor />
</GameActionButton>
</GameActionButtonsContainer>
</>
:
<></>
}



</GameInfoContainer>
</HomePageContainer>
);
Expand Down

0 comments on commit 0732017

Please sign in to comment.