-
Notifications
You must be signed in to change notification settings - Fork 750
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
576c2a1
commit 72162ed
Showing
5 changed files
with
71 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import styled from "styled-components"; | ||
|
||
const GridLayout = styled.div` | ||
display: grid; | ||
grid-template-columns: repeat(6, 1fr); | ||
grid-gap: 16px; | ||
${({ theme }) => theme.scales.mediaQueries.sm} { | ||
grid-template-columns: repeat(8, 1fr); | ||
grid-gap: 24px; | ||
} | ||
${({ theme }) => theme.scales.mediaQueries.md} { | ||
grid-template-columns: repeat(12, 1fr); | ||
grid-gap: 24px; | ||
} | ||
${({ theme }) => theme.scales.mediaQueries.lg} { | ||
grid-template-columns: repeat(12, 1fr); | ||
grid-gap: 32px; | ||
} | ||
`; | ||
|
||
export default GridLayout; |
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,13 @@ | ||
import styled from "styled-components"; | ||
import BaseLayout from "./BaseLayout"; | ||
|
||
const GridLayout = styled(BaseLayout)` | ||
& > div { | ||
grid-column: span 6; | ||
${({ theme }) => theme.scales.mediaQueries.sm} { | ||
grid-column: span 4; | ||
} | ||
} | ||
`; | ||
|
||
export default GridLayout; |
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,34 @@ | ||
import React from "react"; | ||
import styled from "styled-components"; | ||
import { BaseLayout, CardsLayout } from "."; | ||
|
||
export default { | ||
title: "Layouts", | ||
argTypes: {}, | ||
}; | ||
|
||
const Stub = styled.div` | ||
width: 100%; | ||
background: #1fc7d4; | ||
height: 300px; | ||
`; | ||
|
||
export const Base: React.FC = () => { | ||
return ( | ||
<BaseLayout> | ||
{[...Array(24)].map((value) => ( | ||
<Stub key={value} /> | ||
))} | ||
</BaseLayout> | ||
); | ||
}; | ||
|
||
export const Cards: React.FC = () => { | ||
return ( | ||
<CardsLayout> | ||
{[...Array(10)].map((value) => ( | ||
<Stub key={value} /> | ||
))} | ||
</CardsLayout> | ||
); | ||
}; |
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,2 @@ | ||
export { default as BaseLayout } from "./BaseLayout"; | ||
export { default as CardsLayout } from "./CardsLayout"; |
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