Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

Commit

Permalink
feat: Create member page (#341)
Browse files Browse the repository at this point in the history
* chore: Fix Not found page

* chore: Add loading properties to img tag

* feat: Add member's photo

* chore: Update snapshot

* feat: Create member component

* chore: Move component because of name was same

* chore: Fix styleing of member card

* chore: Update tailwind config

* feat: Create member page template

* chore: Format code

* chore: Update snapshot

* chore: Rename to lower_snake case

* chore: Add button to link to top page

* feat: Create member page

* chore: Format code
  • Loading branch information
re-taro authored Oct 25, 2022
1 parent 46dc4cf commit 9a1bece
Show file tree
Hide file tree
Showing 67 changed files with 803 additions and 9 deletions.
Binary file added public/statics/members/akane_ito.webp
Binary file not shown.
Binary file added public/statics/members/akinori_asai.webp
Binary file not shown.
Binary file added public/statics/members/ayaka_ito.webp
Binary file not shown.
Binary file added public/statics/members/haruka_iwata.webp
Binary file not shown.
Binary file added public/statics/members/haruka_kawamura.webp
Binary file not shown.
Binary file added public/statics/members/hina_inagaki.webp
Binary file not shown.
Binary file added public/statics/members/iota_komatani.webp
Binary file not shown.
Binary file added public/statics/members/junsei_yahata.webp
Binary file not shown.
Binary file added public/statics/members/kanta_maeda.webp
Binary file not shown.
Binary file added public/statics/members/kazuyuki_yasuda.webp
Binary file not shown.
Binary file added public/statics/members/keiichiro_masuda.webp
Binary file not shown.
Binary file added public/statics/members/keito_kobayashi.webp
Binary file not shown.
Binary file added public/statics/members/keito_yada.webp
Binary file not shown.
Binary file added public/statics/members/kosei_sakai.webp
Binary file not shown.
Binary file added public/statics/members/kota_yamashita.webp
Binary file not shown.
Binary file added public/statics/members/kotone_okada.webp
Binary file not shown.
Binary file added public/statics/members/marin_arakawa.webp
Binary file not shown.
Binary file added public/statics/members/miku_tsuji.webp
Binary file not shown.
Binary file added public/statics/members/minami_iwasaki.webp
Binary file not shown.
Binary file added public/statics/members/nana_tsutsui.webp
Binary file not shown.
Binary file added public/statics/members/nana_wada.webp
Binary file not shown.
Binary file added public/statics/members/nanako_taniguchi.webp
Binary file not shown.
Binary file added public/statics/members/natsumi_aoki.webp
Binary file not shown.
Binary file added public/statics/members/ohjiro_yoshitake.webp
Binary file not shown.
Binary file added public/statics/members/raito_kimura.webp
Binary file not shown.
Binary file added public/statics/members/riho_takahashi.webp
Binary file not shown.
Binary file added public/statics/members/rikuto_kuwahara.webp
Binary file not shown.
Binary file added public/statics/members/rintaro_itokawa.webp
Binary file not shown.
Binary file added public/statics/members/rui_takeuchi.webp
Binary file not shown.
Binary file added public/statics/members/ryubi_kobayashi.webp
Binary file not shown.
Binary file added public/statics/members/sakura_tanaka.webp
Binary file not shown.
Binary file added public/statics/members/shoma_kobayashi.webp
Binary file not shown.
Binary file added public/statics/members/shoya_hasegawa.webp
Binary file not shown.
Binary file added public/statics/members/takuma_koto.webp
Binary file not shown.
Binary file added public/statics/members/tatsuki_nagaoka.webp
Binary file not shown.
Binary file added public/statics/members/yoshiki_chuma.webp
Binary file not shown.
Binary file added public/statics/members/yuki_miyata.webp
Binary file not shown.
Binary file added public/statics/members/yumea_kobayashi.webp
Binary file not shown.
Binary file added public/statics/members/yuta_goto.webp
Binary file not shown.
Binary file added public/statics/members/yuuno_yamamoto.webp
Binary file not shown.
Binary file added public/statics/members/yuzuki_ichikawa.webp
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ exports[`(components) molecules/bazaar-card > take snap shot 1`] = `
alt="バザーに関するイメージ画像"
class="css-61q9gc-BazaarCard"
height="300"
loading="lazy"
src="https://panproduct.com/blog/wp-content/uploads/2021/07/32.png"
width="450"
/>
Expand Down
1 change: 1 addition & 0 deletions src/components/molecules/bazaar-card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const BazaarCard: FC<BazaarCardProperties> = ({ name, description, image, prices
alt="バザーに関するイメージ画像"
width={450}
height={300}
loading="lazy"
/>
<BazaarCardContent>
<Chip group={group} />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Vitest Snapshot v1

exports[`(components) molecules/member > take snap shot 1`] = `
<div>
<figure>
<img
alt="Rintaro Itokawa"
class="css-crfi3p-MemberCard"
height="300"
loading="lazy"
src="/statics/members/rintaro_itokawa.webp"
width="450"
/>
<figcaption
class="css-1mlw4fg-MemberCard"
>
<p
class="css-uqq0xe"
>
Rintaro Itokawa
</p>
</figcaption>
</figure>
</div>
`;
28 changes: 28 additions & 0 deletions src/components/molecules/member-card/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import type { FC } from "react";
import tw, { css } from "twin.macro";
import type { MemberCardProperties } from "./types/model";

const Position = tw.p`font-zen font-bold underline text-xs sm:text-2xl`;

const Name = tw.p`font-zen font-bold text-xs sm:text-2xl`;

const MemberCard: FC<MemberCardProperties> = ({ imagePath, name, position = "other" }) => (
<figure>
<img
css={css`
aspect-ratio: 3 / 2;
`}
src={imagePath}
alt={name}
width={450}
height={300}
loading="lazy"
/>
<figcaption css={[tw`flex items-center justify-center`, position !== "other" ? tw`space-x-4 sm:space-x-8` : null]}>
{position === "other" ? null : <Position>{position === "leader" ? "LEADER" : "SUB LEADER"}</Position>}
<Name>{name}</Name>
</figcaption>
</figure>
);

export { MemberCard };
53 changes: 53 additions & 0 deletions src/components/molecules/member-card/member-card.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import type { ComponentStoryObj, ComponentMeta } from "@storybook/react";
import { ComponentPropsWithoutRef } from "react";
import { MemberCard } from ".";

type T = typeof MemberCard;
type Story = ComponentStoryObj<T>;
type Meta = ComponentMeta<T>;

const args: ComponentPropsWithoutRef<T> = {
imagePath: "/statics/members/rintaro_itokawa.webp",
name: "Rintaro Itokawa",
};

export default {
args,
argTypes: {
imagePath: {
description: "Pass the path to photo",
control: {
type: "text",
},
},
name: {
description: "Name of member",
control: {
type: "text",
},
},
position: {
description: "Position in the members",
control: {
type: "text",
},
},
},
component: MemberCard,
} as Meta;

export const Default: Story = {};
export const LEADER: Story = {
args: {
imagePath: "/statics/members/rikuto_kuwahara.webp",
name: "Rikuto Kuwahara",
position: "leader",
},
};
export const SUB: Story = {
args: {
imagePath: "/statics/members/shoma_kobayashi.webp",
name: "Shoma Kobayashi",
position: "sub",
},
};
25 changes: 25 additions & 0 deletions src/components/molecules/member-card/member-card.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { composeStories } from "@storybook/testing-react";
import "@testing-library/jest-dom";
import { render } from "@testing-library/react";
import * as stories from "./member-card.stories";

const { Default } = composeStories(stories);

const options = {
name: "",
};

describe("(components) molecules/member", () => {
test("to be molecules", () => {
const { container } = render(<Default />);
expect(container).toBeMolecule();
});
test("to be [role=figure]", () => {
const { getByRole } = render(<Default />);
expect(getByRole("figure", options));
});
test("take snap shot", () => {
const { container } = render(<Default />);
expect(container).toMatchSnapshot();
});
});
11 changes: 11 additions & 0 deletions src/components/molecules/member-card/types/model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const Position = {
leader: "LEADER",
sub: "SUB LEADER",
other: "",
};

export type MemberCardProperties = {
imagePath: string;
name: string;
position?: keyof typeof Position;
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ exports[`(components) molecules/title > (blue) take snap shot 1`] = `
alt="ink"
class="css-mhf7w5-Title"
height="580"
loading="eager"
src="/statics/Ink3_blue.webp"
width="592"
/>
Expand All @@ -30,6 +31,7 @@ exports[`(components) molecules/title > (default) take snap shot 1`] = `
alt="ink"
class="css-mhf7w5-Title"
height="580"
loading="eager"
src="/statics/Ink3_yellow.webp"
width="592"
/>
Expand All @@ -51,6 +53,7 @@ exports[`(components) molecules/title > (green) take snap shot 1`] = `
alt="ink"
class="css-mhf7w5-Title"
height="580"
loading="eager"
src="/statics/Ink3_green.webp"
width="592"
/>
Expand All @@ -72,6 +75,7 @@ exports[`(components) molecules/title > (purple) take snap shot 1`] = `
alt="ink"
class="css-mhf7w5-Title"
height="580"
loading="eager"
src="/statics/Ink3_purple.webp"
width="592"
/>
Expand All @@ -93,6 +97,7 @@ exports[`(components) molecules/title > (red) take snap shot 1`] = `
alt="ink"
class="css-mhf7w5-Title"
height="580"
loading="eager"
src="/statics/Ink3_red.webp"
width="592"
/>
Expand All @@ -114,6 +119,7 @@ exports[`(components) molecules/title > (yellow) take snap shot 1`] = `
alt="ink"
class="css-mhf7w5-Title"
height="580"
loading="eager"
src="/statics/Ink3_yellow.webp"
width="592"
/>
Expand Down
1 change: 1 addition & 0 deletions src/components/molecules/title/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const Title: FC<TitleProperties> = ({ children, colorKey, ...rest }) => {
alt="ink"
width={592}
height={580}
loading="eager"
/>
<TitleContainer>{children}</TitleContainer>
</TitleWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ exports[`(components) organisms/map-section > take snap shot 1`] = `
alt="校内マップ"
class="css-1h35ydv-MapSection"
height="2915"
loading="lazy"
src="/statics/map.webp"
width="4128"
/>
Expand Down
1 change: 1 addition & 0 deletions src/components/organisms/map-section/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const MapSection: FC<MapSectionProperties> = ({ title, ...rest }) => (
alt="校内マップ"
width={4128}
height={2915}
loading="lazy"
/>
</MapContainer>
</MapSectionContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ exports[`(components) templates/bazaar > take snap shot 1`] = `
alt="ink"
class="css-mhf7w5-Title"
height="580"
loading="eager"
src="/statics/Ink3_green.webp"
width="592"
/>
Expand Down Expand Up @@ -59,6 +60,7 @@ exports[`(components) templates/bazaar > take snap shot 1`] = `
alt="バザーに関するイメージ画像"
class="css-61q9gc-BazaarCard"
height="300"
loading="lazy"
src="https://panproduct.com/blog/wp-content/uploads/2021/07/32.png"
width="450"
/>
Expand Down Expand Up @@ -104,6 +106,7 @@ exports[`(components) templates/bazaar > take snap shot 1`] = `
alt="バザーに関するイメージ画像"
class="css-61q9gc-BazaarCard"
height="300"
loading="lazy"
src="https://panproduct.com/blog/wp-content/uploads/2021/07/32.png"
width="450"
/>
Expand Down Expand Up @@ -149,6 +152,7 @@ exports[`(components) templates/bazaar > take snap shot 1`] = `
alt="バザーに関するイメージ画像"
class="css-61q9gc-BazaarCard"
height="300"
loading="lazy"
src="https://panproduct.com/blog/wp-content/uploads/2021/07/32.png"
width="450"
/>
Expand Down Expand Up @@ -194,6 +198,7 @@ exports[`(components) templates/bazaar > take snap shot 1`] = `
alt="バザーに関するイメージ画像"
class="css-61q9gc-BazaarCard"
height="300"
loading="lazy"
src="https://panproduct.com/blog/wp-content/uploads/2021/07/32.png"
width="450"
/>
Expand Down Expand Up @@ -239,6 +244,7 @@ exports[`(components) templates/bazaar > take snap shot 1`] = `
alt="バザーに関するイメージ画像"
class="css-61q9gc-BazaarCard"
height="300"
loading="lazy"
src="https://panproduct.com/blog/wp-content/uploads/2021/07/32.png"
width="450"
/>
Expand Down Expand Up @@ -284,6 +290,7 @@ exports[`(components) templates/bazaar > take snap shot 1`] = `
alt="バザーに関するイメージ画像"
class="css-61q9gc-BazaarCard"
height="300"
loading="lazy"
src="https://panproduct.com/blog/wp-content/uploads/2021/07/32.png"
width="450"
/>
Expand Down Expand Up @@ -329,6 +336,7 @@ exports[`(components) templates/bazaar > take snap shot 1`] = `
alt="バザーに関するイメージ画像"
class="css-61q9gc-BazaarCard"
height="300"
loading="lazy"
src="https://panproduct.com/blog/wp-content/uploads/2021/07/32.png"
width="450"
/>
Expand Down
Loading

0 comments on commit 9a1bece

Please sign in to comment.