Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/pageComponents/gathering/create/RegionChip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useController, useFormContext } from "react-hook-form";
import type { RegionStatus } from "#/apis/region";
import { Chip } from "#/components/chip";
import type { CreateMeetingFormSchema } from "#/schemas/gathering";
import { toast } from "#/utils/toast";
interface RegionChipProps {
value: string;
label: string;
Expand All @@ -21,14 +22,18 @@ export const RegionChip = ({ value, label, status }: RegionChipProps) => {
const isPendingRegion = status === "PENDING";

const handleClick = () => {
if (isPendingRegion) {
toast.warning("곧 추가될 지역입니다. 조금만 기다려주세요!");
return;
}
field.onChange(field.value === value ? null : value);
};

return (
<Chip
selected={!isPendingRegion && field.value === value}
variant={isPendingRegion ? "dashed" : "filled"}
disabled={isPendingRegion}
aria-disabled={isPendingRegion}
onClick={handleClick}
Comment thread
youngminss marked this conversation as resolved.
>
{label}
Expand Down
Loading