-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
e67fb9e
commit cc93a2c
Showing
18 changed files
with
184 additions
and
71 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,6 @@ | ||
import React from "react"; | ||
import styles from './style.module.css'; | ||
|
||
export const Item: React.FC = ({ children }) => { | ||
return (<div className={styles.item}>{children}</div>) | ||
} |
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 @@ | ||
.item { | ||
display: flex; | ||
align-items: flex-start; | ||
flex-direction: column; | ||
padding: var(--spacings-xs); | ||
min-width: 25%; | ||
box-sizing: border-box; | ||
position: relative; | ||
} | ||
|
||
@media screen and (min-width: 375px) { | ||
.item { | ||
min-width: 50%; | ||
} | ||
} | ||
|
||
@media screen and (min-width: 768px) { | ||
.item { | ||
min-width: 33.3%; | ||
} | ||
} | ||
|
||
|
||
@media screen and (min-width: 1366px) { | ||
.item { | ||
min-width: 25%; | ||
} | ||
} | ||
|
||
@media screen and (min-width: 1920px) { | ||
.item { | ||
min-width: 20%; | ||
} | ||
} |
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 React from 'react'; | ||
import styles from './style.module.css'; | ||
export { Item } from './Item/index'; | ||
|
||
export const Grid: React.FC = ({ children }) => { | ||
return <div className={styles.section}>{children}</div> | ||
} |
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,6 @@ | ||
.section { | ||
display: flex; | ||
flex-wrap: wrap; | ||
justify-content: space-between; | ||
position: relative; | ||
} |
26 changes: 26 additions & 0 deletions
26
devtool/src/_shared/components/Slices/Colors/Detail/index.tsx
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,26 @@ | ||
import React, { useMemo } from 'react'; | ||
import { Card } from '../../../Card'; | ||
import { useRouter } from '../../../../hooks/useRouter'; | ||
import { Color, useTheme } from '@morfeo/react'; | ||
import styles from './style.module.css'; | ||
|
||
export const Detail: React.FC = () => { | ||
const { route } = useRouter(); | ||
const { state } = route; | ||
|
||
const theme = useTheme(); | ||
const colorSlice = useMemo(() => (theme || {})['colors'] || {}, [theme]); | ||
console.log({ state, theme, colorSlice }); | ||
const bgColor = useMemo( | ||
() => | ||
(state?.detailKey && (colorSlice || {})[state.detailKey as Color]) || | ||
'white', | ||
[colorSlice, state?.detailKey], | ||
); | ||
|
||
return ( | ||
<div className={styles.container}> | ||
<Card className="morfeo-card-primary" style={{ bg: bgColor as Color }} /> | ||
</div> | ||
); | ||
}; |
4 changes: 4 additions & 0 deletions
4
devtool/src/_shared/components/Slices/Colors/Detail/style.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,4 @@ | ||
.container { | ||
padding-left: var(--spacings-xs); | ||
padding-right: var(--spacings-xs); | ||
} |
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
13 changes: 9 additions & 4 deletions
13
devtool/src/_shared/components/Slices/Colors/style.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 |
---|---|---|
@@ -1,13 +1,18 @@ | ||
|
||
.colorContainer { | ||
display: flex; | ||
align-items: flex-start; | ||
flex-direction: column; | ||
padding: var(--spacings-xs); | ||
width: 100%; | ||
} | ||
|
||
.colorName { | ||
max-width: 10rem; | ||
overflow: hidden; | ||
white-space: nowrap; | ||
text-overflow: ellipsis; | ||
} | ||
|
||
.colorSection { | ||
display: flex; | ||
flex-wrap: wrap; | ||
justify-content: stretch; | ||
box-sizing: border-box; | ||
} |
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
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,10 +1,7 @@ | ||
.sliceContainer { | ||
display: flex; | ||
flex-direction: column; | ||
margin: var(--spacings-xs); | ||
.sliceCard { | ||
width: 100%; | ||
} | ||
|
||
.sliceCard { | ||
width: 180px; | ||
height: 180px; | ||
.sliceContainer { | ||
width: 100%; | ||
} |
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