File tree Expand file tree Collapse file tree 6 files changed +74
-11
lines changed
Expand file tree Collapse file tree 6 files changed +74
-11
lines changed Original file line number Diff line number Diff line change 44 push :
55 branches :
66 - main
7- - deploy
87 - deploy/*
9- - feat/SSD-133-포스트잇-예외-처리
108
119jobs :
1210 deploy :
4947 echo "MAIL_PASSWORD=${{ secrets.MAIL_PASSWORD }}" >> .env
5048 echo "TIME_PAPER_URL=${{ secrets.TIME_PAPER_URL }}" >> .env
5149 echo "ORIGIN=${{ secrets.ORIGIN }}" >> .env
50+ echo "VITE_KAKAO_API_KEY=${{ secrets.VITE_KAKAO_API_KEY }}" >> .env
5251
5352 - name : Add ssh-agent
5453 uses :
webfactory/[email protected]
Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ services:
6363 - type=local,src=/tmp/.build-cache/client
6464 args :
6565 VITE_API_URL : ${VITE_API_URL}
66+ VITE_KAKAO_API_KEY : ${VITE_KAKAO_API_KEY}
6667 image : yejinoh58/timepaper-client-image:latest
6768 env_file :
6869 - .env
Original file line number Diff line number Diff line change 11# 빌드 단계
22FROM node:23-alpine AS build
33
4- ARG VITE_API_URL
4+ ARG VITE_API_URL
5+ ARG VITE_KAKAO_API_KEY
56ENV VITE_API_URL=$VITE_API_URL
7+ ENV VITE_KAKAO_API_KEY=$VITE_KAKAO_API_KEY
68
79WORKDIR /app
810
Original file line number Diff line number Diff line change 44 < meta charset ="UTF-8 " />
55 < link rel ="icon " type ="image/svg+xml " href ="/vite.svg " />
66 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
7- < title > Vite + React</ title >
7+ < title > Timepaper</ title >
8+ < script
9+ src ="https://t1.kakaocdn.net/kakao_js_sdk/2.7.4/kakao.min.js "
10+ integrity ="sha384-DKYJZ8NLiK8MN4/C5P2dtSmLQ4KwPaoqAfyA/DfmEc1VDxu4yyC7wy6K1Hs90nka "
11+ crossorigin ="anonymous "
12+ > </ script >
813 </ head >
914 < body >
1015 < div id ="root "> </ div >
Original file line number Diff line number Diff line change 1+ import React , { useEffect } from 'react' ;
2+ import BottomButton from '../BottomButton/BottomButton' ;
3+
4+ export default function ShareLink ( { timepaperId } ) {
5+ const KAKAO_API_KEY = import . meta. env . VITE_KAKAO_API_KEY ;
6+ const realUrl = `https://43.201.24.13.sslip.io/timepaper/${ timepaperId } ` ;
7+
8+ useEffect ( ( ) => {
9+ if ( ! window . Kakao ) {
10+ console . error ( 'Kakao SDK 로드 안됨' ) ;
11+ return ;
12+ }
13+ if ( ! window . Kakao . isInitialized ( ) ) {
14+ window . Kakao . init ( KAKAO_API_KEY ) ;
15+ console . log ( 'Kakao 초기화:' , window . Kakao . isInitialized ( ) ) ;
16+ }
17+ } , [ ] ) ;
18+
19+ const shareKakao = ( ) => {
20+ if ( ! window . Kakao ) {
21+ console . error ( 'Kakao SDK 로드 안됨' ) ;
22+ return ;
23+ }
24+
25+ window . Kakao . Share . sendDefault ( {
26+ objectType : 'feed' ,
27+ content : {
28+ title : '친구에게서 타임페이퍼가 왔어요💕' ,
29+ description : '' ,
30+ imageUrl : `https://43.201.24.13.sslip.io/assets/timepaperLogo-0WzOUFBd.png` ,
31+ link : {
32+ mobileWebUrl : realUrl ,
33+ webUrl : realUrl ,
34+ } ,
35+ } ,
36+ buttons : [
37+ {
38+ title : '친구가 전달한 타임페이퍼로 🚀' ,
39+ link : {
40+ mobileWebUrl : realUrl ,
41+ webUrl : realUrl ,
42+ } ,
43+ } ,
44+ ] ,
45+ } ) ;
46+ } ;
47+ return (
48+ < >
49+ < BottomButton onClick = { shareKakao } title = { `공유하기` } isEnable = { true } > </ BottomButton >
50+ </ >
51+ ) ;
52+ }
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import ConfirmModal from '../../components/confirmmodal/ConfirmModal';
99import Modal from '../../components/Modal/Modal' ;
1010import { finishLoading , startLoading } from '../../store/slices/loadingSlice' ;
1111import Alert from '../../components/Alert/Alert' ;
12+ import ShareLink from '../../components/share-link/ShareLink' ;
1213
1314export default function TimePaperDetail ( ) {
1415 const { timepaperId } = useParams ( ) ;
@@ -45,7 +46,7 @@ export default function TimePaperDetail() {
4546 if ( timePaperResponse && timePaperResponse . data && timePaperResponse . data . data ) {
4647 const timePaperData = timePaperResponse . data . data ;
4748 if ( timePaperData . locked ) {
48- navigate ( `/timepaper/${ timepaperId } /lock` , { replace : true } ) ;
49+ navigate ( `/timepaper/${ timepaperId } /lock` , { replace : true } ) ;
4950 return ;
5051 }
5152
@@ -234,12 +235,15 @@ export default function TimePaperDetail() {
234235 ) }
235236 </ div >
236237 ) }
237- < BottomButton
238- title = "포스트잇 작성"
239- onClick = { handlePostItCreateClick }
240- isEnable = { true }
241- className = { styles . postitCreate }
242- />
238+ < div className = { styles . buttonGroup } >
239+ < ShareLink timepaperId = { timepaperId } > </ ShareLink >
240+ < BottomButton
241+ title = "포스트잇 작성"
242+ onClick = { handlePostItCreateClick }
243+ isEnable = { true }
244+ className = { styles . postitCreate }
245+ />
246+ </ div >
243247 </ div >
244248 </ div >
245249 </ div >
You can’t perform that action at this time.
0 commit comments