Skip to content

Commit aa5e087

Browse files
authored
Merge pull request #124 from cskime/Next-김참솔-sprint9
[김참솔] Sprint9
2 parents 48af8a1 + 644b899 commit aa5e087

39 files changed

+744
-315
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const BUTTON_TYPE = Object.freeze({
2+
add: "add",
3+
edit: "edit",
4+
delete: "delete",
5+
});
6+
7+
export { BUTTON_TYPE };
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { BUTTON_TYPE } from "./button-type";
2+
import styles from "./button.module.css";
3+
4+
const className = {
5+
[BUTTON_TYPE.add]: `${styles.button} ${styles.add}`,
6+
[BUTTON_TYPE.edit]: `${styles.button} ${styles.edit}`,
7+
[BUTTON_TYPE.delete]: `${styles.button} ${styles.delete}`,
8+
};
9+
10+
const leadingIcon = {
11+
[BUTTON_TYPE.add]: "/icons/ic-plus.svg",
12+
[BUTTON_TYPE.edit]: "/icons/ic-check.svg",
13+
[BUTTON_TYPE.delete]: "/icons/ic-xmark-white.svg",
14+
};
15+
16+
function Button({ children, type = BUTTON_TYPE.add, ...props }) {
17+
return (
18+
<button className={className[type]} {...props}>
19+
<div className={styles.trailingIcon}>
20+
<img src={leadingIcon[type]} alt={type} />
21+
</div>
22+
{children}
23+
</button>
24+
);
25+
}
26+
27+
export default Button;
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
.button {
2+
color: var(--color-state-900);
3+
background-color: var(--color-state-200);
4+
padding: 18px 40px;
5+
border: 2px solid var(--color-state-900);
6+
border-radius: 24px;
7+
box-shadow: 4px 4px 0px var(--color-state-900);
8+
font-size: 16px;
9+
font-weight: 700;
10+
line-height: 100%;
11+
cursor: pointer;
12+
display: flex;
13+
align-items: center;
14+
gap: 4px;
15+
white-space: nowrap;
16+
}
17+
.button .trailingIcon {
18+
width: 16px;
19+
height: 16px;
20+
}
21+
.button .trailingIcon img {
22+
width: 100%;
23+
height: 100%;
24+
}
25+
26+
.button.add:active {
27+
color: white;
28+
background-color: var(--color-violet-600);
29+
}
30+
.button.add:active img {
31+
filter: invert(100%) sepia(14%) saturate(1801%) hue-rotate(190deg)
32+
brightness(116%) contrast(101%);
33+
}
34+
35+
.button.edit:active {
36+
background-color: var(--color-lime-300);
37+
}
38+
39+
.button.delete {
40+
color: white;
41+
background-color: var(--color-rose-500);
42+
}

my-app/components/color/color.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
function colorVariable(name, shade) {
2+
return `var(--color-${name}-${Math.max(100, Math.min(900, shade))})`;
3+
}
4+
5+
const Colors = {
6+
state: {
7+
100: colorVariable("state", 100),
8+
200: colorVariable("state", 200),
9+
300: colorVariable("state", 300),
10+
400: colorVariable("state", 400),
11+
500: colorVariable("state", 500),
12+
800: colorVariable("state", 800),
13+
900: colorVariable("state", 900),
14+
},
15+
violet: {
16+
100: colorVariable("violet", 100),
17+
600: colorVariable("violet", 600),
18+
},
19+
rose: {
20+
500: colorVariable("rose", 500),
21+
},
22+
lime: {
23+
300: colorVariable("lime", 300),
24+
},
25+
amber: {
26+
800: colorVariable("amber", 800),
27+
},
28+
};
29+
30+
export default Colors;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import styles from "./search-input.module.css";
2+
3+
function SearchInput({ ...props }) {
4+
return (
5+
<div className={styles.searchInput}>
6+
<input type="text" {...props} />
7+
</div>
8+
);
9+
}
10+
11+
export default SearchInput;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.searchInput {
2+
width: 100%;
3+
background-color: var(--color-state-100);
4+
padding: 16px 24px;
5+
border: 2px solid var(--color-state-900);
6+
border-radius: 24px;
7+
box-shadow: 4px 4px 0px var(--color-state-900);
8+
}
9+
.searchInput input {
10+
background: none;
11+
border: none;
12+
outline: none;
13+
width: 100%;
14+
font-size: 16px;
15+
font-weight: 400;
16+
line-height: 100%;
17+
color: var(--color-state-900);
18+
}
19+
.searchInput input::placeholder {
20+
font-size: 16px;
21+
font-weight: 400;
22+
line-height: 100%;
23+
color: var(--color-state-500);
24+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import Link from "next/link";
2+
import styles from "./global-nav-bar.module.css";
3+
4+
function GlobalNavBar() {
5+
return (
6+
<nav className={styles.globalNavBar}>
7+
<div className={styles.content}>
8+
<Link href="/">
9+
<picture>
10+
<source
11+
srcSet="/images/logo-small.svg"
12+
media="(max-width: 743px)"
13+
/>
14+
<img src="/images/logo-large.svg" alt="logo" />
15+
</picture>
16+
</Link>
17+
</div>
18+
</nav>
19+
);
20+
}
21+
22+
export default GlobalNavBar;
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
.globalNavBar {
2+
height: 60px;
3+
background-color: white;
4+
padding: 0 200px;
5+
border-bottom: 1px solid var(--color-state-200);
6+
}
7+
8+
.globalNavBar .content {
9+
max-width: 1200px;
10+
height: 100%;
11+
margin: 0 auto;
12+
display: flex;
13+
align-items: center;
14+
}
15+
16+
@media (max-width: 1199px) {
17+
.globalNavBar {
18+
padding: 0 24px;
19+
}
20+
21+
.globalNavBar .content {
22+
max-width: none;
23+
margin: 0;
24+
}
25+
}
26+
27+
@media (max-width: 743px) {
28+
.globalNavBar {
29+
padding: 0 16px;
30+
}
31+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { useEffect, useState } from "react";
2+
import { createPortal } from "react-dom";
3+
4+
function Portal({ children }) {
5+
const [container, setContainer] = useState(null);
6+
7+
useEffect(() => {
8+
// setContainer(document.getElementById("portal"));
9+
setContainer(document.body);
10+
}, []);
11+
12+
return container && createPortal(children, container);
13+
}
14+
15+
export default Portal;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import styles from "./todo-label.module.css";
2+
3+
function TodoLabel({ done }) {
4+
let className = styles.todoLabel;
5+
if (done) {
6+
className += ` ${styles.done}`;
7+
}
8+
9+
return <span className={className}>{done ? "DONE" : "TO DO"}</span>;
10+
}
11+
12+
export default TodoLabel;

0 commit comments

Comments
 (0)