Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added height prop to toggle tag #3257

Merged
merged 1 commit into from
Feb 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@ const ToggleTab: React.FC<{
}

const Toggle: React.FC<{
height?: string
children: Array<{ props: { title: string } } | string>
}> = ({ children }) => {
}> = ({ height, children }) => {
const [toggleId, setToggleId] = useState('')
const {
addNewToggle = (): null => null,
Expand Down Expand Up @@ -181,17 +182,20 @@ const Toggle: React.FC<{
}
onChange={(): void => updateToggleInd(toggleId, i)}
>
{tab}
<div
className={cn('tab', styles.tab)}
style={{
minHeight: height
}}
>
{tab}
</div>
</ToggleTab>
))}
</div>
)
}

const Tab: React.FC = ({ children }) => (
<div className={cn('tab', styles.tab)}>{children}</div>
)

// Rehype's typedefs don't allow for custom components, even though they work
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const renderAst = new (rehypeReact as any)({
Expand All @@ -204,7 +208,7 @@ const renderAst = new (rehypeReact as any)({
cards: Cards,
details: Details,
toggle: Toggle,
tab: Tab
tab: React.Fragment
}
}).Compiler

Expand Down