From 46c6e7dfe5a33ea1809165dacb6430fb494b30f5 Mon Sep 17 00:00:00 2001 From: loxygenk Date: Sun, 21 Nov 2021 22:38:32 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=E2=9C=A8=20Fetch=20contact=20information?= =?UTF-8?q?=20in=20About=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/about/controller.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/pages/about/controller.ts b/src/pages/about/controller.ts index a21f4c4..b57c3c2 100644 --- a/src/pages/about/controller.ts +++ b/src/pages/about/controller.ts @@ -1,5 +1,5 @@ import { gql, useQuery } from "@apollo/client"; -import { Basic } from "~/api/graphql/autogen/scheme"; +import { Basic, Contact } from "~/api/graphql/autogen/scheme"; const fetchBasic = gql` query FetchBasic { @@ -15,9 +15,14 @@ const fetchBasic = gql` } age } + contacts { + service + identifier + url + } } `; -type FetchIntroductionResponse = { basic: Basic }; +type FetchIntroductionResponse = { basic: Basic; contacts: Contact[] }; export const useBasicAPI = () => useQuery(fetchBasic); From d2785effd892e16d36924f6ff61ffeabd473664d Mon Sep 17 00:00:00 2001 From: loxygenk Date: Sun, 21 Nov 2021 22:40:10 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=8E=A8=20Show=20contact=20information?= =?UTF-8?q?=20in=20About=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/about/atoms/Contact.module.scss | 3 +++ src/pages/about/atoms/Contact.tsx | 19 +++++++++++++++++++ .../about/organisms/Introduction.module.scss | 4 ++++ src/pages/about/organisms/Introduction.tsx | 7 +++++++ 4 files changed, 33 insertions(+) create mode 100644 src/pages/about/atoms/Contact.module.scss create mode 100644 src/pages/about/atoms/Contact.tsx diff --git a/src/pages/about/atoms/Contact.module.scss b/src/pages/about/atoms/Contact.module.scss new file mode 100644 index 0000000..46c709a --- /dev/null +++ b/src/pages/about/atoms/Contact.module.scss @@ -0,0 +1,3 @@ +.contact { + font-weight: 700; +} diff --git a/src/pages/about/atoms/Contact.tsx b/src/pages/about/atoms/Contact.tsx new file mode 100644 index 0000000..b2e2db5 --- /dev/null +++ b/src/pages/about/atoms/Contact.tsx @@ -0,0 +1,19 @@ +import React from "react"; + +import styles from "./Contact.module.scss"; + +export type ContactProps = { + service: string; + url: string; + identifier: string; +}; +export const Contact: React.VFC = (props) => ( + + {props.service} + +); diff --git a/src/pages/about/organisms/Introduction.module.scss b/src/pages/about/organisms/Introduction.module.scss index d1b426c..f84f991 100644 --- a/src/pages/about/organisms/Introduction.module.scss +++ b/src/pages/about/organisms/Introduction.module.scss @@ -32,3 +32,7 @@ gap: 0.5em; } +.contacts { + display: flex; + gap: 0.5em; +} diff --git a/src/pages/about/organisms/Introduction.tsx b/src/pages/about/organisms/Introduction.tsx index e6681d5..0a5ade1 100644 --- a/src/pages/about/organisms/Introduction.tsx +++ b/src/pages/about/organisms/Introduction.tsx @@ -1,6 +1,8 @@ import React from "react"; import { AwaitFetch } from "~/comps/shared/AwaitFetch"; +import { SimpleButton } from "~/comps/shared/SimpleButton"; import { Affiliation } from "../atoms/Affiriation"; +import { Contact } from "../atoms/Contact"; import { useBasicAPI } from "../controller"; import styles from "./Introduction.module.scss"; @@ -18,6 +20,11 @@ export const Introduction = () => { {data.basic.name.aka.join(" / ")} +
+ {data.contacts.map((c, i) => ( + + ))} +
{data.basic.affiliation.map((a, key) => ( From 70ea047ef97d99ad6c74c4568fde924e8e8e2f42 Mon Sep 17 00:00:00 2001 From: loxygenk Date: Sun, 21 Nov 2021 22:43:16 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=9A=A8=20Fix=20ESLint=20issue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintignore | 1 + src/comps/shared/AwaitFetch.module.scss | 0 src/comps/shared/AwaitFetch.tsx | 1 - src/pages/about/controller.ts | 4 ++-- src/pages/about/organisms/Introduction.tsx | 1 - src/pages/skills/atoms/Skill.tsx | 1 - src/pages/works/atoms/Work.tsx | 1 - 7 files changed, 3 insertions(+), 6 deletions(-) create mode 100644 .eslintignore delete mode 100644 src/comps/shared/AwaitFetch.module.scss diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..88ea186 --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +src/api/graphql/autogen diff --git a/src/comps/shared/AwaitFetch.module.scss b/src/comps/shared/AwaitFetch.module.scss deleted file mode 100644 index e69de29..0000000 diff --git a/src/comps/shared/AwaitFetch.tsx b/src/comps/shared/AwaitFetch.tsx index 93da5ec..f6405c2 100644 --- a/src/comps/shared/AwaitFetch.tsx +++ b/src/comps/shared/AwaitFetch.tsx @@ -1,6 +1,5 @@ import React from "react"; -import styles from "./AwaitFetch.module.scss"; import { Emoji } from "./Emoji"; export type AwaitFetchProps = { diff --git a/src/pages/about/controller.ts b/src/pages/about/controller.ts index b57c3c2..4d8c287 100644 --- a/src/pages/about/controller.ts +++ b/src/pages/about/controller.ts @@ -1,4 +1,4 @@ -import { gql, useQuery } from "@apollo/client"; +import { gql, QueryResult, useQuery } from "@apollo/client"; import { Basic, Contact } from "~/api/graphql/autogen/scheme"; const fetchBasic = gql` @@ -24,5 +24,5 @@ const fetchBasic = gql` `; type FetchIntroductionResponse = { basic: Basic; contacts: Contact[] }; -export const useBasicAPI = () => +export const useBasicAPI = (): QueryResult => useQuery(fetchBasic); diff --git a/src/pages/about/organisms/Introduction.tsx b/src/pages/about/organisms/Introduction.tsx index 0a5ade1..1e5822c 100644 --- a/src/pages/about/organisms/Introduction.tsx +++ b/src/pages/about/organisms/Introduction.tsx @@ -1,6 +1,5 @@ import React from "react"; import { AwaitFetch } from "~/comps/shared/AwaitFetch"; -import { SimpleButton } from "~/comps/shared/SimpleButton"; import { Affiliation } from "../atoms/Affiriation"; import { Contact } from "../atoms/Contact"; import { useBasicAPI } from "../controller"; diff --git a/src/pages/skills/atoms/Skill.tsx b/src/pages/skills/atoms/Skill.tsx index d96bc0a..e39fb13 100644 --- a/src/pages/skills/atoms/Skill.tsx +++ b/src/pages/skills/atoms/Skill.tsx @@ -1,7 +1,6 @@ import React from "react"; import { SkilledLevel } from "~/api/graphql/autogen/scheme"; import { Emoji } from "~/comps/shared/Emoji"; -import { combineClassName } from "~/utils/combineClassName"; import styles from "./Skill.module.scss"; diff --git a/src/pages/works/atoms/Work.tsx b/src/pages/works/atoms/Work.tsx index 721c65b..072adfc 100644 --- a/src/pages/works/atoms/Work.tsx +++ b/src/pages/works/atoms/Work.tsx @@ -1,5 +1,4 @@ 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";