Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YS-384] 믹스패널 도입 #86

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@
"@tanstack/react-query": "^5.62.11",
"@tanstack/react-query-devtools": "^5.62.11",
"@tanstack/react-table": "^8.20.6",
"@types/mixpanel-browser": "^2.51.0",
"@vanilla-extract/css": "^1.17.0",
"@vanilla-extract/dynamic": "^2.1.2",
"@vanilla-extract/next-plugin": "^2.4.8",
"@vanilla-extract/recipes": "^0.5.5",
"axios": "^1.7.9",
"date-fns": "^4.1.0",
"jira-prepare-commit-msg": "^1.7.2",
"mixpanel-browser": "^2.61.0",
"next": "14.2.22",
"react": "^18",
"react-day-picker": "^9.5.0",
Expand Down
93 changes: 85 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions src/app/edit/[post_id]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { Metadata } from 'next';

import DefaultLayout from '@/components/layout/DefaultLayout/DefaultLayout';

export const metadata: Metadata = {
title: '그라밋 | 공고 수정',
description: '그라밋 | 공고 수정',
};

function EditLayout({ children }: { children: React.ReactNode }) {
return <DefaultLayout>{children}</DefaultLayout>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import {

import { ExperimentPostListFilters } from '@/apis/post';
import useExperimentPostListQuery from '@/app/home/hooks/useExperimentPostListQuery';
import { emptySubTitle } from '@/app/my-posts/components/MyPostsTable/MyPostsTable.css';
import { emptyViewLayout } from '@/app/post/[post_id]/components/ExperimentPostContainer/ExperimentPostContainer.css';
import Spinner from '@/components/Spinner/Spinner';

interface PostCardListContainerProps {
filters: ExperimentPostListFilters;
Expand All @@ -22,8 +25,18 @@ const ExperimentPostCardListContainer = ({ filters, isLoading }: PostCardListCon
fetchNextPage,
isFetchingNextPage,
isFetching,
isLoading: isListLoading,
} = useExperimentPostListQuery(filters, isLoading);

if (isListLoading) {
return (
<div className={emptyViewLayout}>
<Spinner />
<p className={emptySubTitle}>로딩중..</p>
</div>
);
}

return (
<div className={postCardContentContainer}>
<div className={postCardContainer}>
Expand Down
6 changes: 6 additions & 0 deletions src/app/join/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { Metadata } from 'next';
import { Suspense } from 'react';

import { joinPageLayout } from './JoinPage.css';

export const metadata: Metadata = {
title: '그라밋 | 회원가입',
description: '그라밋 | 회원가입',
};

function JoinLayout({ children }: { children: React.ReactNode }) {
return (
<div className={joinPageLayout}>
Expand Down
6 changes: 6 additions & 0 deletions src/app/login/hooks/useGoogleLoginMutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useRouter } from 'next/navigation';

import { API } from '@/apis/config';
import { googleLogin } from '@/apis/login';
import { identifyUser, setUserProperties } from '@/lib/mixpanelClient';

const useGoogleLoginMutation = () => {
const router = useRouter();
Expand All @@ -14,11 +15,16 @@ const useGoogleLoginMutation = () => {
API.defaults.headers.common['Authorization'] = `Bearer ${accessToken}`;
sessionStorage.setItem('refreshToken', refreshToken);
sessionStorage.setItem('role', memberInfo.role);

identifyUser(memberInfo.oauthEmail);
setUserProperties({ email: memberInfo.oauthEmail, role: memberInfo.role });

router.push('/');
return;
}

sessionStorage.setItem('email', memberInfo.oauthEmail);

router.push('/join');
},
onError: () => {
Expand Down
5 changes: 5 additions & 0 deletions src/app/login/hooks/useNaverLoginMutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useRouter } from 'next/navigation';

import { API } from '@/apis/config';
import { naverLogin, NaverLoginParams } from '@/apis/login';
import { identifyUser, setUserProperties } from '@/lib/mixpanelClient';

const useNaverLoginMutation = () => {
const router = useRouter();
Expand All @@ -14,6 +15,10 @@ const useNaverLoginMutation = () => {
API.defaults.headers.common['Authorization'] = `Bearer ${accessToken}`;
sessionStorage.setItem('refreshToken', refreshToken);
sessionStorage.setItem('role', memberInfo.role);

identifyUser(memberInfo.oauthEmail);
setUserProperties({ email: memberInfo.oauthEmail, role: memberInfo.role });

router.push('/');
return;
}
Expand Down
7 changes: 7 additions & 0 deletions src/app/login/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { Metadata } from 'next';

import { loginLayout } from './LoginPage.css';

export const metadata: Metadata = {
title: '그라밋 | 로그인',
description: '그라밋 | 로그인',
};

function LoginLayout({ children }: { children: React.ReactNode }) {
return <div className={loginLayout}>{children}</div>;
}
Expand Down
Loading
Loading