Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
[C-2995] Add hint to modal radio items (#3990)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle-Shanks authored Aug 31, 2023
1 parent 6b139db commit a95a733
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
15 changes: 13 additions & 2 deletions packages/web/src/components/modal-radio/ModalRadioItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { ResizeObserver } from '@juggle/resize-observer'
import cn from 'classnames'
import useMeasure from 'react-use-measure'

import { HelpCallout } from 'components/help-callout/HelpCallout'
import layoutStyles from 'components/layout/layout.module.css'
import { Text } from 'components/typography'

Expand All @@ -14,15 +15,24 @@ type ModalRadioItemProps = {
label: string
title?: ReactNode
description?: ReactNode
hintText?: string
value: any
disabled?: boolean
icon?: ReactNode
checkedContent?: ReactNode
}

export const ModalRadioItem = (props: ModalRadioItemProps) => {
const { icon, label, title, description, value, disabled, checkedContent } =
props
const {
icon,
label,
hintText,
title,
description,
value,
disabled,
checkedContent
} = props
const [isCollapsed, setIsCollapsed] = useState(true)
const radioGroup = useContext(RadioGroupContext)

Expand Down Expand Up @@ -55,6 +65,7 @@ export const ModalRadioItem = (props: ModalRadioItemProps) => {
<span>{title ?? label}</span>
</Text>
</div>
{hintText ? <HelpCallout content={hintText} /> : null}
{checkedContent || description ? (
<div
className={cn(styles.collapsibleContainer, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,7 @@ export const AccessAndSaleMenuFields = (props: AccesAndSaleMenuFieldsProps) => {
label={messages.collectibleGated}
value={TrackAvailabilityType.COLLECTIBLE_GATED}
disabled={noCollectibleGate}
hintText={noCollectibleGate ? messages.noCollectibles : undefined}
description={
<CollectibleGatedDescription
hasCollectibles={hasCollectibles}
Expand Down

0 comments on commit a95a733

Please sign in to comment.