-
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 trigger review flow
- Loading branch information
Showing
18 changed files
with
149 additions
and
23 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
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
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
20 changes: 20 additions & 0 deletions
20
packages/game-app/src/gameView/components/ReviewPanel/ReviewPanel.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,20 @@ | ||
import React from 'react'; | ||
import { ExpandableTopPanel, Typography } from '@pipeline/components'; | ||
|
||
type Props = {}; | ||
|
||
// TODO add real review content | ||
const ReviewPanel: React.FC<Props> = () => { | ||
return ( | ||
<ExpandableTopPanel label="Review"> | ||
<Typography variant="contentHead" as="div" mt={2}> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore | ||
magna aliqua | ||
</Typography> | ||
</ExpandableTopPanel> | ||
); | ||
}; | ||
|
||
ReviewPanel.displayName = 'ReviewPanel'; | ||
|
||
export default ReviewPanel; |
3 changes: 3 additions & 0 deletions
3
packages/game-app/src/gameView/components/ReviewPanel/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 ReviewPanel from './ReviewPanel'; | ||
|
||
export default ReviewPanel; |
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
23 changes: 23 additions & 0 deletions
23
packages/game-app/src/gameView/components/TriggerReviewDialog/TriggerReviewDialog.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,23 @@ | ||
import styled, { css } from 'styled-components'; | ||
import { Dialog } from '@pipeline/components'; | ||
|
||
export const TriggerDialogContainer = styled(Dialog.DialogContainer)<{ showReviewPosition: boolean }>` | ||
transition: all 0.5s; | ||
position: absolute; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
max-width: 650px; | ||
${props => | ||
props.showReviewPosition && | ||
css` | ||
position: absolute; | ||
top: unset; | ||
left: 200px; | ||
bottom: 55px; | ||
transform: unset; | ||
`} | ||
`; | ||
|
||
TriggerDialogContainer.displayName = 'TriggerDialogContainer'; |
51 changes: 51 additions & 0 deletions
51
packages/game-app/src/gameView/components/TriggerReviewDialog/TriggerReviewDialog.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,51 @@ | ||
import React, { useCallback, useState } from 'react'; | ||
import { Box, Button, Dialog, Typography } from '@pipeline/components'; | ||
import { useTranslate } from '@pipeline/i18n'; | ||
import { TriggerDialogContainer } from './TriggerReviewDialog.styled'; | ||
import { useDispatch } from 'react-redux'; | ||
import { actions } from '../../slice'; | ||
|
||
type Props = { | ||
isOpen: boolean; | ||
close: () => void; | ||
}; | ||
|
||
const TriggerReviewDialog: React.FC<Props> = ({ isOpen, close }) => { | ||
const t = useTranslate(); | ||
|
||
const [showReviewPosition, setShowReviewPosition] = useState(false); | ||
|
||
const dispatch = useDispatch(); | ||
|
||
const trigger = useCallback(() => { | ||
dispatch(actions.setReview(true)); | ||
setShowReviewPosition(true); | ||
}, [dispatch]); | ||
|
||
return ( | ||
<Dialog | ||
open={isOpen} | ||
title={t(!showReviewPosition ? 'game.triggerReview.title' : 'game.triggerReview.reviewTime')} | ||
DialogContainerComponent={TriggerDialogContainer} | ||
DialogContainerProps={{ showReviewPosition }} | ||
> | ||
<Typography mt={4} variant="content"> | ||
{t(!showReviewPosition ? 'game.triggerReview.subtitle' : 'game.triggerReview.reviewUnlocked')} | ||
</Typography> | ||
<Box display="flex" justifyContent="center" mt={5}> | ||
<Button | ||
label={t(!showReviewPosition ? 'game.triggerReview.buttonText' : 'game.triggerReview.understood')} | ||
onClick={!showReviewPosition ? trigger : close} | ||
/> | ||
</Box> | ||
{!showReviewPosition && ( | ||
<Box display="flex" justifyContent="center" mt={2}> | ||
<Button variant="clear" color="buttonGrey" label={t('general.cancel')} onClick={close} /> | ||
</Box> | ||
)} | ||
</Dialog> | ||
); | ||
}; | ||
TriggerReviewDialog.displayName = 'TriggerReviewDialog'; | ||
|
||
export default TriggerReviewDialog; |
3 changes: 3 additions & 0 deletions
3
packages/game-app/src/gameView/components/TriggerReviewDialog/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 TriggerReviewDialog from './TriggerReviewDialog'; | ||
|
||
export default TriggerReviewDialog; |
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