-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(app-board): add top widgets bar
- Loading branch information
Showing
7 changed files
with
113 additions
and
7 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,6 @@ const Box = styled.div<BoxProps>( | |
textAlign, | ||
); | ||
|
||
Box.displayName = 'Box'; | ||
|
||
export default Box; |
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
33 changes: 33 additions & 0 deletions
33
packages/game-app/src/gameView/components/TopWidgetsRow/TopWidgetsRow.styled.tsx
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,33 @@ | ||
import styled from 'styled-components'; | ||
import { Box } from '@pipeline/components'; | ||
|
||
export const TopRowContainer = styled(Box)` | ||
position: absolute; | ||
left: 40px; | ||
top: 40px; | ||
z-index: 1; | ||
display: flex; | ||
flex-direction: row; | ||
& > * { | ||
margin-right: 24px; | ||
} | ||
`; | ||
|
||
export const LogoContainer = styled(Box)` | ||
width: 54px; | ||
`; | ||
|
||
export const ButtonsBar = styled(Box)` | ||
background: white; | ||
box-shadow: 0px 0px 6px #d7d2cb80; | ||
border-radius: 4px; | ||
padding: 0 12px; | ||
display: flex; | ||
flex-direction: row; | ||
height: 40px; | ||
& > *:not(:last-child) { | ||
margin-right: 8px; | ||
} | ||
`; |
59 changes: 59 additions & 0 deletions
59
packages/game-app/src/gameView/components/TopWidgetsRow/TopWidgetsRow.tsx
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,59 @@ | ||
import React from 'react'; | ||
import { ButtonsBar, LogoContainer, TopRowContainer } from './TopWidgetsRow.styled'; | ||
import { ReactComponent as Logo } from '@assets/images/eficode-logo.svg'; | ||
import { ReactComponent as ExitIcon } from '@assets/icons/exit.svg'; | ||
import { ReactComponent as ShareIcon } from '@assets/icons/share.svg'; | ||
import { ReactComponent as RulesIcon } from '@assets/icons/rules.svg'; | ||
import { ReactComponent as TriggerReviewIcon } from '@assets/icons/review.svg'; | ||
import { Button, IconButton } from '@pipeline/components'; | ||
import { useHistory } from 'react-router-dom'; | ||
import { RoutingPath } from '@pipeline/routing'; | ||
import { useTranslate } from '@pipeline/i18n'; | ||
|
||
type Props = {}; | ||
|
||
const TopWidgetsRow: React.FC<Props> = () => { | ||
const history = useHistory(); | ||
|
||
const t = useTranslate(); | ||
|
||
const exitGame = () => history.replace(RoutingPath.Dashboard); | ||
|
||
// TODO | ||
const share = () => ({}); | ||
// TODO | ||
const showRules = () => ({}); | ||
// TODO | ||
const triggerReview = () => ({}); | ||
// TODO | ||
const contactUs = () => ({}); | ||
|
||
return ( | ||
<TopRowContainer> | ||
<LogoContainer> | ||
<Logo /> | ||
</LogoContainer> | ||
<ButtonsBar> | ||
<IconButton variant="clear" onClick={exitGame}> | ||
<ExitIcon /> | ||
</IconButton> | ||
<IconButton variant="clear" onClick={share}> | ||
<ShareIcon /> | ||
</IconButton> | ||
|
||
<IconButton variant="clear" onClick={showRules}> | ||
<RulesIcon /> | ||
</IconButton> | ||
|
||
<IconButton variant="clear" onClick={triggerReview}> | ||
<TriggerReviewIcon /> | ||
</IconButton> | ||
</ButtonsBar> | ||
<Button onClick={contactUs} label={t('game.contactUs')} /> | ||
</TopRowContainer> | ||
); | ||
}; | ||
|
||
TopWidgetsRow.displayName = 'TopWidgetsRow'; | ||
|
||
export default TopWidgetsRow; |
3 changes: 3 additions & 0 deletions
3
packages/game-app/src/gameView/components/TopWidgetsRow/index.ts
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,3 @@ | ||
import TopWidgetsRow from './TopWidgetsRow'; | ||
|
||
export default TopWidgetsRow; |