Skip to content

Commit

Permalink
formatted by workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
imaimai17468 authored and actions-user committed Apr 18, 2023
1 parent 65f03e3 commit 04a0922
Show file tree
Hide file tree
Showing 20 changed files with 99 additions and 120 deletions.
1 change: 0 additions & 1 deletion view/next-project/src/components/auth/SignInView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean>(false);
Expand Down
1 change: 0 additions & 1 deletion view/next-project/src/components/auth/SignUpView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
60 changes: 24 additions & 36 deletions view/next-project/src/components/budgets/DetailModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,19 @@ const DetailModal: FC<ModalProps> = (props) => {
<div className='my-10 flex flex-wrap justify-center gap-8'>
<div className='flex gap-3'>
<p className='text-black-600'>支出元</p>
<p className='border-b border-primary-1'>
{props.expenseView.expense.name}
</p>
<p className='border-b border-primary-1'>{props.expenseView.expense.name}</p>
</div>
<div className='flex gap-3'>
<p className='text-black-600'>合計金額</p>
<p className='border-b border-primary-1'>
{props.expenseView.expense.totalPrice}
</p>
<p className='border-b border-primary-1'>{props.expenseView.expense.totalPrice}</p>
</div>
<div className='flex gap-3'>
<p className='text-black-600'>割引合計</p>
<p className='border-b border-primary-1'>
{discountTotal}
</p>
<p className='border-b border-primary-1'>{discountTotal}</p>
</div>
<div className='flex gap-3'>
<p className='text-black-600'>加算合計</p>
<p className='border-b border-primary-1'>
{additionTotal}
</p>
<p className='border-b border-primary-1'>{additionTotal}</p>
</div>
</div>
<p className='my-5 mx-auto w-fit text-xl text-black-600'>購入物品</p>
Expand All @@ -81,32 +73,28 @@ const DetailModal: FC<ModalProps> = (props) => {
</tr>
</thead>
<tbody className='border border-x-white-0 border-b-primary-1'>
{props.expenseView.purchaseDetails ? (props.expenseView.purchaseDetails.map((purchaseDetail) => (
purchaseDetail.purchaseItems.map((purchaseItem) => (
<tr key={purchaseItem.id}>
<td className='py-3'>
<div className='text-center text-sm text-black-600'>
{purchaseItem.item}
</div>
</td>
<td className='py-3'>
<div className='text-center text-sm text-black-600'>
{purchaseItem.quantity}
</div>
</td>
<td className='py-3'>
<div className='text-center text-sm text-black-600'>
{purchaseItem.price}
</div>
</td>
</tr>
))
))) : (
{props.expenseView.purchaseDetails ? (
props.expenseView.purchaseDetails.map((purchaseDetail) =>
purchaseDetail.purchaseItems.map((purchaseItem) => (
<tr key={purchaseItem.id}>
<td className='py-3'>
<div className='text-center text-sm text-black-600'>{purchaseItem.item}</div>
</td>
<td className='py-3'>
<div className='text-center text-sm text-black-600'>
{purchaseItem.quantity}
</div>
</td>
<td className='py-3'>
<div className='text-center text-sm text-black-600'>{purchaseItem.price}</div>
</td>
</tr>
)),
)
) : (
<tr className='border border-x-white-0 border-b-primary-1 border-t-white-0'>
<td className='py-3' colSpan={3}>
<div className='text-center text-sm text-black-600'>
購入物品がありません
</div>
<div className='text-center text-sm text-black-600'>購入物品がありません</div>
</td>
</tr>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import Label from '../Label';
import { BureauLabelProps } from './BureauLabel.type';
import { BUREAUS_WITH_EN } from '@constants/bureaus';


const BureauLabel: React.FC<BureauLabelProps> = (props) => {
const { bureauName } = props;
const bureauEn = useMemo(() => {
Expand Down
1 change: 0 additions & 1 deletion view/next-project/src/components/common/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion view/next-project/src/components/common/Label/Label.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import React, { useMemo } from 'react';
import { LabelProps } from './Label.type';
import theme from '@/assets/theme';


const Label: React.FC<LabelProps> = (props) => {
const {
children,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { useState } from 'react';
import RegistModal from './RegistModal';
import theme from '@assets/theme';


interface Props {
width?: string;
height?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<SetStateAction<boolean>>;
teachers: Teacher[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<SetStateAction<boolean>>;
teachers: Teacher[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand Down
1 change: 0 additions & 1 deletion view/next-project/src/components/layout/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<SetStateAction<boolean>>;
id: number | string;
Expand Down
124 changes: 67 additions & 57 deletions view/next-project/src/components/purchaseorders/EditModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -11,7 +11,7 @@ import {
Input,
Modal,
Stepper,
Tooltip
Tooltip,
} from '@components/common';
import { PurchaseItem } from '@type/common';

Expand Down Expand Up @@ -89,19 +89,39 @@ export default function EditModal(props: ModalProps) {
<div className='my-6 grid grid-cols-5 items-center justify-items-center gap-4'>
<p className='text-black-600'>物品名</p>
<div className='col-span-4 w-full'>
<Input className='w-full' id={String(data.id)} value={data.item} onChange={handler('item')} />
<Input
className='w-full'
id={String(data.id)}
value={data.item}
onChange={handler('item')}
/>
</div>
<p className='text-black-600'>単価</p>
<div className='col-span-4 w-full'>
<Input className='w-full' id={String(data.id)} value={data.price} onChange={handler('price')} />
<Input
className='w-full'
id={String(data.id)}
value={data.price}
onChange={handler('price')}
/>
</div>
<p className='text-black-600'>個数</p>
<div className='col-span-4 w-full'>
<Input className='w-full' id={String(data.id)} value={data.quantity} onChange={handler('quantity')} />
<Input
className='w-full'
id={String(data.id)}
value={data.quantity}
onChange={handler('quantity')}
/>
</div>
<p className='text-black-600'>詳細</p>
<div className='col-span-4 w-full'>
<Input className='w-full' id={String(data.id)} value={data.detail} onChange={handler('detail')} />
<Input
className='w-full'
id={String(data.id)}
value={data.detail}
onChange={handler('detail')}
/>
</div>
<p className='text-black-600'>URL</p>
<div className='col-span-4 w-full'>
Expand All @@ -114,16 +134,14 @@ export default function EditModal(props: ModalProps) {
<>
{props.isOpen && (
<Modal className='w-1/2'>
<div className='w-fit ml-auto'>
<div className='ml-auto w-fit'>
<CloseButton
onClick={() => {
props.setIsOpen(false);
}}
/>
</div>
<p className='mb-10 w-fit mx-auto text-xl text-black-600'>
購入物品の修正
</p>
<p className='mx-auto mb-10 w-fit text-xl text-black-600'>購入物品の修正</p>
{/* 購入物品があればステッパで表示、なければないと表示 */}
{formDataList.length > 0 && (
<Stepper stepNum={formDataList.length} activeStep={activeStep} isDone={isDone}>
Expand All @@ -134,7 +152,7 @@ export default function EditModal(props: ModalProps) {
<div>
<table className='w-full'>
<thead>
<tr className='border-b border-primary-1 border-gray-300'>
<tr className='border-gray-300 border-b border-primary-1'>
<th className='py-2'>物品名</th>
<th className='py-2'>単価</th>
<th className='py-2'>個数</th>
Expand All @@ -144,39 +162,33 @@ export default function EditModal(props: ModalProps) {
</thead>
<tbody>
{formDataList.map((data) => (
<tr key={data.id} className='border-b border-gray-300'>
<tr key={data.id} className='border-gray-300 border-b'>
<td className='py-2'>{data.item}</td>
<td className='py-2'>{data.price}</td>
<td className='py-2'>{data.quantity}</td>
<td className='py-2'>{data.detail}</td>
<td className='py-2'>
<div className={'flex justify-center'}>
<a
href={data.url}
target='_blank'
rel='noopener noreferrer'
>
<RiExternalLinkLine size={'16px'} />
</a>
<Tooltip text={'copy URL'}>
<RiFileCopyLine
size={'16px'}
className='cursor-pointer'
onClick={() => {
navigator.clipboard.writeText(data.url);
}}
/>
</Tooltip>
</div>
<div className={'flex justify-center'}>
<a href={data.url} target='_blank' rel='noopener noreferrer'>
<RiExternalLinkLine size={'16px'} />
</a>
<Tooltip text={'copy URL'}>
<RiFileCopyLine
size={'16px'}
className='cursor-pointer'
onClick={() => {
navigator.clipboard.writeText(data.url);
}}
/>
</Tooltip>
</div>
</td>
</tr>
))}
</tbody>
</table>
<div className='flex gap-5 justify-center mt-10 mb-5'>
<OutlinePrimaryButton onClick={reset}>
戻る
</OutlinePrimaryButton>
<div className='mt-10 mb-5 flex justify-center gap-5'>
<OutlinePrimaryButton onClick={reset}>戻る</OutlinePrimaryButton>
<PrimaryButton
onClick={() => {
submit(formDataList);
Expand All @@ -187,29 +199,27 @@ export default function EditModal(props: ModalProps) {
</div>
</div>
) : (
<div className='flex gap-5 justify-center mt-10 mb-5'>
{formDataList.length > 0 && (
<>
{activeStep > 1 && (
<OutlinePrimaryButton onClick={prevStep}>
戻る
</OutlinePrimaryButton>
)}
<PrimaryButton
onClick={() => {
{
activeStep === formDataList.length ? setIsDone(true) : nextStep();
}
isFinanceCheckHandler(formDataList[activeStep - 1].id, true);
}}
>
{activeStep === formDataList.length ? '確認へ' : '登録して次へ'}
<RiArrowDropRightLine size={23} />
</PrimaryButton>
</>
)}
</div>
)}
<div className='mt-10 mb-5 flex justify-center gap-5'>
{formDataList.length > 0 && (
<>
{activeStep > 1 && (
<OutlinePrimaryButton onClick={prevStep}>戻る</OutlinePrimaryButton>
)}
<PrimaryButton
onClick={() => {
{
activeStep === formDataList.length ? setIsDone(true) : nextStep();
}
isFinanceCheckHandler(formDataList[activeStep - 1].id, true);
}}
>
{activeStep === formDataList.length ? '確認へ' : '登録して次へ'}
<RiArrowDropRightLine size={23} />
</PrimaryButton>
</>
)}
</div>
)}
</Modal>
)}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand Down
Loading

0 comments on commit 04a0922

Please sign in to comment.