-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1030 from glints-dev/feature/add-select-options-s…
…ublabel feat: Add sublabel to select component options
- Loading branch information
Showing
7 changed files
with
162 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,30 @@ | ||
import React from 'react'; | ||
import { Typography } from '../../Typography'; | ||
import { Neutral } from '../../utilities/colors'; | ||
import { MenuOptionLabelContainer } from './MenuOptionLabelStyle'; | ||
|
||
interface MenuOptionLabelProps { | ||
label: React.ReactNode; | ||
sublabel?: React.ReactNode; | ||
} | ||
|
||
export const MenuOptionLabel = ({ label, sublabel }: MenuOptionLabelProps) => { | ||
if (!sublabel) { | ||
return ( | ||
<Typography as="span" variant="body1" color={Neutral.B18}> | ||
{label} | ||
</Typography> | ||
); | ||
} | ||
|
||
export const MenuOptionLabel = ({ label }: { label: React.ReactNode }) => { | ||
return ( | ||
<Typography as="span" variant="body1" color={Neutral.B18}> | ||
{label} | ||
</Typography> | ||
<MenuOptionLabelContainer> | ||
<Typography as="span" variant="body1" color={Neutral.B18}> | ||
{label} | ||
</Typography> | ||
<Typography as="span" variant="subtitle2" color={Neutral.B40}> | ||
{sublabel} | ||
</Typography> | ||
</MenuOptionLabelContainer> | ||
); | ||
}; |
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,10 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const MenuOptionLabelContainer = styled.div<{ | ||
sublabel?: React.ReactNode; | ||
}>` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
padding: 4px 0; | ||
`; |
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
Binary file added
BIN
+19.7 KB
.../select/select.spec.ts-snapshots/select-with-sublabel-option-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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