-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
16b126d
commit 16fe163
Showing
11 changed files
with
188 additions
and
60 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
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
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
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
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,31 @@ | ||
import TabBar from '../../TabBar' | ||
import { LayerPanelDescription, LayerPanelContainer, LayerPanelHeader, LayerPanelTitle } from './styled' | ||
import { LayerPanelProps } from './types' | ||
|
||
const LayerPanel = ({ | ||
title, | ||
description, | ||
tabBarVariant = 'panel', | ||
buttonTabs, | ||
defaultActiveTabLabel, | ||
onTabClick, | ||
children, | ||
}: LayerPanelProps) => ( | ||
<LayerPanelContainer> | ||
<LayerPanelHeader> | ||
<LayerPanelTitle>{title}</LayerPanelTitle> | ||
<LayerPanelDescription>{description}</LayerPanelDescription> | ||
</LayerPanelHeader> | ||
{buttonTabs && buttonTabs.length > 0 ? ( | ||
<TabBar | ||
variant={tabBarVariant} | ||
defaultActiveTabLabel={defaultActiveTabLabel} | ||
tabs={buttonTabs} | ||
onTabClick={onTabClick} | ||
/> | ||
) : null} | ||
{children} | ||
</LayerPanelContainer> | ||
) | ||
|
||
export default LayerPanel |
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,34 @@ | ||
import styled from '@emotion/styled' | ||
import { getThemedColor, ThemeProps } from '../../../lib/theme' | ||
|
||
export const LayerPanelContainer = styled.div<{ | ||
theme?: ThemeProps | ||
}>` | ||
width: 300px; | ||
background-color: ${({ theme }) => getThemedColor(theme.colors, 'neutral', 100)}; | ||
` | ||
|
||
export const LayerPanelHeader = styled.div<{ | ||
theme?: ThemeProps | ||
}>` | ||
padding: 16px 16px 20px 16px; | ||
border-bottom: 1px solid ${({ theme }) => getThemedColor(theme.colors, 'neutral', 300)}; | ||
` | ||
|
||
export const LayerPanelTitle = styled.p<{ | ||
theme?: ThemeProps | ||
}>` | ||
color: ${({ theme }) => getThemedColor(theme.colors, 'neutral', 700)}; | ||
font-weight: 700; | ||
font-size: 20px; | ||
line-height: 28px; | ||
` | ||
|
||
export const LayerPanelDescription = styled.p<{ | ||
theme?: ThemeProps | ||
}>` | ||
color: ${({ theme }) => getThemedColor(theme.colors, 'neutral', 600)}; | ||
font-weight: 400; | ||
font-size: 14px; | ||
line-height: 20px; | ||
` |
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,11 @@ | ||
import { TabBarItemProps } from '../../TabBar/types' | ||
|
||
export type LayerPanelProps = { | ||
title: string | ||
description: string | ||
tabBarVariant?: 'panel' | 'view' | ||
buttonTabs?: TabBarItemProps[] | ||
defaultActiveTabLabel?: string | ||
onTabClick?: (tabLabel: string) => void | ||
children: React.ReactNode | ||
} |
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
Oops, something went wrong.