parent
216dece1ed
commit
d44f79ac43
@ -1,19 +0,0 @@ |
||||
.wrapper { |
||||
display: flex; |
||||
flex-direction: column; |
||||
justify-content: center; |
||||
align-items: center; |
||||
text-align: center; |
||||
margin: calc(40rem / 16) auto; |
||||
padding: 0 15%; |
||||
} |
||||
|
||||
.graphWrapper { |
||||
margin-top: calc(50rem / 16); |
||||
} |
||||
|
||||
@media screen and (max-width: 768px) { |
||||
.wrapper { |
||||
padding: 0 calc(20rem / 16); |
||||
} |
||||
} |
@ -1,25 +0,0 @@ |
||||
import React from "react"; |
||||
|
||||
import styles from "./CenterComponentWrapper.module.css"; |
||||
|
||||
type FullComponentWrapperProps = { |
||||
children: React.ReactNode; |
||||
heading: string; |
||||
body: string; |
||||
}; |
||||
|
||||
export function CenterComponentWrapper({ |
||||
heading, |
||||
body, |
||||
children, |
||||
}: FullComponentWrapperProps) { |
||||
return ( |
||||
<section className={styles.wrapper}> |
||||
<div> |
||||
<h3>{heading}</h3> |
||||
<p>{body}</p> |
||||
</div> |
||||
<div className={styles.graphWrapper}>{children}</div> |
||||
</section> |
||||
); |
||||
} |
@ -1,27 +1,37 @@ |
||||
import React from "react"; |
||||
|
||||
import styles from "./SideComponentWrapper.module.css"; |
||||
import styles from "./ComponentWrapper.module.css"; |
||||
|
||||
type AlignOption = "left" | "center" | "right"; |
||||
|
||||
type ComponentWrapperProps = { |
||||
children: React.ReactNode; |
||||
heading: string; |
||||
body: string; |
||||
align?: "left" | "right"; |
||||
align?: AlignOption; |
||||
noBackground?: boolean; |
||||
center?: boolean; |
||||
}; |
||||
|
||||
export function SideComponentWrapper({ |
||||
export function ComponentWrapper({ |
||||
heading, |
||||
body, |
||||
children, |
||||
align = "left", |
||||
noBackground = false, |
||||
}: ComponentWrapperProps) { |
||||
const alignClasses: { [key in AlignOption]: string } = { |
||||
left: styles.wrapperLeft, |
||||
center: styles.wrapperCenter, |
||||
right: styles.wrapperRight, |
||||
}; |
||||
|
||||
return ( |
||||
<div |
||||
className={`${ |
||||
align === "right" ? styles.wrapperRight : styles.wrapperLeft |
||||
} ${noBackground ? styles.noBackground : ""}`}
|
||||
className={` |
||||
${alignClasses[align]}
|
||||
${noBackground ? styles.noBackground : ""} |
||||
`}
|
||||
> |
||||
<div className={styles.internalWrapper}> |
||||
<h3>{heading}</h3> |
Loading…
Reference in new issue