Skip to content

Commit

Permalink
membership
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbuechele committed Oct 26, 2024
1 parent 1e913ed commit e602040
Show file tree
Hide file tree
Showing 4 changed files with 693 additions and 133 deletions.
13 changes: 10 additions & 3 deletions app/components/RadioStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,28 @@ import {
Text,
} from '@chakra-ui/react';
import {useField} from 'formik';
import React from 'react';
import React, {useEffect} from 'react';

export default function RadioStack(props: {
children: Array<React.ReactElement<RadioStackTabProps>>;
children: Array<React.ReactElement<RadioStackTabProps> | boolean>;
onChangeEffect?: (value: string) => void;
}) {
const {id} = useFormControlContext();
const [field] = useField({name: id});
const {getRootProps} = useRadioGroup(field);

useEffect(() => {
if (props.onChangeEffect) {
props.onChangeEffect(field.value);
}
}, [field.value]);

return (
<Stack
direction={['column', 'row']}
gap={0}
{...getRootProps()}
borderRadius="var(--chakra-radii-md)"
borderRadius="md"
borderWidth="1px"
borderColor="var(--chakra-colors-chakra-border-color)"
_hover={{
Expand Down
Loading

0 comments on commit e602040

Please sign in to comment.