Skip to content

Commit

Permalink
Merge pull request #46 from Team-INSERT/component/aside
Browse files Browse the repository at this point in the history
feat: Aside 컴포넌트 퍼블리싱
  • Loading branch information
jyh071116 authored Mar 7, 2024
2 parents 7e217a0 + 466f762 commit 28d3a2a
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/layout.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export const container = style({
minHeight: "100svh",
backgroundColor: theme.background,
padding: "52px 20px 0 20px",
...flex.COLUMN_VERTICAL,
...flex.FLEX,
});
2 changes: 2 additions & 0 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import "./globals.css";
import AppProvider from "@/provider";
import Header from "@/components/Header";
import Board from "@/components/Board";
import Aside from "@/components/Aside";
import Footer from "@/components/Footer";
import { container } from "./layout.css";

Expand All @@ -19,6 +20,7 @@ export default function RootLayout({
<Header />
<div className={container}>
<Board>{children}</Board>
<Aside />
</div>
<Footer />
</AppProvider>
Expand Down
16 changes: 9 additions & 7 deletions assets/ArrowIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
import React from "react";
import React, { SVGProps } from "react";

const path = {
down: "M22.7249 43.2249C22.9562 43.4567 23.231 43.6406 23.5334 43.766C23.8358 43.8915 24.16 43.9561 24.4874 43.9561C24.8149 43.9561 25.1391 43.8915 25.4415 43.766C25.7439 43.6406 26.0187 43.4567 26.2499 43.2249L37.7249 31.7499C37.9567 31.5187 38.1406 31.2439 38.266 30.9415C38.3915 30.6391 38.4561 30.3149 38.4561 29.9874C38.4561 29.66 38.3915 29.3358 38.266 29.0334C38.1406 28.7309 37.9567 28.4562 37.7249 28.2249L26.2499 16.7499C26.0185 16.5185 25.7437 16.3349 25.4413 16.2096C25.1389 16.0844 24.8148 16.0199 24.4874 16.0199C24.1601 16.0199 23.836 16.0844 23.5336 16.2096C23.2312 16.3349 22.9564 16.5185 22.7249 16.7499C22.4935 16.9814 22.3099 17.2562 22.1846 17.5586C22.0594 17.861 21.9949 18.1851 21.9949 18.5124C21.9949 18.8398 22.0594 19.1639 22.1846 19.4663C22.3099 19.7687 22.4935 20.0435 22.7249 20.2749L32.4249 29.9999L22.7249 39.6999C21.7749 40.6749 21.7749 42.2749 22.7249 43.2249Z",
right:
"M16.7751 22.7249C16.5433 22.9562 16.3594 23.231 16.234 23.5334C16.1085 23.8358 16.0439 24.16 16.0439 24.4874C16.0439 24.8149 16.1085 25.1391 16.234 25.4415C16.3594 25.7439 16.5433 26.0187 16.7751 26.2499L28.2501 37.7249C28.4813 37.9567 28.7561 38.1406 29.0585 38.266C29.3609 38.3915 29.6851 38.4561 30.0126 38.4561C30.34 38.4561 30.6642 38.3915 30.9666 38.266C31.2691 38.1406 31.5438 37.9567 31.7751 37.7249L43.2501 26.2499C43.4815 26.0185 43.6651 25.7437 43.7904 25.4413C43.9156 25.1389 43.9801 24.8148 43.9801 24.4874C43.9801 24.1601 43.9156 23.836 43.7904 23.5336C43.6651 23.2312 43.4815 22.9564 43.2501 22.7249C43.0186 22.4935 42.7438 22.3099 42.4414 22.1846C42.139 22.0594 41.8149 21.9949 41.4876 21.9949C41.1602 21.9949 40.8361 22.0594 40.5337 22.1846C40.2313 22.3099 39.9565 22.4935 39.7251 22.7249L30.0001 32.4249L20.3001 22.7249C19.3251 21.7749 17.7251 21.7749 16.7751 22.7249Z",
"M2.22233 1.17949L10.6479 9.57893C10.7479 9.67892 10.8186 9.78725 10.8599 9.90391C10.9019 10.0206 10.9229 10.1456 10.9229 10.2789C10.923 10.4122 10.902 10.5372 10.86 10.6539C10.8186 10.7706 10.748 10.8789 10.648 10.9789L2.22356 19.4045C1.99024 19.6378 1.69858 19.7545 1.34858 19.7546C0.998584 19.7546 0.698576 19.6296 0.448559 19.3796C0.198542 19.1296 0.0735227 18.838 0.0735002 18.5046C0.0734777 18.1713 0.198458 17.8796 0.448441 17.6296L7.79794 10.2791L0.447449 2.92961C0.2141 2.69629 0.0974137 2.40897 0.0973907 2.06764C0.0973676 1.72564 0.222348 1.42963 0.472331 1.17961C0.722314 0.929594 1.01397 0.804574 1.34731 0.804552C1.68064 0.804529 1.97231 0.929509 2.22233 1.17949Z",
down: "M16.7751 22.7249C16.5433 22.9562 16.3594 23.231 16.234 23.5334C16.1085 23.8358 16.0439 24.16 16.0439 24.4874C16.0439 24.8149 16.1085 25.1391 16.234 25.4415C16.3594 25.7439 16.5433 26.0187 16.7751 26.2499L28.2501 37.7249C28.4813 37.9567 28.7561 38.1406 29.0585 38.266C29.3609 38.3915 29.6851 38.4561 30.0126 38.4561C30.34 38.4561 30.6642 38.3915 30.9666 38.266C31.2691 38.1406 31.5438 37.9567 31.7751 37.7249L43.2501 26.2499C43.4815 26.0185 43.6651 25.7437 43.7904 25.4413C43.9156 25.1389 43.9801 24.8148 43.9801 24.4874C43.9801 24.1601 43.9156 23.836 43.7904 23.5336C43.6651 23.2312 43.4815 22.9564 43.2501 22.7249C43.0186 22.4935 42.7438 22.3099 42.4414 22.1846C42.139 22.0594 41.8149 21.9949 41.4876 21.9949C41.1602 21.9949 40.8361 22.0594 40.5337 22.1846C40.2313 22.3099 39.9565 22.4935 39.7251 22.7249L30.0001 32.4249L20.3001 22.7249C19.3251 21.7749 17.7251 21.7749 16.7751 22.7249Z",
left: "M8.773 19.3793L0.347998 10.9793C0.247998 10.8793 0.177331 10.771 0.135998 10.6543C0.093998 10.5377 0.072998 10.4127 0.072998 10.2793C0.072998 10.146 0.093998 10.021 0.135998 9.90432C0.177331 9.78766 0.247998 9.67932 0.347998 9.57932L8.773 1.15432C9.00633 0.920988 9.298 0.804321 9.648 0.804321C9.998 0.804321 10.298 0.929321 10.548 1.17932C10.798 1.42932 10.923 1.72099 10.923 2.05432C10.923 2.38765 10.798 2.67932 10.548 2.92932L3.198 10.2793L10.548 17.6293C10.7813 17.8627 10.898 18.15 10.898 18.4913C10.898 18.8333 10.773 19.1293 10.523 19.3793C10.273 19.6293 9.98133 19.7543 9.648 19.7543C9.31466 19.7543 9.023 19.6293 8.773 19.3793Z",
};

interface PropsType {
direction: "down" | "right";
interface PropsType extends SVGProps<SVGSVGElement> {
direction: "down" | "right" | "left";
}

const ArrowIcon = ({ direction }: PropsType) => {
const ArrowIcon = ({ direction, fill = "#818181", ...props }: PropsType) => {
return (
<svg
width="40"
height="40"
viewBox="0 0 60 60"
fill="none"
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<path d={path[direction]} fill="#818181" />
<path d={path[direction]} fill={fill} />
</svg>
);
};
Expand Down
51 changes: 51 additions & 0 deletions components/Aside/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import React from "react";
import Link from "next/link";
import { ArrowIcon } from "@/assets";
import { theme } from "@/styles";
import * as styles from "./style.css";

const Aside = () => {
return (
<aside className={styles.container}>
<div className={styles.titleBox}>
<span className={styles.titleText}>최근 수정된 문서</span>
</div>
{Array.from({ length: 12 }, (_, i) => (
<div key={i} className={styles.docs}>
<Link className={styles.docsName} href="/">
한예준(학생)
</Link>
<span className={styles.docsLastModified}>3시간 전</span>
</div>
))}
<div className={styles.pageBox}>
<button className={styles.pageButton}>
<span className={styles.pageButtonText}>
<ArrowIcon
direction="left"
width={11}
height={11}
viewBox="0 0 11 20"
fill={theme.primary}
/>
이전
</span>
</button>
<button className={styles.pageButton}>
<span className={styles.pageButtonText}>
다음
<ArrowIcon
direction="right"
width={11}
height={11}
viewBox="0 0 11 20"
fill={theme.primary}
/>
</span>
</button>
</div>
</aside>
);
};

export default Aside;
68 changes: 68 additions & 0 deletions components/Aside/style.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import { style } from "@vanilla-extract/css";
import { flex, font, theme } from "@/styles";

export const container = style({
position: "sticky",
width: "240px",
height: "fit-content",
marginTop: "20px",
top: "74px",
});

export const titleBox = style({
backgroundColor: theme.primary,
border: `2px solid ${theme.gray}`,
width: "100%",
height: "50px",
...flex.VERTICAL,
});

export const titleText = style({
marginLeft: "20px",
color: theme.white,
...font.H5,
});

export const docs = style({
width: "100%",
height: "40px",
backgroundColor: theme.white,
border: `2px solid ${theme.gray}`,
borderTop: "none",
...flex.VERTICAL,
});

export const docsName = style({
color: theme.primary,
marginLeft: "10px",
fontSize: "14px",
fontWeight: 600,
});

export const docsLastModified = style({
marginLeft: "5px",
color: theme.boldgray,
fontSize: "10px",
});

export const pageBox = style({
...flex.FLEX,
});

export const pageButton = style({
width: "56px",
height: "24px",
backgroundColor: theme.white,
margin: "6px 2px",
border: `2px solid ${theme.gray}`,
borderRadius: "3px",
...flex.CENTER,
});

export const pageButtonText = style({
color: theme.primary,
fontWeight: 600,
fontSize: "12px",
gap: "2.5px",
...flex.CENTER,
});
3 changes: 2 additions & 1 deletion components/Board/style.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import { style } from "@vanilla-extract/css";

export const container = style({
width: "72vw",
...flex.COLUMN_VERTICAL,
...flex.COLUMN_START,
borderLeft: `2px solid ${theme.gray}`,
borderRight: `2px solid ${theme.gray}`,
backgroundColor: theme.white,
margin: "0 20px 0 90px",
});

export const board = style({
Expand Down
1 change: 1 addition & 0 deletions styles/theme.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const theme = {
primary: "#274168",
gray: "#ccc",
boldgray: "#929292",
white: "#fff",
background: "#f5f5f5",
classify: "#EC9F19",
Expand Down

0 comments on commit 28d3a2a

Please sign in to comment.