Skip to content

Commit

Permalink
Merge pull request #2395 from gluestack/fix/formControl
Browse files Browse the repository at this point in the history
fix: form-control example
  • Loading branch information
Viraj-10 authored Aug 21, 2024
2 parents 918e09a + 3be8149 commit c7fd725
Showing 1 changed file with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,39 +159,36 @@ The Radio Component can be incorporated within the FormControl.
showArgsController={false}
metaData={{
code: `
function App () {
const [values, setValues] = React.useState("Mango");
return (
<FormControl>
<FormControlLabel>
<FormControlLabelText>
Favourite fruit
</FormControlLabelText>
</FormControlLabel>
<RadioGroup className='my-2'>
<RadioGroup className='my-2' value={values} onChange={setValues}>
<VStack space="sm">
<Radio size="sm" value="Mango">
<RadioIndicator>
<RadioIcon>
<CircleIcon/>
</RadioIcon>
<RadioIcon as={CircleIcon} />
</RadioIndicator>
<RadioLabel>
Mango
</RadioLabel>
</Radio>
<Radio size="sm" value="Apple">
<RadioIndicator>
<RadioIcon>
<CircleIcon/>
</RadioIcon>
<RadioIcon as={CircleIcon} />
</RadioIndicator>
<RadioLabel>
Apple
</RadioLabel>
</Radio>
<Radio size="sm" value="Orange">
<RadioIndicator>
<RadioIcon>
<CircleIcon/>
</RadioIcon>
<RadioIcon as={CircleIcon} />
</RadioIndicator>
<RadioLabel>
Orange
Expand All @@ -205,9 +202,11 @@ The Radio Component can be incorporated within the FormControl.
</FormControlHelperText>
</FormControlHelper>
</FormControl>
)
}
`,
transformCode: (code) => {
return transformedCode(code);
return transformedCode(code, 'function', 'App');
},
scope: {
Wrapper,
Expand Down

0 comments on commit c7fd725

Please sign in to comment.