Skip to content
Merged
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
35 changes: 35 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy to AIT

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build project
run: npm run build:prod

- name: Setup AIT token
run: |
npx ait token add ${{ secrets.AIT_TOKEN }}
env:
AIT_TOKEN: ${{ secrets.AIT_TOKEN }}

- name: Deploy to AIT
run: npm run deploy
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ dist-ssr

.env
.env.development
.env.remote
.env.production
.env.remote
.granite
*.ait
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
### 하루 한 줄 (앱인토스)
### 오늘 한 줄 (앱인토스)
4 changes: 2 additions & 2 deletions granite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { defineConfig } from '@apps-in-toss/web-framework/config';
export default defineConfig({
appName: 'wq-dayline',
brand: {
displayName: '하루 한 줄', // 화면에 노출될 앱의 한글 이름으로 바꿔주세요.
displayName: '오늘 한 줄', // 화면에 노출될 앱의 한글 이름으로 바꿔주세요.
primaryColor: '#3182F6', // 화면에 노출될 앱의 기본 색상으로 바꿔주세요.
icon: 'src/assets/dayline_light_logo.png', // 화면에 노출될 앱의 아이콘 이미지 주소로 바꿔주세요.
icon: 'https://static.toss.im/appsintoss/8211/1dafb690-4251-4735-bfe6-a9a663ba860e.png', // 화면에 노출될 앱의 아이콘 이미지 주소로 바꿔주세요.
bridgeColorMode: 'basic',
},
web: {
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="src/assets/dayline_light_logo.png" />
<link rel="icon" type="image/png" href="/dayline_light_logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>dayline</title>
</head>
Expand Down
1 change: 0 additions & 1 deletion public/vite.svg

This file was deleted.

1 change: 0 additions & 1 deletion src/assets/react.svg

This file was deleted.

21 changes: 6 additions & 15 deletions src/components/stats/StatsDetailView.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ListHeader, Text } from '@toss/tds-mobile';
import { adaptive, colors } from '@toss/tds-colors';
import { ListHeader, Text, Badge } from '@toss/tds-mobile';
import { adaptive } from '@toss/tds-colors';
import type { DiaryEntry } from '../../types/diary';

interface StatsDetailViewProps {
Expand Down Expand Up @@ -31,7 +31,7 @@ export const StatsDetailView = ({ entry, selectedDate }: StatsDetailViewProps) =
<ListHeader.TitleParagraph
color={adaptive.grey800}
fontWeight="bold"
typography="t4"
typography="t5"
>
{formattedDate} 한 줄
</ListHeader.TitleParagraph>
Expand All @@ -41,18 +41,9 @@ export const StatsDetailView = ({ entry, selectedDate }: StatsDetailViewProps) =
/>

<div style={{ marginBottom: '16px', display: 'flex' , padding: '0 24px'}}>
{/* Badge 컴포넌트가 예상대로 렌더링되지 않는 경우를 대비한 스타일 오버라이드 */}
<div style={{
backgroundColor: colors.blue100,
borderRadius: '6px',
padding: '4px 8px',
display: 'inline-flex',
alignItems: 'center',
}}>
<Text typography="t6" fontWeight="medium" color={colors.blue500}>
+ {entry.score}
</Text>
</div>
<Badge variant="weak" color="blue" size="medium">
+ {entry.score}
</Badge>
</div>

<Text
Expand Down
10 changes: 10 additions & 0 deletions src/hooks/domain/auth/useLogin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ export const useLogin = () => {
: '로그인에 실패했습니다. 다시 시도해주세요.';

alert(errorMessage);

// [디버깅] 상세 에러 정보
// if (error instanceof Error) {
// alert(`[에러]\n${error.message}\n\n[Stack]\n${error.stack?.slice(0, 200) || 'No stack'}`);
// } else if (typeof error === 'object' && error !== null) {
// alert(`[에러 객체]\n${JSON.stringify(error, null, 2)}`);
// } else {
// alert(`[알 수 없는 에러]\n${String(error)}`);
// }
} finally {
setIsLoading(false);
}
Expand All @@ -34,3 +43,4 @@ export const useLogin = () => {
return { handleLogin, isLoading };
};


2 changes: 1 addition & 1 deletion src/hooks/domain/diary/useDiarySubmit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const useDiarySubmit = ({ trimmedValue, hasTodayDiary }: UseDiarySubmitPr

// 광고 훅 사용
const { showAd } = useAdMob({
adGroupId: 'ait-ad-test-interstitial-id',
adGroupId: 'ait.v2.live.8be900a4b263458c',
shouldLoad: !hasTodayDiary // 이미 작성했다면 광고 로드 안 함
});

Expand Down
4 changes: 2 additions & 2 deletions src/pages/IntroPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function Page() {
<div style={{ display: 'flex', flexDirection: 'column', gap: '32px' }}>
<Post.H2 paddingBottom={24} color={adaptive.grey800} aria-label="앱 설명">
<div style={{ whiteSpace: 'nowrap' }}>
<Paragraph.Text>하루 한 줄로 감정을 돌아보세요</Paragraph.Text>
<Paragraph.Text>오늘 한 줄로 감정을 돌아보세요</Paragraph.Text>
</div>
</Post.H2>
<div>
Expand Down Expand Up @@ -71,7 +71,7 @@ export default function Page() {
/>
</div>
}
hideLine={false}
hideLine={true}
/>
</Stepper>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/StatsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ export default function Page() {
</div>

{/* 탭 하단 구분선 - 스타일 명확화 */}
<div style={{
{/* <div style={{
height: '1px',
backgroundColor: '#e5e8eb', // adaptive.grey200과 유사한 명시적 색상 (안전장치)
width: '100%',
minHeight: '1px' // 최소 높이 보장
}} />
}} /> */}

<div>
<ListHeader
Expand Down
38 changes: 32 additions & 6 deletions src/services/tossAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,27 @@ export async function loginToBackend(
// Response 헤더를 확인하기 위해 fetch를 직접 사용
// apiRequest는 헤더 접근이 제한되므로 여기서는 fetch 직접 사용 유지
const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || '/dayline/api';
const response = await fetch(`${API_BASE_URL}/v1/auth/toss/login`, {
const fullUrl = `${API_BASE_URL}/v1/auth/toss/login`;

// [디버깅] 요청 정보 확인
// alert(`[백엔드 요청 시작]\nURL: ${fullUrl}\nMethod: POST\nReferrer: ${referrer}`);

const response = await fetch(fullUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(requestBody),
});

// [디버깅] 응답 상태 확인
// alert(`[백엔드 응답]\nStatus: ${response.status}\nStatusText: ${response.statusText}\nOK: ${response.ok}`);

if (!response.ok) {
const errorText = await response.text();
// [DEBUG] 백엔드 에러 내용 확인 (테스트 후 삭제 필요)
// alert(`[Step 2 실패] 백엔드 응답 에러 (${response.status})\n${errorText.slice(0, 100)}`);

// [디버깅] 백엔드 에러 내용 확인
// alert(`[백엔드 에러]\nStatus: ${response.status}\nError: ${errorText.slice(0, 200)}`);

let message = '로그인에 실패했습니다.';
try {
Expand Down Expand Up @@ -147,6 +156,14 @@ export async function loginToBackend(

} catch (error) {
console.error('[Step 2] 로그인 API 요청 실패:', error);

// [디버깅] Fetch 에러 상세 정보
// if (error instanceof TypeError) {
// alert(`[Fetch 에러]\nTypeError: ${error.message}\n\n네트워크 연결 실패 또는 CORS 문제일 수 있습니다.`);
// } else if (error instanceof Error) {
// alert(`[에러 상세]\nName: ${error.name}\nMessage: ${error.message}`);
// }

throw error;
}
}
Expand All @@ -159,22 +176,31 @@ export async function loginWithToss() {

try {
// 1. 인가 코드 획득
// alert('[Step 1] 인가 코드 받기 시작...');
const { authorizationCode, referrer } = await getTossAuthorizationCode();

// [DEBUG] 모바일 디버깅용 알림 (테스트 후 삭제 필요)
// alert(`[Step 1 성공] 인가코드 획득\nCode: ${authorizationCode.slice(0, 10)}...\nReferrer: ${referrer}`);
// [디버깅] 인가 코드 획득 성공
// alert(`[Step 1 성공]\nCode: ${authorizationCode.slice(0, 20)}...\nReferrer: ${referrer}`);

// 2. 백엔드 로그인
// alert('[Step 2] 백엔드 로그인 시작...');
const userKey = await loginToBackend(authorizationCode, referrer);

// 3. UserKey 저장
saveUserKey(userKey);
console.log('UserKey 저장 완료:', userKey);

// alert(`[로그인 성공!]\nUserKey: ${userKey}`);
console.log('로그인 완료!');
return userKey;
} catch (error) {
console.error('로로그인 프로세스 중단:', error);
console.error('로그인 프로세스 중단:', error);

// [디버깅] 로그인 플로우 실패
// if (error instanceof Error) {
// alert(`[로그인 플로우 실패]\n${error.message}`);
// }

throw error;
}
}
Expand Down