-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Functional components/layout/* with css modules (#3278)
- Loading branch information
Showing
56 changed files
with
787 additions
and
921 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
app/components/layout/BlurableContainer/BlurableContainer.jsx
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,14 @@ | ||
import { classNames } from "pi-ui"; | ||
import { useModalVisible } from "./hooks"; | ||
import styles from "./BlurableContainer.module.css"; | ||
|
||
const BlurableContainer = ({ className, children }) => { | ||
const { modalVisible } = useModalVisible(); | ||
return ( | ||
<div className={classNames(className, modalVisible && styles.blur)}> | ||
{children} | ||
</div> | ||
); | ||
}; | ||
|
||
export default BlurableContainer; |
3 changes: 3 additions & 0 deletions
3
app/components/layout/BlurableContainer/BlurableContainer.module.css
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,3 @@ | ||
.blur { | ||
filter: blur(5px); | ||
} |
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,10 @@ | ||
import { useSelector } from "react-redux"; | ||
import * as sel from "selectors"; | ||
|
||
export const useModalVisible = () => { | ||
const modalVisible = useSelector(sel.modalVisible); | ||
|
||
return { | ||
modalVisible | ||
}; | ||
}; |
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 @@ | ||
export { default } from "./BlurableContainer"; |
This file was deleted.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
app/components/layout/DescriptionHeader/DescriptionHeader.jsx
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,11 @@ | ||
import { classNames } from "pi-ui"; | ||
import styles from "./DescriptionHeader.module.css"; | ||
|
||
const DescriptionHeader = ({ description, actionButton, className }) => ( | ||
<div className={classNames(styles.header, className)}> | ||
<div className={styles.actionButton}>{actionButton}</div> | ||
{description} | ||
</div> | ||
); | ||
|
||
export default DescriptionHeader; |
17 changes: 17 additions & 0 deletions
17
app/components/layout/DescriptionHeader/DescriptionHeader.module.css
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,17 @@ | ||
.header { | ||
white-space: pre-wrap; | ||
color: var(--header-desc-lighter-color); | ||
font-size: 13px; | ||
float: left; | ||
width: 100%; | ||
margin-left: 40px; | ||
} | ||
|
||
.actionButton { | ||
position: absolute; | ||
right: 80px; | ||
} | ||
|
||
.actionButton > .button { | ||
min-width: 76px; | ||
} |
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 @@ | ||
export { default } from "./DescriptionHeader"; |
This file was deleted.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
app/components/layout/StandaloneHeader/StandaloneHeader.jsx
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 { TitleHeader } from "../TitleHeader"; | ||
import DescriptionHeader from "../DescriptionHeader"; | ||
import styles from "./StandaloneHeader.module.css"; | ||
|
||
const StandaloneHeader = ({ | ||
title, | ||
description, | ||
iconType, | ||
actionButton | ||
}) => ( | ||
<div className={styles.header}> | ||
<TitleHeader | ||
title={title} | ||
iconType={iconType} | ||
optionalButton={actionButton} | ||
/> | ||
<DescriptionHeader description={description} /> | ||
</div> | ||
); | ||
|
||
export default StandaloneHeader; |
27 changes: 27 additions & 0 deletions
27
app/components/layout/StandaloneHeader/StandaloneHeader.module.css
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,27 @@ | ||
.header { | ||
background-color: var(--background-back-color); | ||
padding: 43px 60px 0px 63px; | ||
position: absolute; | ||
top: 0px; | ||
right: 0px; | ||
left: 0px; | ||
height: 114px; | ||
} | ||
|
||
@media screen and (max-width: 1179px) { | ||
.header { | ||
padding-left: 20px; | ||
} | ||
} | ||
|
||
@media screen and (max-width: 768px) { | ||
.header { | ||
height: initial; | ||
display: flex; | ||
flex-direction: column; | ||
width: 100%; | ||
position: relative; | ||
padding-bottom: 48px; | ||
padding-top: 30px; | ||
} | ||
} |
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 @@ | ||
export { default } from "./StandaloneHeader"; |
This file was deleted.
Oops, something went wrong.
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,20 @@ | ||
import StandalonePageBody from "../StandalonePageBody"; | ||
import { classNames } from "pi-ui"; | ||
import styles from "./StandalonePage.module.css"; | ||
|
||
const StandalonePage = ({ header, children, className }) => { | ||
const body = header ? ( | ||
<StandalonePageBody>{children}</StandalonePageBody> | ||
) : ( | ||
children | ||
); | ||
|
||
return ( | ||
<div className={classNames(styles.page, className)}> | ||
{header} | ||
{body} | ||
</div> | ||
); | ||
}; | ||
|
||
export default StandalonePage; |
7 changes: 7 additions & 0 deletions
7
app/components/layout/StandalonePage/StandalonePage.module.css
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,7 @@ | ||
.page { | ||
position: absolute; | ||
top: 0; | ||
right: 0; | ||
bottom: 0; | ||
left: 0; | ||
} |
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 @@ | ||
export { default } from "./StandalonePage"; |
This file was deleted.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
app/components/layout/StandalonePageBody/StandalonePageBody.jsx
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,7 @@ | ||
import styles from "./StandalonePageBody.module.css"; | ||
|
||
const StandalonePageBody = ({ children }) => ( | ||
<div className={styles.body}>{children}</div> | ||
); | ||
|
||
export default StandalonePageBody; |
23 changes: 23 additions & 0 deletions
23
app/components/layout/StandalonePageBody/StandalonePageBody.module.css
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,23 @@ | ||
.body { | ||
overflow-x: hidden; | ||
overflow-y: scroll; | ||
position: absolute; | ||
right: 0px; | ||
top: 157px; | ||
bottom: 0px; | ||
left: 0px; | ||
padding: 38px 60px 30px 63px; | ||
background-color: var(--background-container); | ||
} | ||
|
||
@media screen and (max-width: 1179px) { | ||
.body { | ||
padding-left: 20px; | ||
} | ||
} | ||
|
||
@media screen and (max-width: 768px) { | ||
.body { | ||
top: 113px; | ||
} | ||
} |
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 @@ | ||
export { default } from "./StandalonePageBody"; |
Oops, something went wrong.