-
Notifications
You must be signed in to change notification settings - Fork 53
refactor(Divider): remove type
prop
#558
Changes from all commits
e1a0b49
4829e5a
3fc89fa
20d3840
3d4df45
8c572a4
95f2909
2c51f56
b1a58c0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
import * as _ from 'lodash' | ||
|
||
import { EmphasisColors, NaturalColors } from '../../../types' | ||
import { pxToRem } from '../../../../lib' | ||
|
||
export interface DividerVariables { | ||
colors: EmphasisColors & NaturalColors | ||
colors: Record<keyof (EmphasisColors & NaturalColors), string> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TIL: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @layershifter can we extract this interface |
||
dividerColor: string | ||
textColor: string | ||
textFontSize: string | ||
textLineHeight: string | ||
primaryColor: string | ||
importantFontWeight: string | ||
dividerPadding: string | ||
} | ||
|
||
export default (siteVars: any): DividerVariables => { | ||
const colorVariant = '500' | ||
|
||
return { | ||
colors: { ...siteVars.emphasisColors, ...siteVars.naturalColors }, | ||
colors: _.mapValues({ ...siteVars.emphasisColors, ...siteVars.naturalColors }, colorVariant), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @layershifter can we extract this method |
||
dividerColor: siteVars.gray09, | ||
textColor: siteVars.gray03, | ||
textFontSize: siteVars.fontSizeSmall, | ||
textLineHeight: siteVars.lineHeightSmall, | ||
primaryColor: siteVars.brand, | ||
importantFontWeight: siteVars.fontWeightBold, | ||
dividerPadding: pxToRem(4), | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.