feat: persist selected tag & note locally (#1851)
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
type Props = {
|
||||
checked: boolean
|
||||
className?: string
|
||||
}
|
||||
|
||||
const RadioIndicator = ({ checked, className }: Props) => (
|
||||
<div
|
||||
className={`relative h-4 w-4 rounded-full border-2 border-solid ${
|
||||
checked
|
||||
? 'border-info after:absolute after:top-1/2 after:left-1/2 after:h-2 after:w-2 after:-translate-x-1/2 after:-translate-y-1/2 after:rounded-full after:bg-info'
|
||||
: 'border-passive-1'
|
||||
} ${className}`}
|
||||
></div>
|
||||
)
|
||||
|
||||
export default RadioIndicator
|
||||
@@ -0,0 +1,16 @@
|
||||
import { classNames } from '@/Utils/ConcatenateClassNames'
|
||||
import { ComponentPropsWithoutRef } from 'react'
|
||||
import RadioIndicator from './RadioIndicator'
|
||||
|
||||
type Props = ComponentPropsWithoutRef<'input'>
|
||||
|
||||
const StyledRadioInput = (props: Props) => {
|
||||
return (
|
||||
<div className="flex">
|
||||
<input type="radio" className={classNames('h-0 w-0 opacity-0', props.className)} {...props} />
|
||||
<RadioIndicator checked={!!props.checked} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default StyledRadioInput
|
||||
Reference in New Issue
Block a user