Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion src/features/study/ui/my-profile-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ interface MyProfileCardProps {
subject?: string;
time?: string;
techStacks?: string;
studyApplied?: boolean;
}

export default function MyProfileCard({
Expand All @@ -28,13 +29,16 @@ export default function MyProfileCard({
subject,
time,
techStacks,
studyApplied,
}: MyProfileCardProps) {
const [enabled, setEnabled] = useState(matching);

const { mutate: patchAutoMatching, isPending } =
usePatchAutoMatchingMutation();

const handleToggleChange = (checked: boolean) => {
if (!studyApplied) return;

setEnabled(checked);

patchAutoMatching(
Expand Down Expand Up @@ -69,7 +73,7 @@ export default function MyProfileCard({
size="md"
checked={enabled}
onCheckedChange={handleToggleChange}
disabled={isPending}
disabled={isPending || !studyApplied}
/>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/shared/ui/toggle/switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
1 change: 1 addition & 0 deletions src/widgets/home/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default async function Sidebar() {
techStacks={userProfile?.memberInfo.techStacks
?.map((t) => t.techStackName)
.join(', ')}
studyApplied={userProfile?.studyApplied ?? false}
/>
{userProfile.studyApplied ? (
<TodoList statusList={[false, false, false]} />
Expand Down