-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #304 from TaloDev/events-filter
Add new events filter to overview page
- Loading branch information
Showing
12 changed files
with
242 additions
and
164 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { useState } from 'react' | ||
import clsx from 'clsx' | ||
import { IconCheck } from '@tabler/icons-react' | ||
import { hiddenInputStyle, labelFocusStyle } from '../styles/theme' | ||
|
||
type CheckboxButtonProps = { | ||
id: string | ||
checked: boolean | ||
onChange: (checked: boolean) => void | ||
label: string | ||
} | ||
|
||
export default function CheckboxButton({ id, checked, label, onChange }: CheckboxButtonProps) { | ||
const [focus, setFocus] = useState(false) | ||
|
||
return ( | ||
<> | ||
<input | ||
id={id} | ||
type='checkbox' | ||
className={hiddenInputStyle} | ||
onFocus={() => setFocus(true)} | ||
onBlur={() => setFocus(false)} | ||
onChange={() => onChange(!checked)} | ||
/> | ||
|
||
<label | ||
htmlFor={id} | ||
className={clsx('p-1 rounded hover:bg-gray-200 flex items-center space-x-2 cursor-pointer transition-all', { [labelFocusStyle]: focus })} | ||
> | ||
<span className='inline-block rounded w-6 h-6 bg-white border border-black/30 align-text-bottom text-black active:bg-gray-200 transition-colors'> | ||
{checked && | ||
<span className='flex items-center justify-center h-full'> | ||
<IconCheck size={16} stroke={3} /> | ||
</span> | ||
} | ||
</span> | ||
<span>{label}</span> | ||
</label> | ||
</> | ||
) | ||
} |
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
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
Oops, something went wrong.