-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to styled-components v6 (#6510)
* bump styled-components to v6 and get all the tests passing * minor updates based on migration guide * adjust next.config.mjs in app-root
- Loading branch information
1 parent
634f67a
commit b6322d2
Showing
34 changed files
with
623 additions
and
567 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
# Theme | ||
|
||
Creates a Grommet theme by performing a deep merge of the Grommet base theme with the Zooniverse custom Grommet theme. | ||
|
||
This was originally done in the `GrommetWrapper` theme, but was moved here so it can be reused with `@artsy/fresnel` to extract the breakpoints for responsive sizing. |
43 changes: 14 additions & 29 deletions
43
...p-project/src/screens/ProjectHomePage/components/Hero/components/Background/Background.js
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,45 +1,30 @@ | ||
import { number, shape, string } from 'prop-types' | ||
import styled, { css, withTheme } from 'styled-components' | ||
import { string } from 'prop-types' | ||
import styled from 'styled-components' | ||
|
||
const Img = styled.img` | ||
height: 230px; | ||
min-height: inherit; | ||
object-fit: cover; | ||
width: 100%; | ||
height: 230px; | ||
min-height: inherit; | ||
object-fit: cover; | ||
width: 100%; | ||
${props => css` | ||
@media (min-width: ${props.breakpoint}px) { | ||
flex: 1 1 auto; | ||
object-position: 0 50%; | ||
} | ||
`} | ||
// Grommet small breakpoint | ||
@media (width > 769px) { | ||
flex: 1 1 auto; | ||
object-position: 0 50%; | ||
} | ||
` | ||
|
||
function Background ({ | ||
backgroundSrc, | ||
theme | ||
}) { | ||
const breakpoint = theme.global.breakpoints.small.value | ||
function Background ({ backgroundSrc }) { | ||
return ( | ||
<Img | ||
alt='' | ||
breakpoint={breakpoint} | ||
src={backgroundSrc} | ||
/> | ||
) | ||
} | ||
|
||
Background.propTypes = { | ||
backgroundSrc: string.isRequired, | ||
theme: shape({ | ||
global: shape({ | ||
breakpoints: shape({ | ||
small: shape({ | ||
value: number.isRequired | ||
}).isRequired | ||
}).isRequired | ||
}).isRequired | ||
}).isRequired | ||
backgroundSrc: string.isRequired | ||
} | ||
|
||
export default withTheme(Background) | ||
export default Background |
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,5 +1,6 @@ | ||
{ | ||
"plugins": [ | ||
"babel-plugin-styled-components", | ||
["@babel/plugin-transform-runtime", { | ||
"helpers": false | ||
}], | ||
|
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.