-
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.
* Rewrite CloseButton styles * Replace classname with sx styles
- Loading branch information
Showing
12 changed files
with
44 additions
and
116 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,21 +1,43 @@ | ||
import clsx from 'clsx' | ||
import {Box, SxProps} from '@mui/material' | ||
import {FC} from 'react' | ||
|
||
import Close from '@/svg/close.svg' | ||
|
||
import styles from './CloseButton.module.scss' | ||
|
||
interface CloseButtonProps { | ||
onClick: () => void | ||
size: number | ||
invertColors?: boolean | ||
className?: string | ||
sx?: SxProps | ||
} | ||
|
||
export const CloseButton: FC<CloseButtonProps> = ({onClick, size, invertColors, className}) => { | ||
export const CloseButton: FC<CloseButtonProps> = ({onClick, size, invertColors, sx}) => { | ||
return ( | ||
<div className={clsx(styles.closeButton, invertColors && styles.invertColors, className)} onClick={onClick}> | ||
<Box | ||
onClick={onClick} | ||
sx={{ | ||
cursor: 'pointer', | ||
padding: 0.5, | ||
...(invertColors | ||
? { | ||
color: 'black', | ||
background: 'white', | ||
'&.active, &:hover': { | ||
color: 'white', | ||
background: 'black', | ||
}, | ||
} | ||
: { | ||
color: 'white', | ||
background: 'black', | ||
'&.active, &:hover': { | ||
color: 'black', | ||
background: 'white', | ||
}, | ||
}), | ||
...sx, | ||
}} | ||
> | ||
<Close width={size} height={size} /> | ||
</div> | ||
</Box> | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
src/components/PageLayout/MenuMain/MenuMain.module.scss.d.ts
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 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 |
---|---|---|
|
@@ -16,8 +16,3 @@ | |
justify-content: center; | ||
align-items: center; | ||
} | ||
|
||
.closeButton { | ||
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
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 |
---|---|---|
|
@@ -40,9 +40,3 @@ | |
justify-content: flex-end; | ||
column-gap: 20px; | ||
} | ||
|
||
.closeButton { | ||
position: absolute; | ||
right: 2px; | ||
top: 2px; | ||
} |
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