Skip to content

Commit

Permalink
Merge pull request #304 from TaloDev/events-filter
Browse files Browse the repository at this point in the history
Add new events filter to overview page
  • Loading branch information
tudddorrr authored Oct 24, 2024
2 parents 4f0d5a7 + d5f07f7 commit f4696b1
Show file tree
Hide file tree
Showing 12 changed files with 242 additions and 164 deletions.
106 changes: 30 additions & 76 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"react-hook-form": "^7.43.8",
"react-router-dom": "^6.23.1",
"react-select": "^5.8.0",
"recharts": "^2.1.15",
"recharts": "^2.13.0",
"recoil": "^0.7.6",
"swr": "^2.0.0",
"use-debounce": "^9.0.0",
Expand Down
42 changes: 42 additions & 0 deletions src/components/CheckboxButton.tsx
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>
</>
)
}
44 changes: 0 additions & 44 deletions src/components/ColourfulCheckbox.tsx

This file was deleted.

1 change: 1 addition & 0 deletions src/components/DateInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export default function DateInput({
onFocus: () => setOpen(true),
name: id
}}
inputClassName='caret-transparent cursor-pointer'
{...textInputProps}
/>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/GameSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ export default function GameSwitcher() {
<motion.ul
animate={{ opacity: isOpen ? 1 : 0 }}
transition={{ duration: 0.2 }}
className='bg-white text-black rounded-b w-60 md:w-80 shadow'
className='bg-white text-black rounded-b w-60 md:w-80 shadow divide-y divide-gray-300'
>
{games.map((game) => {
const disabled = activeGame.id === game.id

return (
<li key={game.name} className={clsx('border-b border-gray-300', dropdownButtonStyle, { ['!bg-transparent']: disabled })}>
<li key={game.name} className={clsx(dropdownButtonStyle, { ['!bg-transparent']: disabled })}>
<Button
variant='bare'
disabled={disabled}
Expand Down
4 changes: 2 additions & 2 deletions src/components/RadioGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ function RadioGroup<T>({
<label
htmlFor={`${name}${idx}`}
className={clsx(
'block font-semibold border border-gray-300 p-2 rounded cursor-pointer transition-colors hover:bg-gray-100',
'block font-semibold border border-black/30 p-2 rounded cursor-pointer transition-colors hover:bg-gray-100',
{ 'bg-indigo-500 hover:!bg-indigo-500 border-indigo-500': selected },
{ [labelFocusStyle]: option.value === focusedValue }
)}
>
<span className={clsx('inline-block relative rounded-full w-4 h-4 bg-white align-text-bottom border border-gray-300', { 'border-indigo-500': selected })}>
<span className={clsx('inline-block relative rounded-full w-4 h-4 bg-white align-text-bottom border border-black/30', { 'border-indigo-500': selected })}>
{selected &&
<span className='absolute inset-0 rounded-full bg-indigo-300 m-0.5' />
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default function TextInput({
`, {
'bg-gray-600': !variant,
'bg-gray-100 text-black': variant === 'light',
'bg-white border border-gray-300 focus:border-opacity-0': variant === 'modal'
'bg-white border border-black/30 focus:border-black/0': variant === 'modal'
})

return (
Expand Down
Loading

0 comments on commit f4696b1

Please sign in to comment.