This repository has been archived by the owner on Feb 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
Showing
67 changed files
with
803 additions
and
9 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/components/molecules/member-card/__snapshots__/member-card.test.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
53
src/components/molecules/member-card/member-card.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.