-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DEV-1577] Fix rendering of a single tab in a group of tabs (#804)
* Fix rendering of a single tab in a group of tabs * Add changeset
- Loading branch information
1 parent
504daa8
commit e496be4
Showing
3 changed files
with
43 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"nextjs-website": patch | ||
--- | ||
|
||
Fix the rendering of a single tab in a group of tabs |
28 changes: 28 additions & 0 deletions
28
apps/nextjs-website/src/components/organisms/GitBookContent/components/Tab.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React, { ReactNode } from 'react'; | ||
import { useTheme } from '@mui/material'; | ||
|
||
type TabProps = { | ||
children: ReactNode; | ||
hidden: boolean; | ||
}; | ||
|
||
const Tab = ({ children, hidden }: TabProps) => { | ||
const { palette } = useTheme(); | ||
|
||
return ( | ||
<div | ||
hidden={hidden} | ||
style={{ | ||
border: `1px solid ${palette.divider}`, | ||
borderTopRightRadius: 4, | ||
borderBottomRightRadius: 4, | ||
borderBottomLeftRadius: 4, | ||
padding: 16, | ||
}} | ||
> | ||
{children} | ||
</div> | ||
); | ||
}; | ||
|
||
export default Tab; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters