diff --git a/packages/nextjs/app/enterpreneur/create/page.tsx b/packages/nextjs/app/enterpreneur/create/page.tsx new file mode 100644 index 0000000..1f88877 --- /dev/null +++ b/packages/nextjs/app/enterpreneur/create/page.tsx @@ -0,0 +1,46 @@ +"use client"; + +import { useState } from "react"; +import { useEffect } from "react"; +import { Card } from "../form/card"; +import { SelectTab } from "../form/selectTab"; +import { SwitchField } from "../form/switchField"; +import { Box, Tab, Tabs } from "@mui/material"; +import { Typography } from "@mui/material"; + +// タブの種類を表すユニオン型を定義 +type TabType = "割引券" | "引換券" | "会員券"; + +const content = { + title: "割引券", // タイトル + issueDate: "12/6", // 発行日 + amount: 5000, // 金額 + expiryDate: "12/5 ~ 12/6", // 有効期限 + usageScope: "商用化", // 使用範囲 +}; + +export default function TicketTabs() { + const [value, setValue] = useState("割引券"); + + const handleChange = (event: React.SyntheticEvent, newValue: number) => { + const tabLabels: TabType[] = ["割引券", "引換券", "会員券"]; + setValue(tabLabels[newValue]); + }; + + useEffect(() => { + console.log(value); + }, [value]); + + return ( +
+ + クーポンの登録 + + + + + + +
+ ); +} diff --git a/packages/nextjs/app/enterpreneur/form/card.tsx b/packages/nextjs/app/enterpreneur/form/card.tsx new file mode 100644 index 0000000..e44c26e --- /dev/null +++ b/packages/nextjs/app/enterpreneur/form/card.tsx @@ -0,0 +1,116 @@ +"use client"; + +import React from "react"; +import { Box, CardContent, Divider, Card as MuiCard, Typography } from "@mui/material"; + +type CardProps = { + title: string; // タイトル + amount: number; // 金額 + expiryDate: string; // 有効期限 + usageScope: string; // 使用範囲 +}; + +export const Card = ({ title, amount, expiryDate, usageScope }: CardProps) => { + return ( + + {/* 上部の丸いアイコン */} + + + + {/* 金額 */} + + {amount}円 + + + {/* バーコード */} + + バーコード + + + + + {/* 有効期限 */} + + + 有効期限 + + + {expiryDate} + + + + {/* 使用範囲 */} + + + 使用範囲 + + + {usageScope} + + + + + + {/* 詳細情報 */} + + + 1. クーポンは1回のご購入につき1枚のみご利用いただけます。 +
+ 2. 他のクーポンや割引サービスの併用はできません。 +
+
+
+
+ ); +}; diff --git a/packages/nextjs/app/enterpreneur/form/fieldSet.tsx b/packages/nextjs/app/enterpreneur/form/fieldSet.tsx new file mode 100644 index 0000000..22b17f9 --- /dev/null +++ b/packages/nextjs/app/enterpreneur/form/fieldSet.tsx @@ -0,0 +1,73 @@ +import { useState } from "react"; +import { FC } from "react"; +import Box from "@mui/material/Box"; +import Button from "@mui/material/Button"; +import FormControlLabel from "@mui/material/FormControlLabel"; +import Grid from "@mui/material/Grid"; +import Radio from "@mui/material/Radio"; +import RadioGroup from "@mui/material/RadioGroup"; +import TextField from "@mui/material/TextField"; + +type FiledSetProps = { + title: string; +}; + +export const FiledSet: FC = ({ title }) => { + const [amount, setAmount] = useState(""); + const [startDate, setStartDate] = useState(""); + const [endDate, setEndDate] = useState(""); + const [usage, setUsage] = useState("会社全体"); + const [details, setDetails] = useState(""); + const [storeName, setStoreName] = useState(""); + + return ( + <> + + + setAmount(e.target.value)} sx={{ mb: 2 }} /> + + + setStartDate(e.target.value)} + /> + + + setEndDate(e.target.value)} + /> + + + setUsage(e.target.value)} sx={{ mt: 2, mb: 2 }}> + } label="会社全体" /> + + } label="店舗名入力" /> + setStoreName(e.target.value)} sx={{ ml: 2 }} /> + + + setDetails(e.target.value)} + sx={{ mb: 2 }} + /> + + + + + ); +}; diff --git a/packages/nextjs/app/enterpreneur/form/selectTab.tsx b/packages/nextjs/app/enterpreneur/form/selectTab.tsx new file mode 100644 index 0000000..d60741f --- /dev/null +++ b/packages/nextjs/app/enterpreneur/form/selectTab.tsx @@ -0,0 +1,45 @@ +import { FC } from "react"; +import { Box, Tab, Tabs } from "@mui/material"; +import { styled } from "@mui/system"; + +type SelectTabProps = { + value: tabType; + handleChange: (event: React.SyntheticEvent, newValue: number) => void; +}; + +type tabType = "割引券" | "引換券" | "会員券"; + +const CustomTabs = styled(Tabs)({ + backgroundColor: "#D3D3D3", // 背景色 + borderRadius: "20px", // 丸みを付ける + padding: "4px", // 全体のパディング + "& .MuiTabs-indicator": { + display: "none", // デフォルトのインジケータを非表示 + }, +}); + +const CustomTab = styled(Tab)(({ theme }) => ({ + textTransform: "none", // テキストの大文字変換を無効化 + fontWeight: 500, // テキストの太さ + fontSize: "1.2rem", // フォントサイズ + color: "black", // 未選択時の文字色 + borderRadius: "100px", // タブの丸み + minWidth: "auto", // タブの幅調整 + padding: "8px 30px", // タブ内の余白 + "&.Mui-selected": { + backgroundColor: "white", // 選択時の背景色 + color: "black", // 選択時の文字色 + }, +})); + +export const SelectTab: FC = ({ value, handleChange }) => { + return ( + + + + + + + + ); +}; diff --git a/packages/nextjs/app/enterpreneur/form/switchField.tsx b/packages/nextjs/app/enterpreneur/form/switchField.tsx new file mode 100644 index 0000000..cbfcd1d --- /dev/null +++ b/packages/nextjs/app/enterpreneur/form/switchField.tsx @@ -0,0 +1,45 @@ +import { FC } from "react"; +import { FiledSet } from "./fieldSet"; + +type SwitchFieldProps = { + value: TabType; +}; + +type TabType = "割引券" | "引換券" | "会員券" | null; + +export const SwitchField: FC = ({ value }) => { + switch (value) { + case "割引券": + return ; + case "引換券": + return ; + case "会員券": + return ; + default: + return null; + } +}; + +export const DiscountField = () => { + return ( + <> + + + ); +}; + +export const ExchangeField = () => { + return ( + <> + + + ); +}; + +export const MemberField = () => { + return ( + <> + + + ); +};