diff options
author | Samuel Newman <mozzius@protonmail.com> | 2025-02-03 14:18:13 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-03 22:18:13 +0000 |
commit | fa8607b861e0719d76778aa14af0745313640e33 (patch) | |
tree | 7496a49cba6627809be0a4067dde5cca0d8fece0 /src/view/com/util/forms/RadioGroup.tsx | |
parent | 23e62b18de9537b50c8b1df2b4744adc030501d0 (diff) | |
download | voidsky-fa8607b861e0719d76778aa14af0745313640e33.tar.zst |
Spring cleaning (#7640)
* delete breakpoint layouts * delete empty file * delete legacy radio buttons * delete selectable button * rm radio buttons from debug * delete storage.ts * delete type-assertions.ts
Diffstat (limited to 'src/view/com/util/forms/RadioGroup.tsx')
-rw-r--r-- | src/view/com/util/forms/RadioGroup.tsx | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/src/view/com/util/forms/RadioGroup.tsx b/src/view/com/util/forms/RadioGroup.tsx deleted file mode 100644 index e2a26dc49..000000000 --- a/src/view/com/util/forms/RadioGroup.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import {useState} from 'react' -import {View} from 'react-native' - -import {s} from '#/lib/styles' -import {ButtonType} from './Button' -import {RadioButton} from './RadioButton' - -export interface RadioGroupItem { - label: string | JSX.Element - key: string -} - -export function RadioGroup({ - testID, - type, - items, - initialSelection = '', - onSelect, -}: { - testID?: string - type?: ButtonType - items: RadioGroupItem[] - initialSelection?: string - onSelect: (key: string) => void -}) { - const [selection, setSelection] = useState<string>(initialSelection) - const onSelectInner = (key: string) => { - setSelection(key) - onSelect(key) - } - return ( - <View> - {items.map((item, i) => ( - <RadioButton - key={item.key} - testID={testID ? `${testID}-${item.key}` : undefined} - style={i !== 0 ? s.mt2 : undefined} - type={type} - label={item.label} - isSelected={item.key === selection} - onPress={() => onSelectInner(item.key)} - /> - ))} - </View> - ) -} |