-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor of Matrix elements to make it reusable
- Loading branch information
Viktor Riabkov
committed
Mar 29, 2024
1 parent
54fecc4
commit 2874226
Showing
8 changed files
with
52 additions
and
26 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
36 changes: 36 additions & 0 deletions
36
src/entities/activity/ui/items/Matrix/MatrixMultiSelectItem/CheckboxButton.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,36 @@ | ||
import Box from '@mui/material/Box'; | ||
|
||
import { MatrixCell } from '../MatrixCell'; | ||
|
||
import { CheckboxItem, SelectBaseBox } from '~/shared/ui'; | ||
|
||
type Props = { | ||
id: string; | ||
isChecked: boolean; | ||
text: string; | ||
|
||
onChange: () => void; | ||
}; | ||
|
||
export const CheckboxButton = ({ id, isChecked, text, onChange }: Props) => { | ||
return ( | ||
<Box flex={1} key={id}> | ||
<MatrixCell> | ||
<SelectBaseBox | ||
color={null} | ||
onHandleChange={onChange} | ||
checked={isChecked} | ||
justifyContent="center" | ||
> | ||
<CheckboxItem | ||
id={id} | ||
name={text} | ||
value={text} | ||
disabled={false} | ||
defaultChecked={isChecked} | ||
/> | ||
</SelectBaseBox> | ||
</MatrixCell> | ||
</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
2 changes: 1 addition & 1 deletion
2
...ity/ui/items/MatrixCheckboxItem/index.tsx → ...ms/Matrix/MatrixMultiSelectItem/index.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
File renamed without changes.