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
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
EXPO_PUBLIC_KAKAO_REST_API_KEY=fcc79e9199b5dbcaedfc00bb30b3d4af
EXPO_PUBLIC_SERVER_BASE_URL=https://api.dailysnap.app
4 changes: 3 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ node_modules
android
ios
build
dist
dist
tailwind.config.js
app.config.js
10 changes: 10 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ module.exports = {
"prettier/prettier": "error",
"react/react-in-jsx-scope": "off",
"@typescript-eslint/consistent-type-imports": "error",
"import/namespace": "off",
"import/no-unresolved": "off",
},
parser: "@typescript-eslint/parser",
parserOptions: {
Expand All @@ -27,4 +29,12 @@ module.exports = {
ecmaVersion: "latest",
sourceType: "module",
},
settings: {
"import/resolver": {
node: {
extensions: [".js", ".jsx", ".ts", ".tsx"],
},
typescript: false,
},
},
};
6 changes: 3 additions & 3 deletions .github/workflows/DAILYSNAP-FE-PR-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 22.14.0
cache: "npm"

- name: 📦 Install dependencies
run: npm install
Expand All @@ -33,5 +32,6 @@ jobs:
- name: ✅ Lint Check
run: npm run lint

- name: 🔍 TypeScript Check
run: npx tsc --noEmit
# TypeScript 검사 비활성화. TODO: 추후 활성화
# - name: 🔍 TypeScript Check
# run: npx tsc --noEmit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# dependencies
node_modules/
yarn.lock

# Expo
.expo/
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ node_modules
android
ios
build
dist
dist
37 changes: 37 additions & 0 deletions app.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
export default {
expo: {
name: "DailySnap-FE",
slug: "DailySnap-FE",
version: "1.0.0",
orientation: "portrait",
scheme: "dailysnap",
userInterfaceStyle: "light",
newArchEnabled: true,
splash: {
resizeMode: "contain",
backgroundColor: "#ffffff"
},
ios: {
supportsTablet: true,
bundleIdentifier: "com.jhsonny.DailySnapFE"
},
android: {
adaptiveIcon: {
backgroundColor: "#ffffff"
},
package: "com.jhsonny.DailySnapFE"
},
web: {
bundler: "metro",
output: "static",
favicon: "./assets/images/favicon.png"
},
plugins: [
"expo-router",
"expo-font"
],
experiments: {
typedRoutes: true
}
}
};
34 changes: 0 additions & 34 deletions app.json

This file was deleted.

46 changes: 46 additions & 0 deletions app/(tabs)/_layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { Tabs } from "expo-router";

export default function TabsLayout() {
return (
<Tabs
screenOptions={{
headerShown: false,
}}
>
<Tabs.Screen
name="home"
options={{
title: "홈",
}}
/>

<Tabs.Screen
name="archive"
options={{
title: "아카이브",
}}
/>

<Tabs.Screen
name="upload"
options={{
title: "업로드",
}}
/>

<Tabs.Screen
name="awards"
options={{
title: "우수작",
}}
/>

<Tabs.Screen
name="profile"
options={{
title: "마이",
}}
/>
</Tabs>
);
}
6 changes: 6 additions & 0 deletions app/(tabs)/archive.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from "react";
import ArchivePage from "../../pages/archive/ArchivePage";

export default function ArchiveTab() {
return <ArchivePage />;
}
6 changes: 6 additions & 0 deletions app/(tabs)/awards.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from "react";
import AwardsPage from "../../pages/awards/AwardsPage";

export default function AwardsTab() {
return <AwardsPage />;
}
6 changes: 6 additions & 0 deletions app/(tabs)/home.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from "react";
import HomePage from "../../pages/home/HomePage";

export default function HomeTab() {
return <HomePage />;
}
6 changes: 6 additions & 0 deletions app/(tabs)/profile.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from "react";
import ProfilePage from "../../pages/profile/ProfilePage";

export default function ProfileTab() {
return <ProfilePage />;
}
6 changes: 6 additions & 0 deletions app/(tabs)/upload.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from "react";
import UploadPage from "../../pages/upload/UploadPage";

export default function UploadTab() {
return <UploadPage />;
}
26 changes: 21 additions & 5 deletions app/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,36 @@
import NetInfo from "@react-native-community/netinfo";
import { onlineManager, QueryClientProvider } from "@tanstack/react-query";
import { Stack } from "expo-router";
import { StatusBar } from "expo-status-bar";
import { SafeAreaProvider } from "react-native-safe-area-context";
import { queryClient } from "../shared/api/query-client";
import { AuthProvider } from "../features/auth/model/AuthContext";
import "../global.css";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Move global CSS import to the top of the file.

Global CSS imports should be placed before other imports to ensure styles are loaded first and avoid potential timing issues.

+import "../global.css";
 import NetInfo from "@react-native-community/netinfo";
 import { onlineManager, QueryClientProvider } from "@tanstack/react-query";
 import { Stack } from "expo-router";
 import { StatusBar } from "expo-status-bar";
 import { SafeAreaProvider } from "react-native-safe-area-context";
 import { queryClient } from "../shared/api/query-client";
 import { AuthProvider } from "../features/auth/model/AuthContext";
-import "../global.css";
🤖 Prompt for AI Agents
In app/_layout.tsx at line 8, move the import statement for "../global.css" to
the very top of the file before any other imports to ensure global styles are
loaded first and prevent timing issues.


onlineManager.setEventListener(setOnline => {
return NetInfo.addEventListener(state => {
setOnline(!!state.isConnected);
});
});

export { default as styled } from "nativewind";

export default function RootLayout() {
return (
<QueryClientProvider client={queryClient}>
<Stack>
<Stack.Screen name="index" />
</Stack>
</QueryClientProvider>
<SafeAreaProvider>
<QueryClientProvider client={queryClient}>
<AuthProvider>
<StatusBar style="auto" />
<Stack screenOptions={{ headerShown: false }}>
{/* 인증 관련 스크린 */}
<Stack.Screen name="index" />
<Stack.Screen name="login" />

{/* 메인 앱 스크린 */}
<Stack.Screen name="(tabs)" />
</Stack>
</AuthProvider>
</QueryClientProvider>
</SafeAreaProvider>
);
}
32 changes: 26 additions & 6 deletions app/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
import { SafeAreaView, ScrollView, Text } from "react-native";
/*eslint-disable */
import React, { useEffect } from "react";
import { useRouter } from "expo-router";
import { useAuth } from "../features/auth/model/AuthContext";
import { View, ActivityIndicator } from "react-native";

export default function App() {
const router = useRouter();
const { userInfo } = useAuth();

useEffect(() => {
const timer = setTimeout(() => {
if (userInfo) {
// 로그인된 사용자면, 홈 네비게이션으로 이동
router.replace("/(tabs)/home");
} else {
// 로그인되지 않았으면 로그인 페이지로 이동
router.replace("/login");
}
}, 100);

return () => clearTimeout(timer);
}, [userInfo, router]);

// 로딩 화면 표시. TODO: 추후에 디자인 된 로딩스피너로 수정
return (
<SafeAreaView style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
<ScrollView style={{ width: "100%", paddingHorizontal: 16 }}>
<Text>App.tsx to start working on your app!</Text>
</ScrollView>
</SafeAreaView>
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<ActivityIndicator size="large" color="#195B35" />
</View>
);
}
6 changes: 6 additions & 0 deletions app/login.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from "react";
import LoginPage from "../pages/auth/LoginPage";

export default function Login() {
return <LoginPage />;
}
9 changes: 0 additions & 9 deletions app/login/index.tsx

This file was deleted.

19 changes: 19 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = function (api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
plugins: [
'nativewind/babel',
[
'module-resolver',
{
root: ['./'],
extensions: ['.ios.js', '.android.js', '.js', '.ts', '.tsx', '.json'],
alias: {
'@': './',
},
},
],
],
};
};
3 changes: 0 additions & 3 deletions features/auth/hooks/useLogin.ts

This file was deleted.

Loading