-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New layout wip: button styling, hero component etc (#1240)
* more button styling; add contentwrapper; introduction * created generic hero, generallist etc., fixed module page card size uniformity
- Loading branch information
Showing
35 changed files
with
1,990 additions
and
917 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { styled } from "@mui/material/styles" | ||
|
||
const ContentWrapper = styled("div")( | ||
({ theme }) => ` | ||
margin: 0 auto; | ||
max-width: 100%; | ||
padding: 0 1rem; | ||
position: relative; | ||
${theme.breakpoints.up("sm")} { | ||
padding: 0 2rem; | ||
} | ||
${theme.breakpoints.up("lg")} { | ||
max-width: 1216px; | ||
padding: 0; | ||
} | ||
`, | ||
) | ||
|
||
export default ContentWrapper |
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,72 @@ | ||
import React from "react" | ||
|
||
import { styled } from "@mui/material/styles" | ||
|
||
import GeneralListItem, { GeneralListItemProps } from "./GeneralListItem" | ||
|
||
const GeneralListRoot = styled("ul")( | ||
({ theme, children }) => ` | ||
list-style: none; | ||
margin: 0; | ||
padding: 0; | ||
margin-bottom: 1.75rem; | ||
${theme.breakpoints.up("md")} { | ||
margin-bottom: 2rem; | ||
} | ||
${theme.breakpoints.up("lg")} { | ||
margin-bottom: 2.5rem; | ||
} | ||
&.list__style-grid { | ||
display: flex; | ||
display: grid; | ||
gap: 32px 0; | ||
${theme.breakpoints.up(768)} { | ||
grid-template-columns: repeat(2, 1fr); | ||
gap: 32px 24px; | ||
} | ||
${theme.breakpoints.up("desktop")} { | ||
${ | ||
// no orphans | ||
React.Children.count(children) % 3 !== 1 | ||
? "grid-template-columns: repeat(3, 1fr);" | ||
: "" | ||
} | ||
} | ||
${theme.breakpoints.up("xxl")} { | ||
gap: 32px; | ||
} | ||
li { | ||
background-color: ${theme.palette.common.grayscale.backgroundBox}; | ||
width: 100%; | ||
height: auto; | ||
} | ||
} | ||
`, | ||
) | ||
|
||
const listStyles = ["list", "grid"] as const | ||
|
||
export type ListStyle = (typeof listStyles)[number] | ||
|
||
export interface GeneralListProps { | ||
type?: ListStyle | ||
items?: Array<GeneralListItemProps> | ||
} | ||
|
||
const GeneralList = ({ type, items }: GeneralListProps) => { | ||
return ( | ||
<GeneralListRoot className={`list__style-${type}`}> | ||
{items?.map((item) => ( | ||
<GeneralListItem key={item.title} {...item} listStyle={type} /> | ||
))} | ||
</GeneralListRoot> | ||
) | ||
} | ||
|
||
export default GeneralList |
Oops, something went wrong.