Skip to content

Commit

Permalink
fix: styled-jsx unique "key" prop (#118)
Browse files Browse the repository at this point in the history
* fix: unique "key" prop

* test(datepicker): update datepicker test snap
  • Loading branch information
jnoodle committed Oct 27, 2020
1 parent ffe59d7 commit 57e473d
Show file tree
Hide file tree
Showing 10 changed files with 2,185 additions and 2,181 deletions.
1,440 changes: 720 additions & 720 deletions components/date-picker/__tests__/__snapshots__/date-picker.test.tsx.snap

Large diffs are not rendered by default.

240 changes: 120 additions & 120 deletions components/date-picker/__tests__/__snapshots__/picker-date.test.tsx.snap

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

360 changes: 180 additions & 180 deletions components/date-picker/__tests__/__snapshots__/picker-time.test.tsx.snap

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1,530 changes: 765 additions & 765 deletions components/date-picker/__tests__/__snapshots__/range-picker.test.tsx.snap

Large diffs are not rendered by default.

16 changes: 10 additions & 6 deletions components/date-picker/style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const animationDuration = '0.2s'
// TODO Unify animation
// picker animation lalala~
export const animationStyle = (
<style jsx global key="date-picker-style-animation">{`
<style jsx global>{`
@keyframes cfxSlideUpIn {
0% {
transform: scaleY(0.8);
Expand Down Expand Up @@ -278,7 +278,8 @@ export const generateSizeStyles = (prefix: string, theme: CfxUIThemes) => {
normalSizes.forEach((size: NormalSizes) => {
const { heightRatio, fontSize, margin } = getSizes(size)
styles.push(
<style jsx global key={`date-picker-style-${size}`}>{`
<div key={`date-picker-style-${size}`}>
<style jsx global>{`
.${prefix}-picker-size-${size} .${prefix}-picker-input {
height: calc(${heightRatio} * ${theme.layout.gap} - 2px);
line-height: calc(${heightRatio} * ${theme.layout.gap} - 3px);
Expand All @@ -289,7 +290,8 @@ export const generateSizeStyles = (prefix: string, theme: CfxUIThemes) => {
font-size: ${fontSize};
line-height: calc(${heightRatio} * ${theme.layout.gap} - 4px);
}
`}</style>,
`}</style>
</div>,
)
})
return styles
Expand All @@ -309,7 +311,8 @@ export const generateVariantStyles = (prefix: string, theme: CfxUIThemes) => {
hoverBackgroundColor,
} = getColors(theme, color, variant === 'solid')
styles.push(
<style jsx global key={`date-picker-style-${color}-${variant}`}>{`
<div key={`date-picker-style-${color}-${variant}`}>
<style jsx global>{`
.${prefix}-picker.${prefix}-picker-variant-${variant}.${prefix}-picker-color-${color} {
color: ${textColor};
background-color: ${backgroundColor};
Expand Down Expand Up @@ -356,7 +359,8 @@ export const generateVariantStyles = (prefix: string, theme: CfxUIThemes) => {
${variant === 'solid' ? `background-color: ${hoverBackgroundColor}` : ''};
}
`}</style>,
`}</style>
</div>,
)
})
})
Expand Down Expand Up @@ -411,7 +415,7 @@ export const generatePickerGlobalStyle = <DateType extends any>(
return (
<>
{animationStyle}
<style jsx global key="date-picker-style-general">{`
<style jsx global>{`
// ***************** panel *****************
Expand Down

0 comments on commit 57e473d

Please sign in to comment.