-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: upgrade to styled components version 6
BREAKING CHANGE: styled-components peer dependency bumped up to v6 NDS was upgraded with [re-enabled vendor prefixes](https://styled-components.com/docs/faqs#shouldforwardprop-is-no-longer-provided-by-default) and using a [StyleSheetManager to restore v5 behaviour for shouldForwardProp](https://styled-components.com/docs/faqs#shouldforwardprop-is-no-longer-provided-by-default) Follow the migration guide for app upgrades to v6 https://styled-components.com/docs/faqs#what-do-i-need-to-do-to-migrate-to-v6
- Loading branch information
1 parent
067c494
commit 18597bd
Showing
31 changed files
with
278 additions
and
318 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
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
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,34 +1,28 @@ | ||
import React from "react"; | ||
import styled, { CSSObject } from "styled-components"; | ||
import styled from "styled-components"; | ||
import { transparentize } from "polished"; | ||
import { DefaultNDSThemeType } from "../theme"; | ||
|
||
const getHeaderPaddingRight = (closeButtonIncluded?: boolean, theme?: DefaultNDSThemeType) => | ||
closeButtonIncluded ? theme.space.x8 : theme.space.x3; | ||
|
||
type ModalHeaderProps = React.ComponentPropsWithRef<"div"> & { | ||
const ModalHeader = styled.div<{ | ||
hasCloseButton?: boolean; | ||
theme?: DefaultNDSThemeType; | ||
}; | ||
|
||
const ModalHeader = styled.div( | ||
({ hasCloseButton, theme }: ModalHeaderProps): CSSObject => ({ | ||
position: "relative", | ||
padding: `${theme.space.x2} ${getHeaderPaddingRight(hasCloseButton, theme)} ${theme.space.x2} ${theme.space.x3}`, | ||
backgroundColor: transparentize(0.1, theme.colors.white), | ||
zIndex: theme.zIndices.modalHeaderAndFooter, | ||
borderRadius: `${theme.radii.medium} ${theme.radii.medium} 0 0`, | ||
":after": { | ||
content: "''", | ||
position: "absolute", | ||
bottom: 0, | ||
left: theme.space.x1, | ||
right: theme.space.x1, | ||
display: "block", | ||
margin: "0 auto", | ||
borderBottom: `solid 1px ${theme.colors.lightGrey}`, | ||
}, | ||
}) | ||
); | ||
}>(({ hasCloseButton, theme }) => ({ | ||
position: "relative", | ||
padding: `${theme.space.x2} ${getHeaderPaddingRight(hasCloseButton, theme)} ${theme.space.x2} ${theme.space.x3}`, | ||
backgroundColor: transparentize(0.1, theme.colors.white), | ||
zIndex: theme.zIndices.modalHeaderAndFooter, | ||
borderRadius: `${theme.radii.medium} ${theme.radii.medium} 0 0`, | ||
":after": { | ||
content: "''", | ||
position: "absolute", | ||
bottom: 0, | ||
left: theme.space.x1, | ||
right: theme.space.x1, | ||
display: "block", | ||
margin: "0 auto", | ||
borderBottom: `solid 1px ${theme.colors.lightGrey}`, | ||
}, | ||
})); | ||
|
||
export default ModalHeader; |
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
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.