From 04a0922fac84c3c081cc48d3d8270638f55d7460 Mon Sep 17 00:00:00 2001 From: imaimai17468 Date: Tue, 18 Apr 2023 09:59:43 +0000 Subject: [PATCH] formatted by workflow --- .../src/components/auth/SignInView.tsx | 1 - .../src/components/auth/SignUpView.tsx | 1 - .../src/components/budgets/DetailModal.tsx | 60 ++++----- .../common/BureauLabel/BureauLabel.tsx | 1 - .../src/components/common/Header/Header.tsx | 1 - .../src/components/common/Label/Label.tsx | 1 - .../src/components/common/OpenModalButton.tsx | 1 - .../components/fund_information/AddModal.tsx | 1 - .../components/fund_information/EditModal.tsx | 1 - .../fund_information/OpenAddModalButton.tsx | 1 - .../OpenDeleteModalButton.tsx | 1 - .../fund_information/OpenEditModalButton.tsx | 1 - .../src/components/layout/Layout/Layout.tsx | 1 - .../components/purchaseorders/DeleteModal.tsx | 1 - .../components/purchaseorders/EditModal.tsx | 124 ++++++++++-------- .../purchaseorders/OpenAddModalButton.tsx | 1 - .../src/pages/sponsoractivities/index.tsx | 6 +- .../src/pages/sponsorstyles/index.tsx | 10 +- view/next-project/src/type/common.ts | 4 +- view/next-project/src/utils/api/budget.ts | 1 - 20 files changed, 99 insertions(+), 120 deletions(-) diff --git a/view/next-project/src/components/auth/SignInView.tsx b/view/next-project/src/components/auth/SignInView.tsx index 8acbcde7b..50f58e5d0 100644 --- a/view/next-project/src/components/auth/SignInView.tsx +++ b/view/next-project/src/components/auth/SignInView.tsx @@ -10,7 +10,6 @@ import { signIn } from '@api/signIn'; import LoadingButton from '@components/common/LoadingButton'; import { SignIn } from '@type/common'; - export default function SignInView() { // ログイン中フラグ const [isSignInNow, setIsSignInNow] = useState(false); diff --git a/view/next-project/src/components/auth/SignUpView.tsx b/view/next-project/src/components/auth/SignUpView.tsx index c508b75d8..b90b23524 100644 --- a/view/next-project/src/components/auth/SignUpView.tsx +++ b/view/next-project/src/components/auth/SignUpView.tsx @@ -12,7 +12,6 @@ import { post } from '@api/user'; import LoadingButton from '@components/common/LoadingButton'; import { SignUp, User } from '@type/common'; - export default function SignUpView() { const [, setAuth] = useRecoilState(authAtom); const [, setUser] = useRecoilState(userAtom); diff --git a/view/next-project/src/components/budgets/DetailModal.tsx b/view/next-project/src/components/budgets/DetailModal.tsx index fec946749..99c137a49 100644 --- a/view/next-project/src/components/budgets/DetailModal.tsx +++ b/view/next-project/src/components/budgets/DetailModal.tsx @@ -42,27 +42,19 @@ const DetailModal: FC = (props) => {

支出元

-

- {props.expenseView.expense.name} -

+

{props.expenseView.expense.name}

合計金額

-

- {props.expenseView.expense.totalPrice} -

+

{props.expenseView.expense.totalPrice}

割引合計

-

- {discountTotal} -

+

{discountTotal}

加算合計

-

- {additionTotal} -

+

{additionTotal}

購入物品

@@ -81,32 +73,28 @@ const DetailModal: FC = (props) => { - {props.expenseView.purchaseDetails ? (props.expenseView.purchaseDetails.map((purchaseDetail) => ( - purchaseDetail.purchaseItems.map((purchaseItem) => ( - - -
- {purchaseItem.item} -
- - -
- {purchaseItem.quantity} -
- - -
- {purchaseItem.price} -
- - - )) - ))) : ( + {props.expenseView.purchaseDetails ? ( + props.expenseView.purchaseDetails.map((purchaseDetail) => + purchaseDetail.purchaseItems.map((purchaseItem) => ( + + +
{purchaseItem.item}
+ + +
+ {purchaseItem.quantity} +
+ + +
{purchaseItem.price}
+ + + )), + ) + ) : ( -
- 購入物品がありません -
+
購入物品がありません
)} diff --git a/view/next-project/src/components/common/BureauLabel/BureauLabel.tsx b/view/next-project/src/components/common/BureauLabel/BureauLabel.tsx index 241b7f7b2..7d1ba402e 100644 --- a/view/next-project/src/components/common/BureauLabel/BureauLabel.tsx +++ b/view/next-project/src/components/common/BureauLabel/BureauLabel.tsx @@ -4,7 +4,6 @@ import Label from '../Label'; import { BureauLabelProps } from './BureauLabel.type'; import { BUREAUS_WITH_EN } from '@constants/bureaus'; - const BureauLabel: React.FC = (props) => { const { bureauName } = props; const bureauEn = useMemo(() => { diff --git a/view/next-project/src/components/common/Header/Header.tsx b/view/next-project/src/components/common/Header/Header.tsx index 9cccb3f6f..fc9c90883 100644 --- a/view/next-project/src/components/common/Header/Header.tsx +++ b/view/next-project/src/components/common/Header/Header.tsx @@ -10,7 +10,6 @@ import { del } from '@api/signOut'; import { ChakraUIDropdown } from '@components/common'; import { User } from '@type/common'; - const Header = (props: HeaderProps) => { const { onSideNavOpen } = props; const [auth, setAuth] = useRecoilState(authAtom); diff --git a/view/next-project/src/components/common/Label/Label.tsx b/view/next-project/src/components/common/Label/Label.tsx index 49a5d10b2..78c9d5735 100644 --- a/view/next-project/src/components/common/Label/Label.tsx +++ b/view/next-project/src/components/common/Label/Label.tsx @@ -4,7 +4,6 @@ import React, { useMemo } from 'react'; import { LabelProps } from './Label.type'; import theme from '@/assets/theme'; - const Label: React.FC = (props) => { const { children, diff --git a/view/next-project/src/components/common/OpenModalButton.tsx b/view/next-project/src/components/common/OpenModalButton.tsx index cf5e04eed..30615b8e0 100644 --- a/view/next-project/src/components/common/OpenModalButton.tsx +++ b/view/next-project/src/components/common/OpenModalButton.tsx @@ -5,7 +5,6 @@ import { useState } from 'react'; import RegistModal from './RegistModal'; import theme from '@assets/theme'; - interface Props { width?: string; height?: string; diff --git a/view/next-project/src/components/fund_information/AddModal.tsx b/view/next-project/src/components/fund_information/AddModal.tsx index adaf94998..003cf45cd 100644 --- a/view/next-project/src/components/fund_information/AddModal.tsx +++ b/view/next-project/src/components/fund_information/AddModal.tsx @@ -7,7 +7,6 @@ import { userAtom } from '@/store/atoms'; import { post } from '@api/fundInformations'; import { Department, FundInformation, Teacher, User } from '@type/common'; - interface ModalProps { setShowModal: Dispatch>; teachers: Teacher[]; diff --git a/view/next-project/src/components/fund_information/EditModal.tsx b/view/next-project/src/components/fund_information/EditModal.tsx index 6b082cfc0..133f8b22f 100644 --- a/view/next-project/src/components/fund_information/EditModal.tsx +++ b/view/next-project/src/components/fund_information/EditModal.tsx @@ -5,7 +5,6 @@ import { Modal, Input, Select, CloseButton, PrimaryButton } from '../common'; import { put } from '@api/fundInformations'; import { FundInformation, Teacher, User, Department } from '@type/common'; - interface ModalProps { setShowModal: Dispatch>; teachers: Teacher[]; diff --git a/view/next-project/src/components/fund_information/OpenAddModalButton.tsx b/view/next-project/src/components/fund_information/OpenAddModalButton.tsx index d9c342e22..670166ba6 100644 --- a/view/next-project/src/components/fund_information/OpenAddModalButton.tsx +++ b/view/next-project/src/components/fund_information/OpenAddModalButton.tsx @@ -4,7 +4,6 @@ import OpenAddModal from './AddModal'; import { AddButton } from '@components/common'; import { Teacher, Department, User } from '@type/common'; - interface Props { children?: React.ReactNode; teachers: Teacher[]; diff --git a/view/next-project/src/components/fund_information/OpenDeleteModalButton.tsx b/view/next-project/src/components/fund_information/OpenDeleteModalButton.tsx index 17110fafa..228efdcb2 100644 --- a/view/next-project/src/components/fund_information/OpenDeleteModalButton.tsx +++ b/view/next-project/src/components/fund_information/OpenDeleteModalButton.tsx @@ -3,7 +3,6 @@ import React, { useState } from 'react'; import DeleteModal from './DeleteModal'; import { DeleteButton } from '@components/common'; - interface Props { children?: React.ReactNode; id: number; diff --git a/view/next-project/src/components/fund_information/OpenEditModalButton.tsx b/view/next-project/src/components/fund_information/OpenEditModalButton.tsx index 7d2fd7d29..7dd948082 100644 --- a/view/next-project/src/components/fund_information/OpenEditModalButton.tsx +++ b/view/next-project/src/components/fund_information/OpenEditModalButton.tsx @@ -4,7 +4,6 @@ import EditModal from './EditModal'; import { EditButton } from '@components/common'; import { Teacher, Department, User, FundInformation } from '@type/common'; - interface Props { teachers: Teacher[]; departments: Department[]; diff --git a/view/next-project/src/components/layout/Layout/Layout.tsx b/view/next-project/src/components/layout/Layout/Layout.tsx index 49fb61ba3..d14976009 100644 --- a/view/next-project/src/components/layout/Layout/Layout.tsx +++ b/view/next-project/src/components/layout/Layout/Layout.tsx @@ -8,7 +8,6 @@ import PurchaseOrderListModal from '@components/purchasereports/PurchaseOrderLis import PurchaseReportItemNumModal from '@components/purchasereports/PurchaseReportItemNumModal'; import { useUI } from '@components/ui/context'; - const ModalView: React.FC<{ modalView: string }> = ({ modalView }) => { return ( <> diff --git a/view/next-project/src/components/purchaseorders/DeleteModal.tsx b/view/next-project/src/components/purchaseorders/DeleteModal.tsx index 051d7d704..2656ebc38 100644 --- a/view/next-project/src/components/purchaseorders/DeleteModal.tsx +++ b/view/next-project/src/components/purchaseorders/DeleteModal.tsx @@ -4,7 +4,6 @@ import React, { Dispatch, FC, SetStateAction } from 'react'; import { CloseButton, Modal, OutlinePrimaryButton, PrimaryButton } from '../common'; import { del } from '@api/api_methods'; - interface ModalProps { setShowModal: Dispatch>; id: number | string; diff --git a/view/next-project/src/components/purchaseorders/EditModal.tsx b/view/next-project/src/components/purchaseorders/EditModal.tsx index c163b6c3b..a438b759d 100644 --- a/view/next-project/src/components/purchaseorders/EditModal.tsx +++ b/view/next-project/src/components/purchaseorders/EditModal.tsx @@ -2,7 +2,7 @@ import { useRouter } from 'next/router'; import React, { useState } from 'react'; import { RiArrowDropRightLine } from 'react-icons/ri'; -import { RiExternalLinkLine, RiFileCopyLine } from 'react-icons/ri' +import { RiExternalLinkLine, RiFileCopyLine } from 'react-icons/ri'; import { put } from '@api/purchaseItem'; import { PrimaryButton, @@ -11,7 +11,7 @@ import { Input, Modal, Stepper, - Tooltip + Tooltip, } from '@components/common'; import { PurchaseItem } from '@type/common'; @@ -89,19 +89,39 @@ export default function EditModal(props: ModalProps) {

物品名

- +

単価

- +

個数

- +

詳細

- +

URL

@@ -114,16 +134,14 @@ export default function EditModal(props: ModalProps) { <> {props.isOpen && ( -
+
{ props.setIsOpen(false); }} />
-

- 購入物品の修正 -

+

購入物品の修正

{/* 購入物品があればステッパで表示、なければないと表示 */} {formDataList.length > 0 && ( @@ -134,7 +152,7 @@ export default function EditModal(props: ModalProps) {
- + @@ -144,39 +162,33 @@ export default function EditModal(props: ModalProps) { {formDataList.map((data) => ( - + ))}
物品名 単価 個数
{data.item} {data.price} {data.quantity} {data.detail} -
- - - - - { - navigator.clipboard.writeText(data.url); - }} - /> - -
+
+ + + + + { + navigator.clipboard.writeText(data.url); + }} + /> + +
-
- - 戻る - +
+ 戻る { submit(formDataList); @@ -187,29 +199,27 @@ export default function EditModal(props: ModalProps) {
) : ( -
- {formDataList.length > 0 && ( - <> - {activeStep > 1 && ( - - 戻る - - )} - { - { - activeStep === formDataList.length ? setIsDone(true) : nextStep(); - } - isFinanceCheckHandler(formDataList[activeStep - 1].id, true); - }} - > - {activeStep === formDataList.length ? '確認へ' : '登録して次へ'} - - - - )} -
- )} +
+ {formDataList.length > 0 && ( + <> + {activeStep > 1 && ( + 戻る + )} + { + { + activeStep === formDataList.length ? setIsDone(true) : nextStep(); + } + isFinanceCheckHandler(formDataList[activeStep - 1].id, true); + }} + > + {activeStep === formDataList.length ? '確認へ' : '登録して次へ'} + + + + )} +
+ )} )} diff --git a/view/next-project/src/components/purchaseorders/OpenAddModalButton.tsx b/view/next-project/src/components/purchaseorders/OpenAddModalButton.tsx index 4f882501c..3b072c8a1 100644 --- a/view/next-project/src/components/purchaseorders/OpenAddModalButton.tsx +++ b/view/next-project/src/components/purchaseorders/OpenAddModalButton.tsx @@ -4,7 +4,6 @@ import PurchaseItemNumModal from './PurchaseItemNumModal'; import { AddButton } from '@components/common'; import { Expense } from '@type/common'; - interface Props { children?: React.ReactNode; expenses: Expense[]; diff --git a/view/next-project/src/pages/sponsoractivities/index.tsx b/view/next-project/src/pages/sponsoractivities/index.tsx index 60b8973fd..f1d62c133 100644 --- a/view/next-project/src/pages/sponsoractivities/index.tsx +++ b/view/next-project/src/pages/sponsoractivities/index.tsx @@ -50,7 +50,7 @@ export default function SponsorActivities(props: Props) { const [sponsorActivitiesID, setSponsorActivitiesID] = useState(1); const [sponsorActivitiesItem, setSponsorActivitiesViewItem] = useState(); const [isOpen, setIsOpen] = useState(false); - + const onOpen = (sponsorActivitiesID: number, sponsorActivitiesItem: SponsorActivityView) => { setSponsorActivitiesID(sponsorActivitiesID); setSponsorActivitiesViewItem(sponsorActivitiesItem); @@ -111,11 +111,11 @@ export default function SponsorActivities(props: Props) { {props.sponsorActivitiesView.map((sponsorActivitiesItem, index) => ( - { onOpen(sponsorActivitiesItem.sponsorActivity.id || 0, sponsorActivitiesItem); }} - className={clsx(props.sponsorActivitiesView.length-1 !== index && 'border-b')} + className={clsx(props.sponsorActivitiesView.length - 1 !== index && 'border-b')} key={sponsorActivitiesItem.sponsorActivity.id} > diff --git a/view/next-project/src/pages/sponsorstyles/index.tsx b/view/next-project/src/pages/sponsorstyles/index.tsx index ab449bd07..32fe403e4 100644 --- a/view/next-project/src/pages/sponsorstyles/index.tsx +++ b/view/next-project/src/pages/sponsorstyles/index.tsx @@ -67,10 +67,8 @@ export default function SponsorStyleList(props: Props) { {sponsorStyleList.map((sponsorStyleItem, index) => ( - @@ -84,9 +82,7 @@ export default function SponsorStyleList(props: Props) {

モノクロ

)} - - {sponsorStyleItem.price} - + {sponsorStyleItem.price}
{ }); return await res.json(); }; -