Skip to content

Commit 46e208e

Browse files
authored
Merge branch 'dev' into feature/Ga4-trackedpage-추가-및-click-이벤트-할당-정준영
2 parents 1b317cf + aa13b4e commit 46e208e

File tree

5 files changed

+47
-7
lines changed

5 files changed

+47
-7
lines changed

.github/workflows/cicd.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ jobs:
2727
2828
- name: Create .env file # env 파일 생성 단계 추가
2929
run: |
30-
echo "VITE_GA_MEASUREMENT_ID=${{ secrets.VITE_GA_MEASUREMENT_ID }}" > .env
30+
echo "VITE_KAKAO_REST_API_KEY=${{ secrets.VITE_KAKAO_REST_API_KEY }}" >> .env
31+
echo "VITE_KAKAO_JAVASCRIPT_KEY=${{ secrets.VITE_KAKAO_JAVASCRIPT_KEY }}" >> .env
32+
echo "VITE_KAKAO_PRODUCTION_REDIRECT_URI=${{ secrets.VITE_KAKAO_PRODUCTION_REDIRECT_URI }}" >> .env
33+
echo "VITE_KAKAO_DEVELOPE_REDIRECT_URI=${{ secrets.VITE_KAKAO_DEVELOPE_REDIRECT_URI }}" >> .env
34+
echo "VITE_GA_MEASUREMENT_ID=${{ secrets.VITE_GA_MEASUREMENT_ID }}" >> .env
3135
3236
- name: Run build
3337
run: npm run build # 프로젝트에 맞는 빌드 명령어

src/components/StrokeBanner.tsx

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
1+
import { useState } from "react";
12
import { useNavigate } from "react-router-dom";
3+
import ActionConfirmModal from "@/components/modal/ActionConfirmModal";
4+
import useAuthStore from "@/store/useAuthStore";
25

36
const StrokeBanner = () => {
7+
const [needLoginModalIsOpen, setNeedLoginModalIsOpen] = useState(false);
8+
const { isLoggedIn } = useAuthStore();
49
const navigate = useNavigate();
510

611
const handleNavigate = () => {
7-
const mode = "virtualFriend";
8-
navigate("/select-info", { state: { type: mode } });
12+
if (isLoggedIn) {
13+
const mode = "virtualFriend";
14+
navigate("/select-info", { state: { type: mode } });
15+
} else {
16+
setNeedLoginModalIsOpen(true);
17+
}
918
};
1019

1120
return (
@@ -27,6 +36,16 @@ const StrokeBanner = () => {
2736
<br />
2837
입력해서 빠르게 대화할 수 있어요
2938
</p>
39+
{needLoginModalIsOpen && (
40+
<ActionConfirmModal
41+
title="로그인이 필요합니다."
42+
message={[`로그인 페이지로\n이동할까요?`]}
43+
cancelText="취소"
44+
confirmText="확인"
45+
onCancel={() => setNeedLoginModalIsOpen(false)}
46+
onConfirm={() => navigate("/login")}
47+
/>
48+
)}
3049
</div>
3150
);
3251
};

src/components/SubTitle.tsx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
import { useState } from "react";
12
import { useNavigate } from "react-router-dom";
23
import trackClickEvent from "@/utils/trackClickEvent";
4+
import ActionConfirmModal from "@/components/modal/ActionConfirmModal";
5+
import useAuthStore from "@/store/useAuthStore";
36

47
const SubTitle = ({ mode }: { mode: "빠른대화" | "친구목록" }) => {
8+
const [needLoginModalIsOpen, setNeedLoginModalIsOpen] = useState(false);
9+
const { isLoggedIn } = useAuthStore();
510
const navigate = useNavigate();
611

712
const titleList = {
@@ -16,9 +21,11 @@ const SubTitle = ({ mode }: { mode: "빠른대화" | "친구목록" }) => {
1621
};
1722

1823
const handleNavigate = () => {
19-
const type = mode === "빠른대화" ? "fastFriend" : "virtualFriend";
2024
trackClickEvent("홈", "친구 - 추가");
21-
navigate("/select-info", { state: { type: type } });
25+
if (isLoggedIn) {
26+
const type = mode === "빠른대화" ? "fastFriend" : "virtualFriend";
27+
navigate("/select-info", { state: { type: type } });
28+
} else setNeedLoginModalIsOpen(true);
2229
};
2330

2431
return (
@@ -39,6 +46,16 @@ const SubTitle = ({ mode }: { mode: "빠른대화" | "친구목록" }) => {
3946
/>
4047
</button>
4148
)}
49+
{needLoginModalIsOpen && (
50+
<ActionConfirmModal
51+
title="로그인이 필요합니다."
52+
message={[`로그인 페이지로\n이동할까요?`]}
53+
cancelText="취소"
54+
confirmText="확인"
55+
onCancel={() => setNeedLoginModalIsOpen(false)}
56+
onConfirm={() => navigate("/login")}
57+
/>
58+
)}
4259
</div>
4360
);
4461
};

src/components/button/KakaoLoginButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const KakaoLoginButton = () => {
55
const kakaoRedirectUrl =
66
import.meta.env.MODE === "production"
77
? import.meta.env.VITE_KAKAO_PRODUCTION_REDIRECT_URI
8-
: import.meta.env.VITE_KAKAO_DEVELOP_REDIRECT_URI;
8+
: import.meta.env.VITE_KAKAO_DEVELOPE_REDIRECT_URI;
99

1010
const kakaoURL = `https://kauth.kakao.com/oauth/authorize?client_id=${kakaoRestApiKey}&redirect_uri=${kakaoRedirectUrl}&response_type=code`;
1111

src/components/modal/ActionConfirmModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const ActionConfirmModal = ({
2727
onClick={(e) => e.stopPropagation()}
2828
>
2929
<h3 className="text-2xl font-bold">{title}</h3>
30-
<p className="mt-[9px] text-center text-xl font-medium">
30+
<p className="mt-[9px] text-center text-xl font-medium whitespace-pre-wrap">
3131
{message.map((line, index) => (
3232
<span key={index} className="block">
3333
{line}

0 commit comments

Comments
 (0)