From 72eebf3d5cd38b5d6e47af0b8c4110206ca9b982 Mon Sep 17 00:00:00 2001 From: loxygenk Date: Sun, 21 Nov 2021 21:17:10 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=90=9B=20Remove=20inproper=20margin?= =?UTF-8?q?=20when=20the=20viewport=20is=20thin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/careers/molecule/Timeline.module.scss | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pages/careers/molecule/Timeline.module.scss b/src/pages/careers/molecule/Timeline.module.scss index 6e102d0..c92e886 100644 --- a/src/pages/careers/molecule/Timeline.module.scss +++ b/src/pages/careers/molecule/Timeline.module.scss @@ -6,6 +6,11 @@ flex-direction: column; width: calc(100% - 5em); margin-left: 5em; + + @include layout.for(tablet) { + width: 100%; + margin-left: 0; + } } .main-timeline { @@ -16,11 +21,6 @@ border-left: 3px solid darken(color.get-theme-color(background-alt), 10); - @include layout.for(tablet) { - width: 100%; - margin-left: 0; - } - } .scope-out { From 87e7209a1c75b5bbbef6db05f113a92654669bec Mon Sep 17 00:00:00 2001 From: loxygenk Date: Sun, 21 Nov 2021 21:19:10 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=E2=9C=A8=20Create=20the=20stab=20of=20Work?= =?UTF-8?q?=20page=20+=20register=20to=20the=20router?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/main/Main.tsx | 7 ++++--- src/pages/router/routing.ts | 3 +++ src/pages/works/Works.tsx | 11 +++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 src/pages/works/Works.tsx diff --git a/src/pages/main/Main.tsx b/src/pages/main/Main.tsx index 84fa08c..ae9f014 100644 --- a/src/pages/main/Main.tsx +++ b/src/pages/main/Main.tsx @@ -2,6 +2,7 @@ import React from "react"; import { PageWrapper } from "~/comps/layout/PageWrapper"; import { LogoImage } from "~/comps/shared/LogoImage"; import { SimpleButton } from "~/comps/shared/SimpleButton"; +import { quickNavigations } from "../router/routing"; import styles from "./Main.module.scss"; @@ -10,9 +11,9 @@ export const Main = () => (
- - - + {quickNavigations.map((nav, i) => ( + + ))}
diff --git a/src/pages/router/routing.ts b/src/pages/router/routing.ts index 2eacba7..2c45ecb 100644 --- a/src/pages/router/routing.ts +++ b/src/pages/router/routing.ts @@ -4,6 +4,7 @@ import { Main } from "~/pages/main/Main"; import { About } from "../about/About"; import { Skills } from "../skills/Skills"; import { Careers } from "../careers/Careers"; +import { Works } from "../works/Works"; export type QuickNavigation = { path: string; @@ -16,10 +17,12 @@ export const routingTable: RouteProps[] = [ { path: "/about", component: About, exact: true }, { path: "/skills", component: Skills, exact: true }, { path: "/careers", component: Careers, exact: true }, + { path: "/works", component: Works, exact: true }, ]; export const quickNavigations: QuickNavigation[] = [ { path: "/about", caption: "自己紹介" }, { path: "/skills", caption: "スキル" }, { path: "/careers", caption: "実績" }, + { path: "/works", caption: "作ったもの" }, ]; diff --git a/src/pages/works/Works.tsx b/src/pages/works/Works.tsx new file mode 100644 index 0000000..6224655 --- /dev/null +++ b/src/pages/works/Works.tsx @@ -0,0 +1,11 @@ +import React from "react"; +import { PageWrapper } from "~/comps/layout/PageWrapper"; +import { Heading } from "~/comps/shared/Heading"; + +export const Works = () => ( + + + 作ったもの + + +); From 6cb73647f234ed38a25a77e7b9f5866b89b75e19 Mon Sep 17 00:00:00 2001 From: loxygenk Date: Sun, 21 Nov 2021 22:13:29 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=8D=BB=20Create=20works=20page=20with?= =?UTF-8?q?=20the=20full=20effort?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/works/Works.tsx | 2 + src/pages/works/atoms/Work.module.scss | 59 +++++++++++++++++++ src/pages/works/atoms/Work.tsx | 36 +++++++++++ src/pages/works/controller.ts | 17 ++++++ .../works/molecules/WorksList.module.scss | 13 ++++ src/pages/works/molecules/WorksList.tsx | 22 +++++++ 6 files changed, 149 insertions(+) create mode 100644 src/pages/works/atoms/Work.module.scss create mode 100644 src/pages/works/atoms/Work.tsx create mode 100644 src/pages/works/controller.ts create mode 100644 src/pages/works/molecules/WorksList.module.scss create mode 100644 src/pages/works/molecules/WorksList.tsx diff --git a/src/pages/works/Works.tsx b/src/pages/works/Works.tsx index 6224655..36aa714 100644 --- a/src/pages/works/Works.tsx +++ b/src/pages/works/Works.tsx @@ -1,11 +1,13 @@ import React from "react"; import { PageWrapper } from "~/comps/layout/PageWrapper"; import { Heading } from "~/comps/shared/Heading"; +import { WorksList } from "./molecules/WorksList"; export const Works = () => ( 作ったもの + ); diff --git a/src/pages/works/atoms/Work.module.scss b/src/pages/works/atoms/Work.module.scss new file mode 100644 index 0000000..399f5a4 --- /dev/null +++ b/src/pages/works/atoms/Work.module.scss @@ -0,0 +1,59 @@ +@use "~/styling/color.module.scss"; + +.container { + position: relative; + + display: flex; + flex-direction: column; + gap: 0.3em; + + padding: 0.5em 1em; + overflow: hidden; + + background-color: color.get-theme-color(background-alt); +} + +.work-info { + display: flex; + flex-direction: column; +} + +.title { + font-size: 1.8em; + font-weight: 700; + + overflow-wrap: anywhere; +} + +.tags { + font-size: 0.85em; + line-height: 105%; + + color: color.get-theme-color(text-color-secondary); +} + +.url { + font-size: 0.85em; + overflow-wrap: anywhere; +} + +.separator { + border-bottom: 2px dotted darken(color.get-theme-color(background-alt), 10); +} + +.status-band { + position: absolute; + top: 1.5em; + right: -2.75em; + + width: 10em; + transform: rotate(45deg); + + background-color: darken(color.get-theme-color(background-alt), 15); + box-shadow: 0 0 3px color.get-theme-color(shadow-color); + color: white; + + padding: 0.1em 0; + + text-align: center; +} diff --git a/src/pages/works/atoms/Work.tsx b/src/pages/works/atoms/Work.tsx new file mode 100644 index 0000000..721c65b --- /dev/null +++ b/src/pages/works/atoms/Work.tsx @@ -0,0 +1,36 @@ +import React from "react"; +import { Link } from "react-router-dom"; +import { Status, Work as WorkEntity } from "~/api/graphql/autogen/scheme"; + +import styles from "./Work.module.scss"; + +const statusToCaption: { [key in Status]: string } = { + ADVANCING: "積極的に開発中", + ARCHIVED: "開発終了", + COMPLETED: "完成", + DEVELOPING: "開発途中", + MAINTENANCING: "メンテナンス中", +}; + +export type WorkProps = WorkEntity; +export const Work: React.VFC = (props) => ( +
+

+ {props.name} + {props.tags.join(" / ")} +

+
+

{props.description}

+
+

+ {props.repoUrl == null ? ( + ソースコードは非公開です. + ) : ( + + {props.repoUrl} + + )} +

+
{statusToCaption[props.status]}
+
+); diff --git a/src/pages/works/controller.ts b/src/pages/works/controller.ts new file mode 100644 index 0000000..44f8a89 --- /dev/null +++ b/src/pages/works/controller.ts @@ -0,0 +1,17 @@ +import { gql, QueryResult, useQuery } from "@apollo/client"; +import { Work } from "~/api/graphql/autogen/scheme"; + +const FetchWork = gql` + query FetchWork { + works { + name + description + repoUrl + tags + status + } + } +`; +export type FetchWorkResponse = { works: Work[] }; +export const useWorksAPI = (): QueryResult => + useQuery(FetchWork); diff --git a/src/pages/works/molecules/WorksList.module.scss b/src/pages/works/molecules/WorksList.module.scss new file mode 100644 index 0000000..be080bf --- /dev/null +++ b/src/pages/works/molecules/WorksList.module.scss @@ -0,0 +1,13 @@ +@use "~/styling/layout.module.scss"; + +.container { + display: grid; + grid-template-columns: repeat(2, 1fr); + grid-gap: 1em; + + width: 100%; + + @include layout.for(tablet) { + grid-template-columns: 1fr; + } +} diff --git a/src/pages/works/molecules/WorksList.tsx b/src/pages/works/molecules/WorksList.tsx new file mode 100644 index 0000000..df1e120 --- /dev/null +++ b/src/pages/works/molecules/WorksList.tsx @@ -0,0 +1,22 @@ +import React from "react"; +import { AwaitFetch } from "~/comps/shared/AwaitFetch"; +import { Work } from "../atoms/Work"; +import { useWorksAPI } from "../controller"; + +import styles from "./WorksList.module.scss"; + +export const WorksList = () => { + const { loading, error, data } = useWorksAPI(); + + return ( + + {(data) => ( +
+ {data.works.map((work, i) => ( + + ))} +
+ )} +
+ ); +};