Skip to content

Commit

Permalink
feat: 인증인가 페이지 라우팅 가드 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
toothlessdev committed Jun 9, 2024
1 parent 7aeb0a4 commit a253d5c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
5 changes: 3 additions & 2 deletions src/pages/groups/[id]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { GroupInfoCard, GroupInfoCardSkeleton } from "@/components/display/Cards
import { MemberCard, MemberCardSkeleton } from "@/components/display/Cards/MemberCard";
import { ReceiptCard, ReceiptCardSkeleton } from "@/components/display/Cards/ReceiptCard";
import { Button } from "@/components/forms/Button";
import { withProtectedRoute } from "@/components/guards/withProtectedRoute";

import { useGroupMembers } from "@/hooks/groups/useGroupMembers";
import { useReceipt } from "@/hooks/receipt/useReceipt";
Expand All @@ -12,7 +13,7 @@ import { ChevronRightIcon } from "@/assets/ChevronRightIcon";

import { useUploadModal } from "@/context/UploadModalContext";

export default function GroupDetailPage() {
export default withProtectedRoute(function GroupDetailPage() {
const { isPending: isGroupInfoPending, data: members } = useGroupMembers();
const { setIsModalOpened } = useUploadModal();

Expand Down Expand Up @@ -88,4 +89,4 @@ export default function GroupDetailPage() {
</div>
</div>
);
}
});
6 changes: 4 additions & 2 deletions src/pages/groups/my.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export default function MyGroupPage() {
import { withProtectedRoute } from "@/components/guards/withProtectedRoute";

export default withProtectedRoute(function MyGroupPage() {
return <>my-gorups</>;
}
});
5 changes: 3 additions & 2 deletions src/pages/groups/new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import { Button } from "@/components/forms/Button";
import { Input } from "@/components/forms/Input";
import { Label } from "@/components/forms/Label";
import { Textarea } from "@/components/forms/TextArea";
import { withProtectedRoute } from "@/components/guards/withProtectedRoute";
import { Title } from "@/components/typography/Title";

import { useNewGroup } from "@/hooks/groups/useNewGroup";

export default function NewGroupPage() {
export default withProtectedRoute(function NewGroupPage() {
const { nameRef, cityRef, organizationRef, descriptionRef, handleSubmit } = useNewGroup();

return (
Expand Down Expand Up @@ -35,4 +36,4 @@ export default function NewGroupPage() {
</div>
</div>
);
}
});
6 changes: 4 additions & 2 deletions src/pages/profile/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { Avatar, AvatarFallback, AvatarImage } from "@/components/display/Avatar";
import { Button } from "@/components/forms/Button";
import { withProtectedRoute } from "@/components/guards/withProtectedRoute";

import { useProfile } from "@/context/ProfileContext";

export default function ProfilePage() {
export default withProtectedRoute(function ProfilePage() {
const profile = useProfile();

return (
Expand All @@ -27,4 +29,4 @@ export default function ProfilePage() {
</div>
</div>
);
}
});

0 comments on commit a253d5c

Please sign in to comment.