-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: redesign onboarding page (#25)
* Add topChildren to TallCard
- Loading branch information
Showing
17 changed files
with
271 additions
and
209 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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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,66 @@ | ||
import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline'; | ||
import { alpha, styled } from '@mui/material/styles'; | ||
import { Box, Button } from '@mui/material'; | ||
import classNames from 'classnames'; | ||
import { Status } from '../../../generated/graphql'; | ||
|
||
interface OverlayProps { | ||
status: Status; | ||
} | ||
|
||
const Overlay = styled(Box)` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
position: absolute; | ||
width: 100%; | ||
height: 100%; | ||
transition: ${({ theme }) => theme.transitions.create('opacity')}; | ||
opacity: 0; | ||
background-color: ${({ theme }) => alpha(theme.palette.common.black, 0.5)}; | ||
&.status-in-watchlist { | ||
opacity: 1; | ||
} | ||
`; | ||
|
||
const StyledActionButton = styled(Button)` | ||
padding: ${({ theme }) => theme.spacing(4)}; | ||
transition: ${({ theme }) => theme.transitions.create('opacity')}; | ||
width: 100%; | ||
height: 100%; | ||
svg { | ||
font-size: ${({ theme }) => theme.typography.h3.fontSize}; | ||
} | ||
`; | ||
|
||
interface Props extends OverlayProps { | ||
onClick: (status: Status) => void; | ||
} | ||
|
||
const STATUS_TOGGLE_MAP = { | ||
[Status.InWatchlist]: Status.None, | ||
[Status.None]: Status.InWatchlist, | ||
[Status.StoppedWatching]: Status.InWatchlist, | ||
} as const; | ||
|
||
const WatchlistOverlayAction = ({ status, onClick }: Props) => { | ||
const handleClick = () => { | ||
onClick(STATUS_TOGGLE_MAP[status]); | ||
}; | ||
|
||
return ( | ||
<Overlay | ||
className={classNames({ | ||
'status-in-watchlist': status === Status.InWatchlist, | ||
})} | ||
> | ||
<StyledActionButton onClick={handleClick}> | ||
<CheckCircleOutlineIcon /> | ||
</StyledActionButton> | ||
</Overlay> | ||
); | ||
}; | ||
|
||
export default WatchlistOverlayAction; |
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
Oops, something went wrong.