Skip to content

Commit

Permalink
Merge pull request #516 from NUTFes/fix/imaimai/style-form
Browse files Browse the repository at this point in the history
バグ修正
  • Loading branch information
imaimai17468 authored Apr 9, 2023
2 parents 7e52796 + b04ba36 commit 63a7e75
Show file tree
Hide file tree
Showing 39 changed files with 836 additions and 1,677 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ import { BureauLabelProps } from './BureauLabel.type';
import Label from '../Label';

const BureauLabel: React.FC<BureauLabelProps> = (props) => {
const { bureauID } = props;
const bureau = useMemo(() => {
const bureau = BUREAUS_WITH_EN.find((bureau) => bureau.id === bureauID);
return bureau;
}, [bureauID]);
const { bureauName } = props;
const bureauEn = useMemo(() => {
const bureau = BUREAUS_WITH_EN.find((bureau) => bureau.name === bureauName);
if (!bureau) return 'other';
return bureau.name_en;
}, []);

return (
<Label isOutline color={bureau?.name_en}>
{bureau?.name}
<Label isOutline color={bureauEn}>
{bureauName}
</Label>
);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export interface BureauLabelProps {
bureauID: number;
bureauName: string;
}
7 changes: 3 additions & 4 deletions view/next-project/src/components/common/DeleteButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ const DeleteButton = (props: Props) => {
return (
<button
disabled={!isDisabled}
className={`${buttonClass} h-6 w-6 min-w-0 rounded-full bg-gradient-to-br from-red-500 to-red-600 p-0`}
className={`${buttonClass} flex h-6 w-6 min-w-0 items-center justify-center rounded-full bg-gradient-to-br from-red-500 to-red-600 p-0`}
onClick={onClick}
suppressHydrationWarning
>
<div className='flex items-center justify-center'>
<RiDeleteBinLine size={'15px'} color={'white'} />
</div>
<RiDeleteBinLine size={'15px'} color={'white'} />
</button>
);
};
Expand Down
9 changes: 4 additions & 5 deletions view/next-project/src/components/common/EditButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface Props {
}

const EditButton: React.FC<Props> = (props) => {
const { onClick, isDisabled } = props;
const { onClick, isDisabled = true } = props;

const buttonClass = useMemo(() => {
if (!isDisabled) {
Expand All @@ -19,13 +19,12 @@ const EditButton: React.FC<Props> = (props) => {

return (
<button
className={`${buttonClass} h-6 w-6 min-w-0 rounded-full p-0`}
suppressHydrationWarning
className={`${buttonClass} flex h-6 w-6 min-w-0 items-center justify-center rounded-full p-0`}
disabled={!isDisabled}
onClick={onClick}
>
<div className='flex items-center justify-center'>
<RiPencilFill size={'15px'} color={'white'} />
</div>
<RiPencilFill size={'15px'} color={'white'} />
</button>
);
};
Expand Down
2 changes: 2 additions & 0 deletions view/next-project/src/components/common/Input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ interface Props {
value?: string | number;
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
children?: React.ReactNode;
type?: string;
}

function Input(props: Props): JSX.Element {
Expand All @@ -23,6 +24,7 @@ function Input(props: Props): JSX.Element {
id={props.id}
value={props.value}
onChange={props.onChange}
type={props.type}
>
{props.children}
</input>
Expand Down
2 changes: 1 addition & 1 deletion view/next-project/src/components/common/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface Props {

export default function Modal(props: Props) {
const className =
'relative w-auto my-6 mx-auto max-w-3xl bg-white-0 rounded-lg p-5' +
'relative my-6 mx-auto bg-white-0 rounded-lg p-5' +
(props.className ? ` ${props.className}` : '');

return (
Expand Down
Loading

0 comments on commit 63a7e75

Please sign in to comment.