File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 # 프로젝트에 맞는 빌드 명령어
Original file line number Diff line number Diff line change 1+ import { useState } from "react" ;
12import { useNavigate } from "react-router-dom" ;
3+ import ActionConfirmModal from "@/components/modal/ActionConfirmModal" ;
4+ import useAuthStore from "@/store/useAuthStore" ;
25
36const 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} ;
Original file line number Diff line number Diff line change 1+ import { useState } from "react" ;
12import { useNavigate } from "react-router-dom" ;
3+ import ActionConfirmModal from "@/components/modal/ActionConfirmModal" ;
4+ import useAuthStore from "@/store/useAuthStore" ;
25
36const SubTitle = ( { mode } : { mode : "빠른대화" | "친구목록" } ) => {
7+ const [ needLoginModalIsOpen , setNeedLoginModalIsOpen ] = useState ( false ) ;
8+ const { isLoggedIn } = useAuthStore ( ) ;
49 const navigate = useNavigate ( ) ;
510
611 const titleList = {
@@ -15,8 +20,10 @@ const SubTitle = ({ mode }: { mode: "빠른대화" | "친구목록" }) => {
1520 } ;
1621
1722 const handleNavigate = ( ) => {
18- const type = mode === "빠른대화" ? "fastFriend" : "virtualFriend" ;
19- navigate ( "/select-info" , { state : { type : type } } ) ;
23+ if ( isLoggedIn ) {
24+ const type = mode === "빠른대화" ? "fastFriend" : "virtualFriend" ;
25+ navigate ( "/select-info" , { state : { type : type } } ) ;
26+ } else setNeedLoginModalIsOpen ( true ) ;
2027 } ;
2128
2229 return (
@@ -37,6 +44,16 @@ const SubTitle = ({ mode }: { mode: "빠른대화" | "친구목록" }) => {
3744 />
3845 </ button >
3946 ) }
47+ { needLoginModalIsOpen && (
48+ < ActionConfirmModal
49+ title = "로그인이 필요합니다."
50+ message = { [ `로그인 페이지로\n이동할까요?` ] }
51+ cancelText = "취소"
52+ confirmText = "확인"
53+ onCancel = { ( ) => setNeedLoginModalIsOpen ( false ) }
54+ onConfirm = { ( ) => navigate ( "/login" ) }
55+ />
56+ ) }
4057 </ div >
4158 ) ;
4259} ;
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ const KakaoLoginButton = () => {
33 const kakaoRedirectUrl =
44 import . meta. env . MODE === "production"
55 ? import . meta. env . VITE_KAKAO_PRODUCTION_REDIRECT_URI
6- : import . meta. env . VITE_KAKAO_DEVELOP_REDIRECT_URI ;
6+ : import . meta. env . VITE_KAKAO_DEVELOPE_REDIRECT_URI ;
77
88 const kakaoURL = `https://kauth.kakao.com/oauth/authorize?client_id=${ kakaoRestApiKey } &redirect_uri=${ kakaoRedirectUrl } &response_type=code` ;
99
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments