-
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.
* setup `@svgr/webpack` to be able to style SVGs and optimize them * rework Menu and Close icon buttons to use icons from the designs * remove `react-icons` as it's unused now
- Loading branch information
1 parent
ac473cd
commit 001a0de
Showing
20 changed files
with
2,322 additions
and
155 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
.closeButton { | ||
cursor: pointer; | ||
|
||
color: white; | ||
background-color: black; | ||
|
||
&.active, | ||
&:hover { | ||
color: black; | ||
background-color: white; | ||
} | ||
} | ||
.invertColors { | ||
color: black; | ||
background-color: white; | ||
|
||
&.active, | ||
&:hover { | ||
color: white; | ||
background-color: black; | ||
} | ||
} | ||
|
||
.alignRight { | ||
position: absolute; | ||
right: 12px; | ||
} |
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,12 @@ | ||
export type Styles = { | ||
active: string | ||
alignRight: string | ||
closeButton: string | ||
invertColors: string | ||
} | ||
|
||
export type ClassNames = keyof Styles | ||
|
||
declare const styles: Styles | ||
|
||
export default styles |
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,29 +1,21 @@ | ||
import {Close} from '@mui/icons-material' | ||
import clsx from 'clsx' | ||
import {FC} from 'react' | ||
|
||
import Close from '@/svg/close.svg' | ||
|
||
import styles from './CloseButton.module.scss' | ||
|
||
interface CloseButtonProps { | ||
onClick: () => void | ||
size?: number | ||
alignRight?: boolean | ||
size: number | ||
invertColors?: boolean | ||
className?: string | ||
} | ||
|
||
export const CloseButton: FC<CloseButtonProps> = ({onClick, size, alignRight, invertColors}) => { | ||
export const CloseButton: FC<CloseButtonProps> = ({onClick, size, invertColors, className}) => { | ||
return ( | ||
<Close | ||
sx={[ | ||
{ | ||
fontSize: size, | ||
cursor: 'pointer', | ||
color: !invertColors ? 'white' : 'black', | ||
'active, :hover': { | ||
color: !invertColors ? 'black' : 'white', | ||
backgroundColor: !invertColors ? 'white' : 'black', | ||
}, | ||
}, | ||
!!alignRight && {position: 'absolute', right: '8px'}, | ||
]} | ||
onClick={onClick} | ||
/> | ||
<div className={clsx(styles.closeButton, invertColors && styles.invertColors, className)} onClick={onClick}> | ||
<Close width={size} height={size} /> | ||
</div> | ||
) | ||
} |
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,4 +1,5 @@ | ||
export type Styles = { | ||
closeButton: string | ||
container: string | ||
title: string | ||
} | ||
|
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 |
---|---|---|
|
@@ -36,3 +36,8 @@ | |
justify-content: flex-end; | ||
column-gap: 20px; | ||
} | ||
|
||
.closeButton { | ||
position: absolute; | ||
right: 0; | ||
} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,18 @@ | ||
// config for SVGO as part of @svgr/webpack | ||
// - https://github.com/svg/svgo/blob/main/README.md#configuration | ||
// adds back the viewBox attribute to SVGs | ||
// - problem acknowledged here: https://github.com/svg/svgo#svg-wont-scale-when-css-is-applied-on-it | ||
// - loong discussion on the topic here: https://github.com/svg/svgo/issues/1128 | ||
// - tl;dr: using viewBox with width/height allows for scaling the SVGs | ||
module.exports = { | ||
plugins: [ | ||
{ | ||
name: 'preset-default', | ||
params: { | ||
overrides: { | ||
removeViewBox: false, | ||
}, | ||
}, | ||
}, | ||
], | ||
} |
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.