diff --git a/packages/react-core/src/components/Card/examples/CardSingleSelectable.tsx b/packages/react-core/src/components/Card/examples/CardSingleSelectable.tsx index 83f116e40c0..94fb94c05f0 100644 --- a/packages/react-core/src/components/Card/examples/CardSingleSelectable.tsx +++ b/packages/react-core/src/components/Card/examples/CardSingleSelectable.tsx @@ -1,63 +1,81 @@ import { useState } from 'react'; -import { Card, CardHeader, CardTitle, CardBody, Gallery } from '@patternfly/react-core'; +import { Card, CardHeader, CardTitle, CardBody, Gallery, Checkbox } from '@patternfly/react-core'; export const SingleSelectableCard: React.FunctionComponent = () => { const [isChecked, setIsChecked] = useState(''); const id1 = 'single-selectable-card-input-1'; const id2 = 'single-selectable-card-input-2'; const id3 = 'single-selectable-card-input-3'; + const [displayRadioButton, setDisplayRadioButton] = useState(false); const onChange = (event: React.FormEvent) => { setIsChecked(event.currentTarget.id); }; + const toggleHide = (checked: boolean) => { + setDisplayRadioButton(checked); + }; + return ( - - - - First card - - This card is single selectable. - - - - Second card - - This card is single selectable. - - - - Third card - - This card is single selectable but disabled. - - + <> + toggleHide(checked)} + id="toggle-hide-radio-button" + name="toggle-hide" + /> +
+ + + + First card + + This card is single selectable. + + + + Second card + + This card is single selectable. + + + + Third card + + This card is single selectable but disabled. + + + ); };