diff --git a/src/features/study/ui/my-profile-card.tsx b/src/features/study/ui/my-profile-card.tsx index be84c7ea..df1b0178 100644 --- a/src/features/study/ui/my-profile-card.tsx +++ b/src/features/study/ui/my-profile-card.tsx @@ -18,6 +18,7 @@ interface MyProfileCardProps { subject?: string; time?: string; techStacks?: string; + studyApplied?: boolean; } export default function MyProfileCard({ @@ -28,6 +29,7 @@ export default function MyProfileCard({ subject, time, techStacks, + studyApplied, }: MyProfileCardProps) { const [enabled, setEnabled] = useState(matching); @@ -35,6 +37,8 @@ export default function MyProfileCard({ usePatchAutoMatchingMutation(); const handleToggleChange = (checked: boolean) => { + if (!studyApplied) return; + setEnabled(checked); patchAutoMatching( @@ -69,7 +73,7 @@ export default function MyProfileCard({ size="md" checked={enabled} onCheckedChange={handleToggleChange} - disabled={isPending} + disabled={isPending || !studyApplied} /> diff --git a/src/shared/ui/toggle/switch.tsx b/src/shared/ui/toggle/switch.tsx index b2adea29..91b7c322 100644 --- a/src/shared/ui/toggle/switch.tsx +++ b/src/shared/ui/toggle/switch.tsx @@ -5,7 +5,7 @@ import { cva } from 'class-variance-authority'; import { cn } from '@/shared/shadcn/lib/utils'; const toggleRootVariants = cva( - 'inline-flex items-center rounded-full transition-colors cursor-pointer', + 'inline-flex items-center rounded-full transition-colors cursor-pointer disabled:cursor-not-allowed', { variants: { color: { diff --git a/src/widgets/home/sidebar.tsx b/src/widgets/home/sidebar.tsx index cd342461..9709d142 100644 --- a/src/widgets/home/sidebar.tsx +++ b/src/widgets/home/sidebar.tsx @@ -27,6 +27,7 @@ export default async function Sidebar() { techStacks={userProfile?.memberInfo.techStacks ?.map((t) => t.techStackName) .join(', ')} + studyApplied={userProfile?.studyApplied ?? false} /> {userProfile.studyApplied ? (