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

Commit

Permalink
feat: Close ticket form and change sentence
Browse files Browse the repository at this point in the history
  • Loading branch information
re-taro committed Oct 23, 2022
1 parent d31f2f7 commit d89daf5
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 105 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,11 @@ exports[`(components) organisms/ticket-section > take snap shot 1`] = `
<nav
class="css-1ipjmcm"
>
<a
class="css-jhmgok-Button"
href="#"
rel="noopener noreferrer"
tabindex="0"
target="_blank"
<p
class="css-17zcuf2"
>
<p
class="css-7bzdgk-Button"
>
中学生とその保護者の皆様の入場受付はこちら
</p>
</a>
<a
class="css-jhmgok-Button"
href="#"
rel="noopener noreferrer"
tabindex="0"
target="_blank"
>
<p
class="css-7bzdgk-Button"
>
OB・OGの皆様の入場受付はこちら
</p>
</a>
フォームでの受付終了しました。たくさんのご応募ありがとうございました。
</p>
</nav>
</section>
</div>
Expand Down
15 changes: 5 additions & 10 deletions src/components/organisms/ticket-section/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,20 @@ import tw from "twin.macro";
import type { TicketSectionProperties } from "./type/model";
import { Heading } from "../../atoms/heading";
import { Text } from "../../atoms/text";
import { Button } from "../../atoms/button";

const TicketSectionContainer = tw.section`flex flex-col justify-center items-center`;

const ButtonContainer = tw.nav`flex flex-col space-x-0 space-y-4 sm:(flex-row space-x-4 space-y-0) justify-center items-center`;
const Container = tw.nav`flex flex-col space-x-0 space-y-4 sm:(flex-row space-x-4 space-y-0) justify-center items-center`;

const TicketSection: FC<TicketSectionProperties> = ({ title, children, anchorData, ...rest }) => (
const TicketSection: FC<TicketSectionProperties> = ({ title, children, ...rest }) => (
<TicketSectionContainer aria-label="ticket" {...rest}>
<Heading css={tw`mb-4 sm:mb-8`} colorKey="yellow">
{title}
</Heading>
<Text css={tw`whitespace-pre-wrap mb-6 sm:mb-16`}>{children}</Text>
<ButtonContainer>
{anchorData.map(data => (
<Button colorKey="yellow" as="a" key={data.key} href={data.link} target="_blank" rel="noopener noreferrer">
{data.context}
</Button>
))}
</ButtonContainer>
<Container>
<Text>フォームでの受付終了しました。たくさんのご応募ありがとうございました。</Text>
</Container>
</TicketSectionContainer>
);

Expand Down
18 changes: 0 additions & 18 deletions src/components/organisms/ticket-section/ticket-section.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,6 @@ const args: ComponentPropsWithoutRef<T> = {
title: "Ticket",
children:
"感染拡大防止のための入場制限により、ご入場いただける方を\n本校学生とその家族・学生の友人各2名・本校の受験を考える中学生とその保護者1名・本校OB、OGの皆様・ご協賛いただいた企業の方に限定させていただいております。\n\nまた、中学生の皆様向けに 中学生受験相談室 というイベントを実施いたしますので、ぜひご参加ください。\n日時:10/30(日) 10:30~12:00、14:00~15:30\n場所:マルチメディア棟1階 図書館",
anchorData: [
{
context: "中学生とその保護者の皆様の入場受付はこちら",
link: "#",
key: "JHS",
},
{
context: "OB・OGの皆様の入場受付はこちら",
link: "#",
key: "OB",
},
],
};

export default {
Expand All @@ -34,12 +22,6 @@ export default {
type: "text",
},
},
anchorData: {
description: "Data of admission reception",
control: {
type: "array",
},
},
},
component: TicketSection,
} as Meta;
Expand Down
12 changes: 0 additions & 12 deletions src/components/organisms/ticket-section/type/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,4 @@ import { ComponentProps } from "react";
export type TicketSectionProperties = ComponentProps<"section"> & {
title: string;
children: string;
anchorData: ReadonlyArray<AnchorData>;
};

const Key = {
JHS: "jhs",
OB: "ob",
} as const;

export type AnchorData = {
context: string;
link: string;
key: keyof typeof Key;
};
29 changes: 4 additions & 25 deletions src/components/templates/top/__snapshots__/top.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -111,32 +111,11 @@ exports[`(components) templates/top > take snap shot 1`] = `
<nav
class="css-1ipjmcm"
>
<a
class="css-jhmgok-Button"
href="https://docs.google.com/forms/d/e/1FAIpQLSfOW-ZRsgRQFaZfdusbo_7IycPz6i0dgo2ou-TEk_UEZZIfrw/viewform"
rel="noopener noreferrer"
tabindex="0"
target="_blank"
>
<p
class="css-7bzdgk-Button"
>
中学生とその保護者の皆様の入場受付はこちら
</p>
</a>
<a
class="css-jhmgok-Button"
href="https://docs.google.com/forms/d/e/1FAIpQLSeuij0pjIOD8JTS__argba787SJ6Mj-hkpUNlDiPfo7ezrf5A/viewform"
rel="noopener noreferrer"
tabindex="0"
target="_blank"
<p
class="css-17zcuf2"
>
<p
class="css-7bzdgk-Button"
>
OB・OGの皆様の入場受付はこちら
</p>
</a>
フォームでの受付終了しました。たくさんのご応募ありがとうございました。
</p>
</nav>
</section>
<section
Expand Down
16 changes: 1 addition & 15 deletions src/components/templates/top/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import type { TopProperties } from "./types/model";
import { Caution } from "../../molecules/caution";
import { Text } from "../../atoms/text";
import { TicketSection } from "../../organisms/ticket-section";
import type { AnchorData } from "../../organisms/ticket-section/type/model";
import { FestaSection } from "../../organisms/festa-section";
import { SnsSection } from "../../organisms/sns-section";
import type { SocialData } from "../../organisms/sns-section/types/model";
Expand Down Expand Up @@ -34,19 +33,6 @@ const cautions = [
<CautionText key="4">駐車場はスペースが限られているため、できるだけ公共交通機関を使ってお越しください。</CautionText>,
];

const ticketLinks: Array<AnchorData> = [
{
context: "中学生とその保護者の皆様の入場受付はこちら",
link: "https://docs.google.com/forms/d/e/1FAIpQLSfOW-ZRsgRQFaZfdusbo_7IycPz6i0dgo2ou-TEk_UEZZIfrw/viewform",
key: "JHS",
},
{
context: "OB・OGの皆様の入場受付はこちら",
link: "https://docs.google.com/forms/d/e/1FAIpQLSeuij0pjIOD8JTS__argba787SJ6Mj-hkpUNlDiPfo7ezrf5A/viewform",
key: "OB",
},
];

const socialLinks: Array<SocialData> = [
{
icon: "ci:twitter",
Expand Down Expand Up @@ -88,7 +74,7 @@ const Top: FC<TopProperties> = () => (
<CautionBox aria-label="『Re:ROAD』開催にあたってのお願い">
<Caution sentence={cautions} title="『Re:ROAD』開催にあたってのお願い" />
</CautionBox>
<TicketSection anchorData={ticketLinks} title="Tickets">
<TicketSection title="Tickets">
{
"入場制限により、ご入場いただける方を一部の方のみに限定させていただいております。\n締切: 10/23 (日)\n\nまた、中学生の皆様向けに 中学生受験相談室 というイベントを実施いたしますので、ぜひご参加ください。\n日時:10/30(日) 10:30~12:00、14:00~15:30\n場所:マルチメディア棟1階 図書館"
}
Expand Down

0 comments on commit d89daf5

Please sign in to comment.