diff --git a/App.tsx b/App.tsx
index 5ff2096..9285517 100644
--- a/App.tsx
+++ b/App.tsx
@@ -6,7 +6,7 @@
*/
import React from 'react';
-import Login from './src/app/Login/page';
+import Login from './src/app/login/page';
import {NavigationContainer} from '@react-navigation/native';
import {createNativeStackNavigator} from '@react-navigation/native-stack';
import Community from './src/app/community/page';
@@ -18,12 +18,16 @@ import Write from './src/app/review/Write';
import KeywordReview from './src/app/review/KeywordReview';
import Search from './src/app/search/page';
import NavBar from './src/components/NavBar';
-import Signup from './src/app/Signup/page';
+import Signup from './src/app/signup/page';
import QandADetail from './src/app/review/QandADetail';
import Question from './src/app/review/Question';
import QueryProvider from './src/utils/query/Provider';
import ReduxProvider from './src/utils/store/Provider';
import MyPage from './src/app/mypage/page';
+import BookmarkSchool from './src/app/mypage/BookmarkSchool';
+import WritePost from './src/app/mypage/WritePost';
+import LikePost from './src/app/mypage/LikePost';
+import Setting from '@/app/mypage/Setting';
function App(): React.JSX.Element {
const Stack = createNativeStackNavigator();
@@ -33,7 +37,7 @@ function App(): React.JSX.Element {
+ initialRouteName="Login">
@@ -47,6 +51,10 @@ function App(): React.JSX.Element {
+
+
+
+
diff --git a/android/app/build.gradle b/android/app/build.gradle
index 52f4e15..f83dac3 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -6,6 +6,10 @@ apply plugin: "com.facebook.react"
* This is the configuration block to customize your React Native Android app.
* By default you don't need to apply any configuration, just uncomment the lines you need.
*/
+project.ext.react = [
+ enableHermes: true // Set to true to enable Hermes
+]
+
react {
/* Folders */
// The root of your project, i.e. where "package.json" lives. Default is '..'
@@ -69,6 +73,7 @@ def enableProguardInReleaseBuilds = false
*/
def jscFlavor = 'org.webkit:android-jsc:+'
+
android {
ndkVersion rootProject.ext.ndkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
diff --git a/babel.config.js b/babel.config.js
index 02c7d13..254490e 100644
--- a/babel.config.js
+++ b/babel.config.js
@@ -1,4 +1,15 @@
module.exports = {
presets: ['module:@react-native/babel-preset'],
- plugins: ['react-native-reanimated/plugin'],
+ plugins: [
+ [
+ 'module-resolver',
+ {
+ root: ['./src'],
+ alias: {
+ '@components': './src/components',
+ '@': './src',
+ },
+ },
+ ],
+ ],
};
diff --git a/package.json b/package.json
index a4f0237..af44af5 100644
--- a/package.json
+++ b/package.json
@@ -10,6 +10,7 @@
"test": "jest"
},
"dependencies": {
+ "@react-native-async-storage/async-storage": "^2.0.0",
"@react-native-community/viewpager": "^5.0.11",
"@react-navigation/bottom-tabs": "^6.5.20",
"@react-navigation/material-top-tabs": "^6.6.13",
@@ -22,7 +23,6 @@
"@types/redux-logger": "^3.0.13",
"@types/styled-components": "^5.1.34",
"axios": "^1.7.7",
- "babel-plugin-module-resolver": "^5.0.2",
"missing-asset-registry-path": "^0.0.0",
"react": "18.2.0",
"react-hook-form": "^7.53.0",
@@ -59,6 +59,7 @@
"@types/react": "^18.2.6",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.6.3",
+ "babel-plugin-module-resolver": "^5.0.2",
"eslint": "^8.19.0",
"jest": "^29.6.3",
"metro-config": "^0.80.9",
diff --git a/src/apis/cookie.ts b/src/apis/cookie.ts
index e69de29..a9a9a8a 100644
--- a/src/apis/cookie.ts
+++ b/src/apis/cookie.ts
@@ -0,0 +1,9 @@
+import {instance} from './axios';
+
+export const applyToken = (jwt: string) => {
+ instance.defaults.headers.Authorization = `Bearer ${jwt}`;
+};
+
+export const clearToken = () => {
+ instance.defaults.headers.Authorization = '';
+};
diff --git a/src/apis/mypage.ts b/src/apis/mypage.ts
new file mode 100644
index 0000000..26d9dc4
--- /dev/null
+++ b/src/apis/mypage.ts
@@ -0,0 +1,31 @@
+import {instance} from './axios';
+
+interface MypageInfo {
+ name: string;
+ enrolled_school: number;
+ image?: string;
+}
+
+export const editMypage = async (mypageInfo: MypageInfo) => {
+ try {
+ const response = await instance.patch('/user/modify', {
+ name: mypageInfo.name,
+ enrolled_school: mypageInfo.enrolled_school,
+ ...(mypageInfo.image && {image: mypageInfo.image}),
+ });
+ return response.data;
+ } catch (error) {
+ console.error('마이페이지 수정 오류:', error);
+ throw error;
+ }
+};
+
+export const getMypage = async () => {
+ try {
+ const response = await instance.get('/user/my');
+ return response.data;
+ } catch (error) {
+ console.error('마이페이지 조회 오류:', error);
+ throw error;
+ }
+};
diff --git a/src/apis/user.ts b/src/apis/user.ts
index ba03030..4ff2a7b 100644
--- a/src/apis/user.ts
+++ b/src/apis/user.ts
@@ -1,4 +1,8 @@
import {instance} from './axios';
+import {useNavigation} from '@react-navigation/native';
+import {StackNavigationProp} from '@react-navigation/stack';
+import AsyncStorage from '@react-native-async-storage/async-storage';
+import {Alert} from 'react-native';
interface SignupData {
id: string;
@@ -18,35 +22,52 @@ interface ApiResponse {
data: T;
}
-// export const login = async (data: LoginData): Promise> => {
-// try {
-// const response = await axios.post>(``, data);
-// return response.data;
-// } catch (error: any) {
-// if (axios.isAxiosError(error)) {
-// console.error('axios 에러:', error.response?.data);
-// }
-// return {
-// success: false,
-// message: error.response?.data.message || '로그인 실패',
-// data: null,
-// };
-// }
-// };
-const auth = '/user';
-
-export const postSignup = async (data: SignupData) => {
- return await instance
- .post(`${auth}/signup`, {
+const navigation = useNavigation>();
+
+export const signupHandler = async (data: SignupData) => {
+ try {
+ const response = await instance.post(`/user/signup`, {
account_id: data.id,
name: data.name,
password: data.password,
enrolled_school: data.schoolId,
- })
- .then()
- .catch(err => {
- console.error(err);
});
+ } catch (error) {
+ console.log(error);
+ Alert.alert('아이디 또는 비밀번호를 잘못 입력했습니다.');
+ }
+};
+
+export const loginHandler = async (data: LoginData, navigation: any) => {
+ try {
+ const response = await instance.post(`/user/login`, {
+ account_id: data.id,
+ password: data.password,
+ });
+
+ await AsyncStorage.setItem('AccessToken', response.data.accessToken);
+ await AsyncStorage.setItem('RefreshToken', response.data.refreshToken);
+ navigation.navigate('NavBar');
+ } catch (error) {
+ console.error(error);
+ Alert.alert('로그인 오류', '로그인이 실패했습니다.');
+ }
};
-export const postLogin = () => {};
+export const checkDuplicationId = async (data: any) => {
+ try {
+ const response = await instance.get(`/user/check`);
+ return response.data;
+ } catch (error) {
+ console.error(error);
+ }
+};
+
+export const logoutHandler = async () => {
+ try {
+ AsyncStorage.clear();
+ navigation.navigate('Login');
+ } catch (error) {
+ console.error(error);
+ }
+};
diff --git a/src/app/community/AddTag.tsx b/src/app/community/AddTag.tsx
index 00f5dbe..486a111 100644
--- a/src/app/community/AddTag.tsx
+++ b/src/app/community/AddTag.tsx
@@ -4,7 +4,7 @@ import {TopBar, Input} from '../../components';
import {Arrow, Close, Plus} from '../../assets';
import {TouchableOpacity} from 'react-native';
import {useNavigation} from '@react-navigation/native';
-import {color, Font} from '../../styles';
+import {color, Font} from '@/styles';
import {StackNavigationProp} from '@react-navigation/stack';
function AddTag() {
diff --git a/src/app/community/EditPost.tsx b/src/app/community/EditPost.tsx
index 872132b..bb94dfd 100644
--- a/src/app/community/EditPost.tsx
+++ b/src/app/community/EditPost.tsx
@@ -1,8 +1,7 @@
import React, {useState} from 'react';
import styled from 'styled-components/native';
import {TopBar} from '../../components/TopBar';
-import {Font} from '../../styles/font';
-import {color} from '../../styles/color';
+import {Font, color} from '@/styles';
import ToggleButton from '../../components/ToggleButton';
import {Image, Close} from '../../assets';
import {useNavigation} from '@react-navigation/native';
diff --git a/src/app/community/InputComment.tsx b/src/app/community/InputComment.tsx
index cef1790..9525042 100644
--- a/src/app/community/InputComment.tsx
+++ b/src/app/community/InputComment.tsx
@@ -1,7 +1,7 @@
import React, {useState} from 'react';
import {Dimensions} from 'react-native';
import styled from 'styled-components/native';
-import {color} from '../../styles/color';
+import {color} from '@/styles';
import {Heart} from '../../assets';
function InputComment() {
diff --git a/src/app/community/Post.tsx b/src/app/community/Post.tsx
index f92c640..db4a115 100644
--- a/src/app/community/Post.tsx
+++ b/src/app/community/Post.tsx
@@ -3,8 +3,7 @@ import styled from 'styled-components/native';
import {TopBar} from '../../components/TopBar';
import {Arrow, Menu} from '../../assets';
import {useNavigation} from '@react-navigation/native';
-import {Font} from '../../styles/font';
-import {color} from '../../styles/color';
+import {Font, color} from '@/styles';
import Tag from '../../components/Tag';
import Comment from '../../components/community/Comment';
import InputComment from './InputComment';
diff --git a/src/app/community/page.tsx b/src/app/community/page.tsx
index 0b251ad..fe7d4a5 100644
--- a/src/app/community/page.tsx
+++ b/src/app/community/page.tsx
@@ -1,9 +1,8 @@
import React, {useState} from 'react';
import {Dimensions} from 'react-native';
import styled from 'styled-components/native';
-import {Font} from '../../styles/font';
+import {Font, color} from '@/styles';
import {Arrow, Blank, Edit} from '../../assets';
-import {color} from '../../styles/color';
import {ContentCard} from '../../components/ContentCard';
import {useNavigation} from '@react-navigation/native';
import {StackNavigationProp} from '@react-navigation/stack';
diff --git a/src/app/dummy/schoolList.ts b/src/app/dummy/schoolList.ts
index a5f94e8..9b17cb7 100644
--- a/src/app/dummy/schoolList.ts
+++ b/src/app/dummy/schoolList.ts
@@ -1,6 +1,6 @@
import {SchoolListType} from '../../interfaces';
-export const schoolList: SchoolListType[] = [
+export const schoolList = [
{name: '대구대덕초등학교', location: '대구 남구'},
{name: '대덕초등학교', location: '대전 유성구 궁동'},
{name: '용인대덕초등학교', location: '경인 용인시 수지구'},
diff --git a/src/app/dummy/searchSchool.ts b/src/app/dummy/searchSchool.ts
index e94a696..9da3b1c 100644
--- a/src/app/dummy/searchSchool.ts
+++ b/src/app/dummy/searchSchool.ts
@@ -1,10 +1,68 @@
export const searchSchool = [
- {schoolName: "대구대덕초등학교", address: "대구 남구", score: 5, reviewCount : 128},
- {schoolName: "대덕초등학교", address: "대구 남구", score: 5, reviewCount : 3},
- {schoolName: "대덕소프트웨어마이스터초등학교", address: "대구 남구", score: 5, reviewCount : 128},
- {schoolName: "용인대덕초등학교", address: "대구 남구", score: 5, reviewCount : 128},
- {schoolName: "대마초등학교", address: "대구 남구", score: 5, reviewCount : 128},
- {schoolName: "대구대덕초등학교", address: "대구 남구", score: 5, reviewCount : 128},
- {schoolName: "대구대덕초등학교", address: "대구 남구", score: 5, reviewCount : 128},
- {schoolName: "대구대덕초등학교", address: "대구 남구", score: 5, reviewCount : 128},
-]
\ No newline at end of file
+ {
+ schoolName: '대구대덕초등학교',
+ address: '대구 남구',
+ score: 5,
+ reviewCount: 128,
+ },
+ {
+ schoolName: '대덕초등학교',
+ address: '대구 남구',
+ score: 3.6,
+ reviewCount: 3,
+ },
+ {
+ schoolName: '대덕소프트웨어마이스터고등학교',
+ address: '대구 남구',
+ score: 1.345,
+ reviewCount: 128,
+ },
+ {
+ schoolName: '용인대덕초등학교',
+ address: '대구 남구',
+ score: 5,
+ reviewCount: 128,
+ },
+ {
+ schoolName: '대마중학교',
+ address: '대구 남구',
+ score: 5,
+ reviewCount: 128,
+ },
+ {
+ schoolName: '대구대덕초등학교',
+ address: '대구 남구',
+ score: 5,
+ reviewCount: 128,
+ },
+ {
+ schoolName: '대구대덕초등학교',
+ address: '대구 남구',
+ score: 5,
+ reviewCount: 128,
+ },
+ {
+ schoolName: '대구대덕초등학교',
+ address: '대구 남구',
+ score: 5,
+ reviewCount: 45,
+ },
+ {
+ schoolName: '대구대덕초등학교',
+ address: '대구 남구',
+ score: 5,
+ reviewCount: 128,
+ },
+ {
+ schoolName: '대구대덕초등학교',
+ address: '대구 남구',
+ score: 5,
+ reviewCount: 128,
+ },
+ {
+ schoolName: '대덕대학교',
+ address: '대구 남구',
+ score: 5,
+ reviewCount: 45,
+ },
+];
diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx
index 2631a12..0efeb47 100644
--- a/src/app/login/page.tsx
+++ b/src/app/login/page.tsx
@@ -3,10 +3,13 @@ import {useNavigation} from '@react-navigation/native';
import styled from 'styled-components/native';
import {Logo} from '../../assets';
import {Button, Input} from '../../components';
-import {Font, color} from '../../styles';
+import {Font, color} from '@/styles';
import {StackNavigationProp} from '@react-navigation/stack';
import {Controller, useForm} from 'react-hook-form';
import {Alert} from 'react-native';
+import {loginHandler} from '@/apis/user';
+import AsyncStorage from '@react-native-async-storage/async-storage';
+import {instance} from '@/apis/axios';
function Login() {
const navigation = useNavigation>();
@@ -21,11 +24,28 @@ function Login() {
},
});
- const onLoginPress = (data: {id: string; password: string}) => {
- if (data.id === 'hamster' && data.password === 'hamster@123') {
+ // const onLoginPress = (data: {id: string; password: string}) => {
+ // loginHandler(data, navigation);
+ // };
+
+ const loginHandler = async (
+ data: {id: string; password: string},
+ navigation: any,
+ ) => {
+ try {
+ const deviceToken = await AsyncStorage.getItem('deviceToken'); // Assuming you store the token
+ const response = await instance.post(`/user/login`, {
+ account_id: data.id,
+ password: data.password,
+ device_token: deviceToken, // Include the device token in the payload
+ });
+
+ await AsyncStorage.setItem('AccessToken', response.data.accessToken);
+ await AsyncStorage.setItem('RefreshToken', response.data.refreshToken);
navigation.navigate('NavBar');
- } else {
- Alert.alert('아이디 또는 비밀번호를 잘못 입력했습니다.');
+ } catch (error) {
+ console.error('로그인 에러:', error);
+ Alert.alert('로그인 오류', '로그인이 실패했습니다.');
}
};
@@ -65,7 +85,7 @@ function Login() {
/>
-
+
navigation.navigate('Signup')}>
diff --git a/src/app/main/Carousel.tsx b/src/app/main/Carousel.tsx
index e168df2..cb7545a 100644
--- a/src/app/main/Carousel.tsx
+++ b/src/app/main/Carousel.tsx
@@ -1,6 +1,6 @@
import React from 'react';
import styled from 'styled-components/native';
-import {color, Font} from '../../styles';
+import {color, Font} from '@/styles';
import {Arrow} from '../../assets';
import {useNavigation} from '@react-navigation/native';
import {StackNavigationProp} from '@react-navigation/stack';
diff --git a/src/app/main/page.tsx b/src/app/main/page.tsx
index ed08f97..a7bfdb6 100644
--- a/src/app/main/page.tsx
+++ b/src/app/main/page.tsx
@@ -1,7 +1,7 @@
import React from 'react';
import styled from 'styled-components/native';
import Header from '../../components/main/Header';
-import {color, Font} from '../../styles';
+import {color, Font} from '@/styles';
import {Arrow} from '../../assets';
import EventCard from '../../components/main/EventCard';
import ReviewCard from '../../components/main/ReviewCard';
diff --git a/src/app/mypage/BookmarkSchool.tsx b/src/app/mypage/BookmarkSchool.tsx
new file mode 100644
index 0000000..161fc8e
--- /dev/null
+++ b/src/app/mypage/BookmarkSchool.tsx
@@ -0,0 +1,104 @@
+import styled from 'styled-components/native';
+import SchoolCard from '../../components/search/SchoolCard';
+import React, {useEffect, useState} from 'react';
+import {Font, color} from '@/styles';
+import {useNavigation} from '@react-navigation/native';
+import {searchSchool} from '../dummy/searchSchool';
+import {TopBar} from '@/components';
+import {Arrow} from '@/assets';
+import {StackNavigationProp} from '@react-navigation/stack';
+
+export default function BookmarkSchool() {
+ const tagList = ['초등학교', '중학교', '고등학교', '대학교'];
+ const navigation = useNavigation>();
+ const [pressed, setPressed] = useState(0);
+ const [filteredSchoolList, setFilteredSchoolList] = useState(searchSchool);
+
+ const filterSchoolList = (tag: string) => {
+ const filtered = searchSchool.filter(i => i.schoolName.endsWith(tag));
+ setFilteredSchoolList(filtered);
+ };
+
+ useEffect(() => {
+ filterSchoolList(tagList[pressed]);
+ }, [pressed]);
+
+ return (
+
+ navigation.goBack()} />}
+ text="북마크한 학교"
+ />
+
+ {tagList.map((tag, index) => (
+ {
+ setPressed(index);
+ filterSchoolList(tag);
+ }}
+ press={pressed === index}
+ key={index}>
+
+
+ ))}
+
+
+ {filteredSchoolList.length > 0 ? (
+
+ {filteredSchoolList.map(
+ ({schoolName, address, score, reviewCount}, index) => (
+
+ ),
+ )}
+
+ ) : (
+
+
+
+ )}
+
+ );
+}
+
+const SchoolListConteiner = styled.View`
+ padding-top: 56px;
+ background-color: ${color.white};
+ height: 100%;
+`;
+
+const TagContainer = styled.View`
+ width: 100%;
+ padding: 0 20px;
+ gap: 16px;
+ flex-direction: row;
+ border-bottom-width: 1px;
+ border-bottom-color: ${color.gray200};
+`;
+
+const TagBox = styled.TouchableOpacity<{press: boolean}>`
+ padding: 16px 0;
+ ${({press}) => press && 'border-bottom-width: 2px;'}
+ border-bottom-color: ${color.black};
+`;
+
+const SchoolCardWrap = styled.ScrollView`
+ background-color: ${color.white};
+ padding: 8px 20px;
+`;
+
+const NoSchoolWrap = styled.View`
+ flex: 1;
+ background-color: ${color.white};
+ justify-content: center;
+ align-items: center;
+`;
diff --git a/src/app/mypage/LikePost.tsx b/src/app/mypage/LikePost.tsx
new file mode 100644
index 0000000..0770e5c
--- /dev/null
+++ b/src/app/mypage/LikePost.tsx
@@ -0,0 +1,60 @@
+import styled from 'styled-components/native';
+import SchoolCard from '../../components/search/SchoolCard';
+import React, {useEffect, useState} from 'react';
+import {Font, color} from '@/styles';
+import {useNavigation} from '@react-navigation/native';
+import {searchSchool} from '../dummy/searchSchool';
+import {ContentCard, TopBar} from '@/components';
+import {Arrow} from '@/assets';
+import {StackNavigationProp} from '@react-navigation/stack';
+
+export default function LikePost() {
+ const tagList = ['초등학교', '중학교', '고등학교', '대학교'];
+ const navigation = useNavigation>();
+ const [pressed, setPressed] = useState(0);
+ const [filteredSchoolList, setFilteredSchoolList] = useState(searchSchool);
+
+ const filterSchoolList = (tag: string) => {
+ const filtered = searchSchool.filter(i => i.schoolName.endsWith(tag));
+ setFilteredSchoolList(filtered);
+ };
+
+ useEffect(() => {
+ filterSchoolList(tagList[pressed]);
+ }, [pressed]);
+
+ return (
+
+ navigation.goBack()} />}
+ text="좋아요한 게시물"
+ />
+
+ navigation.navigate('Post')} />
+
+
+
+
+
+
+
+ );
+}
+
+const SchoolListConteiner = styled.View`
+ padding-top: 56px;
+ background-color: ${color.white};
+ height: 100%;
+`;
+
+const Container = styled.ScrollView`
+ padding: 0 20px;
+ background-color: white;
+`;
+
+const NoSchoolWrap = styled.View`
+ flex: 1;
+ background-color: ${color.white};
+ justify-content: center;
+ align-items: center;
+`;
diff --git a/src/app/mypage/ListCard.tsx b/src/app/mypage/ListCard.tsx
new file mode 100644
index 0000000..e54675e
--- /dev/null
+++ b/src/app/mypage/ListCard.tsx
@@ -0,0 +1,66 @@
+import {styled} from 'styled-components/native';
+import {Font, color} from '@/styles';
+import {Bookmark, Edit, Heart, Menu} from '../../assets';
+
+interface CardProps {
+ type: 'bookmarkSchool' | 'likePost' | 'writePost';
+ count: number;
+ onPress: () => void;
+}
+
+interface CardInfo {
+ title: string;
+ icon: JSX.Element;
+}
+
+export const ListCard = ({type, count = 0, onPress}: CardProps) => {
+ const cardType: Record = {
+ bookmarkSchool: {
+ title: '북마크한 학교',
+ icon: ,
+ },
+ likePost: {
+ title: '좋아요한 게시물',
+ icon: ,
+ },
+ writePost: {
+ title: '내가 작성한 게시물',
+ icon: ,
+ },
+ };
+
+ const {title, icon} = cardType[type] || {title: '', icon: null};
+
+ return (
+
+
+ {icon}
+
+
+
+
+
+ {/* */}
+
+ );
+};
+
+const CardBox = styled.TouchableOpacity<{yellow: boolean}>`
+ flex-direction: row;
+ justify-content: space-between;
+ flex: 1;
+ border-radius: 12px;
+ padding: 16px;
+ background-color: ${({yellow}) => (yellow ? color.amber50 : color.white)};
+ border: 1px solid ${({yellow}) => (yellow ? color.white : color.gray200)};
+ height: 140px;
+`;
+
+const TitleBox = styled.View`
+ flex: 1;
+ justify-content: space-between;
+`;
+
+const Title = styled.View`
+ gap: 4px;
+`;
diff --git a/src/app/mypage/Setting.tsx b/src/app/mypage/Setting.tsx
new file mode 100644
index 0000000..e2b424d
--- /dev/null
+++ b/src/app/mypage/Setting.tsx
@@ -0,0 +1,59 @@
+import {Logout, Gear, Arrow} from '@/assets';
+import {color, Font} from '@/styles';
+import {useNavigation} from '@react-navigation/native';
+import {StackNavigationProp} from '@react-navigation/stack';
+import styled from 'styled-components/native';
+import {TopBar} from '@/components';
+import {Alert} from 'react-native';
+
+export default function Setting() {
+ const navigation = useNavigation>();
+ const goAlert = () => {
+ Alert.alert('로그아웃해라', '어저고저ㅓㅉ고', [
+ {text: '네', onPress: () => {}, style: 'cancel'},
+ {text: '아니요', onPress: () => {}, style: 'default'},
+ ]);
+ };
+ return (
+
+ navigation.goBack()} />}
+ text="내가 작성한 게시물"
+ />
+
+
+ navigation.goBack()} color={color.gray500} />
+
+
+
+
+
+
+
+
+ );
+}
+const SetBox = styled.View`
+ width: 100%;
+ gap: 10px;
+ padding-top: 80px;
+ height: 100%;
+ background-color: ${color.white};
+`;
+
+const SetButton = styled.TouchableOpacity<{red?: boolean}>`
+ width: 100%;
+ padding: 14px 16px;
+ border: 1px solid ${({red}) => (red ? color.red : color.gray200)};
+ border-radius: 8px;
+ background-color: ${color.white};
+ gap: 12px;
+ align-items: center;
+ flex-direction: row;
+`;
+
+const ButtonBox = styled.TouchableOpacity`
+ width: 100%;
+ padding: 0 24px;
+ gap: 12px;
+`;
diff --git a/src/app/mypage/WritePost.tsx b/src/app/mypage/WritePost.tsx
new file mode 100644
index 0000000..061dc38
--- /dev/null
+++ b/src/app/mypage/WritePost.tsx
@@ -0,0 +1,60 @@
+import styled from 'styled-components/native';
+import SchoolCard from '../../components/search/SchoolCard';
+import React, {useEffect, useState} from 'react';
+import {Font, color} from '@/styles';
+import {useNavigation} from '@react-navigation/native';
+import {searchSchool} from '../dummy/searchSchool';
+import {ContentCard, TopBar} from '@/components';
+import {Arrow} from '@/assets';
+import {StackNavigationProp} from '@react-navigation/stack';
+
+export default function WritePost() {
+ const tagList = ['초등학교', '중학교', '고등학교', '대학교'];
+ const navigation = useNavigation>();
+ const [pressed, setPressed] = useState(0);
+ const [filteredSchoolList, setFilteredSchoolList] = useState(searchSchool);
+
+ const filterSchoolList = (tag: string) => {
+ const filtered = searchSchool.filter(i => i.schoolName.endsWith(tag));
+ setFilteredSchoolList(filtered);
+ };
+
+ useEffect(() => {
+ filterSchoolList(tagList[pressed]);
+ }, [pressed]);
+
+ return (
+
+ navigation.goBack()} />}
+ text="내가 작성한 게시물"
+ />
+
+ navigation.navigate('Post')} />
+
+
+
+
+
+
+
+ );
+}
+
+const SchoolListConteiner = styled.View`
+ padding-top: 56px;
+ background-color: ${color.white};
+ height: 100%;
+`;
+
+const Container = styled.ScrollView`
+ padding: 0 20px;
+ background-color: white;
+`;
+
+const NoSchoolWrap = styled.View`
+ flex: 1;
+ background-color: ${color.white};
+ justify-content: center;
+ align-items: center;
+`;
diff --git a/src/app/mypage/page.tsx b/src/app/mypage/page.tsx
index 56f268c..7c728c0 100644
--- a/src/app/mypage/page.tsx
+++ b/src/app/mypage/page.tsx
@@ -1,7 +1,134 @@
import React from 'react';
+import {styled} from 'styled-components/native';
+import {Font, color} from '@/styles';
+import {Arrow, Edit, Gear} from '../../assets';
+import {ListCard} from './ListCard';
+import {TopBar} from '../../components';
+import {useNavigation} from '@react-navigation/native';
+import {StackNavigationProp} from '@react-navigation/stack';
+
+interface MypageInfoTypes {}
function MyPage() {
- return <>>;
+ const navigation = useNavigation>();
+ return (
+ <>
+ navigation.push('Setting')}>
+
+
+ }
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ navigation.navigate('BookmarkSchool')}
+ type="bookmarkSchool"
+ count={0}
+ />
+
+
+
+
+ navigation.navigate('LikePost')}
+ type="likePost"
+ count={0}
+ />
+ navigation.navigate('WritePost')}
+ type="writePost"
+ count={0}
+ />
+
+
+
+ >
+ );
}
export default MyPage;
+
+const Container = styled.ScrollView`
+ padding: 56px 24px;
+ background-color: ${color.white};
+`;
+
+const ProfileBox = styled.View`
+ padding-top: 24px;
+ gap: 20px;
+ width: 100%;
+ align-items: center;
+ flex-direction: row;
+`;
+
+const Image = styled.Image`
+ width: 100px;
+ height: 100px;
+ border-radius: 1000px;
+ border: 1px solid ${color.gray200};
+ background-color: ${color.gray100};
+`;
+
+const ImageBox = styled.View`
+ width: 100px;
+ height: 100px;
+ border-radius: 1000px;
+ position: relative;
+`;
+
+const UserDetails = styled.View`
+ gap: 4px;
+`;
+
+const LinkToSchool = styled.TouchableOpacity`
+ gap: 4px;
+ align-items: center;
+ flex-direction: row;
+`;
+
+const EditProfile = styled.TouchableOpacity`
+ padding: 6px;
+ border-radius: 100px;
+ background-color: ${color.black};
+ border: 2px solid ${color.white};
+ position: absolute;
+ bottom: 2px;
+ right: 2px;
+`;
+
+const CollectBox = styled.View`
+ width: 100%;
+ gap: 12px;
+`;
+
+const PostListBox = styled.View`
+ width: 100%;
+ gap: 8px;
+ flex-direction: row;
+`;
+
+const SettingButton = styled.TouchableOpacity``;
diff --git a/src/app/review/KeywordReview.tsx b/src/app/review/KeywordReview.tsx
index 4ae620e..317fbc6 100644
--- a/src/app/review/KeywordReview.tsx
+++ b/src/app/review/KeywordReview.tsx
@@ -2,8 +2,7 @@ import React, {useState} from 'react';
import styled from 'styled-components/native';
import {TopBar} from '../../components/TopBar';
import {TouchableOpacity} from 'react-native';
-import {color} from '../../styles/color';
-import {Font} from '../../styles/font';
+import {color, Font} from '@/styles';
import Tag from '../../components/Review/Tag';
import {Arrow} from '../../assets/Arrow';
import {useNavigation} from '@react-navigation/native';
diff --git a/src/app/review/List.tsx b/src/app/review/List.tsx
index 728cce6..86138c4 100644
--- a/src/app/review/List.tsx
+++ b/src/app/review/List.tsx
@@ -1,7 +1,6 @@
import React, {useState} from 'react';
import styled from 'styled-components/native';
-import {color} from '../../styles/color';
-import {Font} from '../../styles/font';
+import {color, Font} from '@/styles';
import Review from './Review';
import Qanda from './Qanda';
import SchoolInfo from './SchoolInfo';
diff --git a/src/app/review/Photo.tsx b/src/app/review/Photo.tsx
index 2f38bff..c7e660a 100644
--- a/src/app/review/Photo.tsx
+++ b/src/app/review/Photo.tsx
@@ -1,58 +1,57 @@
-import React, { useState } from "react";
-import styled from "styled-components/native";
-import { Font } from "../../styles/font"
-import { color } from "../../styles/color";
-import { yearlyPhoto } from "../dummy/yearlyPhoto"
-import { TouchableOpacity } from "react-native";
+import React, {useState} from 'react';
+import styled from 'styled-components/native';
+import {Font, color} from '@/styles';
+import {yearlyPhoto} from '../dummy/yearlyPhoto';
+import {TouchableOpacity} from 'react-native';
export default function Photo() {
- const [showImage, setShowImage] = useState(false)
+ const [showImage, setShowImage] = useState(false);
- return (
- <>
-
- {yearlyPhoto.map((value, index) => (
-
-
-
-
-
- {value.photo.map((value) => (
- setShowImage(true)}>
-
-
- ))}
-
-
- ))}
-
- >
- )
+ return (
+ <>
+
+ {yearlyPhoto.map((value, index) => (
+
+
+
+
+
+ {value.photo.map(value => (
+ setShowImage(true)}>
+
+
+ ))}
+
+
+ ))}
+
+ >
+ );
}
const Container = styled.View`
-width: 100%;
-background-color: ${color.white};
-padding: 24px 20px;
-gap: 44px;
-`
+ width: 100%;
+ background-color: ${color.white};
+ padding: 24px 20px;
+ gap: 44px;
+`;
const Content = styled.View`
-gap: 16px;
-`
+ gap: 16px;
+`;
const YearWrap = styled.View`
-padding: 8px 0px;
-border-bottom-width: 1px;
-border-bottom-color: ${color.gray100};
-`
+ padding: 8px 0px;
+ border-bottom-width: 1px;
+ border-bottom-color: ${color.gray100};
+`;
const ImgContentWrap = styled.View`
-flex-direction: row;
-flex-wrap: wrap;
-`
+ flex-direction: row;
+ flex-wrap: wrap;
+`;
const Img = styled.Image`
-width: 87px;
-height: 87px;
-`
\ No newline at end of file
+ width: 87px;
+ height: 87px;
+`;
diff --git a/src/app/review/QandADetail.tsx b/src/app/review/QandADetail.tsx
index 9f6c940..92b7d1c 100644
--- a/src/app/review/QandADetail.tsx
+++ b/src/app/review/QandADetail.tsx
@@ -10,7 +10,7 @@ import {
import {TopBar} from '../../components';
import {Arrow, Setting} from '../../assets';
import styled from 'styled-components/native';
-import {Font, color} from '../../styles';
+import {Font, color} from '@/styles';
import AnswerBox from '../../components/Review/AnswerBox';
export default function QandADetail() {
diff --git a/src/app/review/Qanda.tsx b/src/app/review/Qanda.tsx
index 42f67f4..b297223 100644
--- a/src/app/review/Qanda.tsx
+++ b/src/app/review/Qanda.tsx
@@ -1,6 +1,6 @@
import React, {useState} from 'react';
import styled from 'styled-components/native';
-import {color} from '../../styles';
+import {color} from '@/styles';
import {Filter} from '../../assets';
import {NewMarkTag} from '../../components/Review/NewMarkTag';
import {QuestionBox} from '../../components/Review/QuestionBox';
diff --git a/src/app/review/Question.tsx b/src/app/review/Question.tsx
index 7ac6558..37ba72c 100644
--- a/src/app/review/Question.tsx
+++ b/src/app/review/Question.tsx
@@ -1,7 +1,7 @@
import {TopBar} from '../../components';
import {Close} from '../../assets';
import {TouchableOpacity} from 'react-native';
-import {Font, color} from '../../styles';
+import {Font, color} from '@/styles';
import {useState} from 'react';
import {Dropdown} from '../../components/Dropdown';
import styled from 'styled-components/native';
diff --git a/src/app/review/Review.tsx b/src/app/review/Review.tsx
index 088e462..3bf87f0 100644
--- a/src/app/review/Review.tsx
+++ b/src/app/review/Review.tsx
@@ -1,10 +1,9 @@
import React, {useState} from 'react';
import styled from 'styled-components/native';
-import {Font} from '../../styles/font';
+import {Font, color} from '@/styles';
import {Filter} from '../../assets';
import WriteButton from '../../components/Review/WriteButton';
import StarRating from '../../components/StarRating';
-import {color} from '../../styles/color';
import ReviewBox from '../../components/Review/ReviewBox';
import {reviewValue} from '../dummy/reviewValue';
import {useNavigation} from '@react-navigation/native';
diff --git a/src/app/review/Write.tsx b/src/app/review/Write.tsx
index 1cca0d3..22675a9 100644
--- a/src/app/review/Write.tsx
+++ b/src/app/review/Write.tsx
@@ -2,10 +2,9 @@ import React, {useState} from 'react';
import styled from 'styled-components/native';
import {TopBar} from '../../components/TopBar';
import {Close, Media} from '../../assets';
-import {Font} from '../../styles/font';
+import {Font, color} from '@/styles';
import {TouchableOpacity} from 'react-native';
import {useNavigation} from '@react-navigation/native';
-import {color} from '../../styles/color';
import AddImgContent from '../../components/Review/AddImgContent';
import {Star} from '../../assets';
import {ImagePickerResponse} from 'react-native-image-picker';
diff --git a/src/app/review/page.tsx b/src/app/review/page.tsx
index f2687f9..33fd1d8 100644
--- a/src/app/review/page.tsx
+++ b/src/app/review/page.tsx
@@ -3,8 +3,7 @@ import styled from 'styled-components/native';
import {TopBar} from '../../components/TopBar';
import {TouchableOpacity} from 'react-native';
import {Arrow, Star, Bookmark, Link} from '../../assets';
-import {color} from '../../styles/color';
-import {Font} from '../../styles/font';
+import {color, Font} from '@/styles';
import ImgSlider from '../../components/Review/ImgSlider';
import SchoolTag from '../../components/Review/SchoolTag';
import ListWrap from './List';
diff --git a/src/app/search/page.tsx b/src/app/search/page.tsx
index a896c82..d4530ca 100644
--- a/src/app/search/page.tsx
+++ b/src/app/search/page.tsx
@@ -2,7 +2,7 @@ import React, {useState, useEffect} from 'react';
import {Arrow, Search} from '../../assets';
import styled from 'styled-components/native';
import {useNavigation} from '@react-navigation/native';
-import {color, Font} from '../../styles';
+import {color, Font} from '@/styles';
import {schoolList} from '../dummy/schoolList';
import SchoolCard from '../../components/search/SchoolCard';
import {TopBar, Input, Dropdown} from '../../components';
diff --git a/src/app/signup/FindSchool.tsx b/src/app/signup/FindSchool.tsx
index 0ed5443..9efc80c 100644
--- a/src/app/signup/FindSchool.tsx
+++ b/src/app/signup/FindSchool.tsx
@@ -2,7 +2,7 @@ import React, {useState, useEffect} from 'react';
import {Input} from '../../components';
import {Search} from '../../assets';
import styled from 'styled-components/native';
-import {color, Font} from '../../styles';
+import {color, Font} from '@/styles';
import SchoolList from '../../components/signup/SchoolList';
import {SchoolListType, SignupProps} from '../../interfaces';
import {StackNavigationProp} from '@react-navigation/stack';
@@ -62,7 +62,7 @@ function FindSchool({onSelectSchool}: any) {
) : filteredSchoolList.length > 0 ? (
item.schoolName}
+ keyExtractor={(item: any) => `${item.schoolName} + ${item.seq}`}
renderItem={({item}: any) => (
{
diff --git a/src/app/signup/Name.tsx b/src/app/signup/Name.tsx
index 3a95140..1bd4bd4 100644
--- a/src/app/signup/Name.tsx
+++ b/src/app/signup/Name.tsx
@@ -1,7 +1,7 @@
import React, {useState} from 'react';
import {Warn} from '../../assets';
import styled from 'styled-components/native';
-import {color, Font} from '../../styles';
+import {color, Font} from '@/styles';
import {Button, Input} from '../../components';
import {useNavigation} from '@react-navigation/native';
import {Dimensions} from 'react-native';
diff --git a/src/app/signup/page.tsx b/src/app/signup/page.tsx
index 993c368..3dc3022 100644
--- a/src/app/signup/page.tsx
+++ b/src/app/signup/page.tsx
@@ -5,7 +5,7 @@ import styled from 'styled-components/native';
import {useNavigation} from '@react-navigation/native';
import {StackNavigationProp} from '@react-navigation/stack';
import {Arrow, Warn} from '../../assets';
-import {Font, color} from '../../styles';
+import {Font, color} from '@/styles';
import {Button, TopBar} from '../../components';
import IdAndPassword from './IdAndPassword';
import Name from './Name';
@@ -80,7 +80,7 @@ function Signup() {
} else {
reset();
setPage(0);
- navigation.push('Login');
+ navigation.navigate('Login');
}
});
diff --git a/src/components/ContentCard.tsx b/src/components/ContentCard.tsx
index 2ba49c2..7fef94e 100644
--- a/src/components/ContentCard.tsx
+++ b/src/components/ContentCard.tsx
@@ -67,8 +67,8 @@ export const ContentCard = ({
setPressed(!pressed);
}}>
-
+
{more && (
diff --git a/src/components/Review/AddImgContent.tsx b/src/components/Review/AddImgContent.tsx
index 090fa44..d7c467d 100644
--- a/src/components/Review/AddImgContent.tsx
+++ b/src/components/Review/AddImgContent.tsx
@@ -1,59 +1,59 @@
-import React, { useState } from "react";
-import styled from "styled-components/native";
-import { Close } from "../../assets";
-import { color } from "../../styles/color"
+import React, {useState} from 'react';
+import styled from 'styled-components/native';
+import {Close} from '../../assets';
+import {color} from '@/styles';
interface PropsType {
- photo?: Array;
- onPhotosChange: (photos: Array) => void;
+ photo?: Array;
+ onPhotosChange: (photos: Array) => void;
}
-export default function AddImgContent({ photo = [], onPhotosChange }: PropsType) {
- const [photos, setPhotos] = useState>(photo);
+export default function AddImgContent({photo = [], onPhotosChange}: PropsType) {
+ const [photos, setPhotos] = useState>(photo);
- const deletePhoto = (index: number) => {
- const updatedPhotos = photos.filter((_, i) => i !== index);
- setPhotos(updatedPhotos);
- onPhotosChange(updatedPhotos);
- };
+ const deletePhoto = (index: number) => {
+ const updatedPhotos = photos.filter((_, i) => i !== index);
+ setPhotos(updatedPhotos);
+ onPhotosChange(updatedPhotos);
+ };
- return (
- <>
- {photo?.map((photo, index) => (
-
-
- deletePhoto(index)}>
-
-
-
- ))}
- >
- )
+ return (
+ <>
+ {photo?.map((photo, index) => (
+
+
+ deletePhoto(index)}>
+
+
+
+ ))}
+ >
+ );
}
const Container = styled.View`
-position: relative;
-width: 100px;
-height: 100px;
-background-color: pink;
-border: 1px solid ${color.gray100};
-border-radius: 16px;
-overflow: hidden;
-`
+ position: relative;
+ width: 100px;
+ height: 100px;
+ background-color: pink;
+ border: 1px solid ${color.gray100};
+ border-radius: 16px;
+ overflow: hidden;
+`;
const ImgContent = styled.Image`
-width: 100%;
-height: 100%;
-`
+ width: 100%;
+ height: 100%;
+`;
const CancelButton = styled.TouchableOpacity`
-position: absolute;
-top: 6px;
-right: 6px;
-padding: 4px;
-background-color: #F4F4F5;
-opacity: 0.2;
-border-radius: 100px;
-justify-content: center;
-align-items: center;
-`
\ No newline at end of file
+ position: absolute;
+ top: 6px;
+ right: 6px;
+ padding: 4px;
+ background-color: #f4f4f5;
+ opacity: 0.2;
+ border-radius: 100px;
+ justify-content: center;
+ align-items: center;
+`;
diff --git a/src/components/Review/AnswerBox.tsx b/src/components/Review/AnswerBox.tsx
index 9e092fd..8bc855b 100644
--- a/src/components/Review/AnswerBox.tsx
+++ b/src/components/Review/AnswerBox.tsx
@@ -1,5 +1,5 @@
import styled from 'styled-components/native';
-import {Font, color} from '../../styles';
+import {Font, color} from '@/styles';
import {Heart, Setting, Answer} from '../../assets';
import ReplyBox from './ReplyBox';
diff --git a/src/components/Review/ExpandImage.tsx b/src/components/Review/ExpandImage.tsx
index 2ade594..642f98e 100644
--- a/src/components/Review/ExpandImage.tsx
+++ b/src/components/Review/ExpandImage.tsx
@@ -1,7 +1,7 @@
import {useState} from 'react';
import styled from 'styled-components/native';
import {Arrow, Close} from '../../assets';
-import {color} from '../../styles';
+import {color} from '@/styles';
import {Dimensions} from 'react-native';
interface PropsType {
diff --git a/src/components/Review/ImgSlider.tsx b/src/components/Review/ImgSlider.tsx
index cc84dd8..784b823 100644
--- a/src/components/Review/ImgSlider.tsx
+++ b/src/components/Review/ImgSlider.tsx
@@ -1,68 +1,73 @@
-import React, { useState, useRef } from "react";
-import { Dimensions, ScrollView, NativeSyntheticEvent, NativeScrollEvent } from "react-native";
-import styled from "styled-components/native";
-import { Image } from "../../app/dummy/Image";
-import { color } from "../../styles/color";
+import React, {useState, useRef} from 'react';
+import {
+ Dimensions,
+ ScrollView,
+ NativeSyntheticEvent,
+ NativeScrollEvent,
+} from 'react-native';
+import styled from 'styled-components/native';
+import {Image} from '../../app/dummy/Image';
+import {color} from '@/styles';
export default function ImgSlider() {
- const screenWidth = Dimensions.get("window").width;
- const [currentIndex, setCurrentIndex] = useState(0);
- const scrollViewRef = useRef(null);
+ const screenWidth = Dimensions.get('window').width;
+ const [currentIndex, setCurrentIndex] = useState(0);
+ const scrollViewRef = useRef(null);
- const handleScroll = (event: NativeSyntheticEvent) => {
- const contentOffsetX = event.nativeEvent.contentOffset.x;
- const newIndex = Math.round(contentOffsetX / screenWidth);
- setCurrentIndex(newIndex);
- };
+ const handleScroll = (event: NativeSyntheticEvent) => {
+ const contentOffsetX = event.nativeEvent.contentOffset.x;
+ const newIndex = Math.round(contentOffsetX / screenWidth);
+ setCurrentIndex(newIndex);
+ };
- return (
-
-
- {Image.map((value, index) => (
-
- ))}
-
-
- {Image.map((_, index) => (
-
- ))}
-
-
- );
+ return (
+
+
+ {Image.map((value, index) => (
+
+ ))}
+
+
+ {Image.map((_, index) => (
+
+ ))}
+
+
+ );
}
const Container = styled.View`
- position: relative;
- width: 100%;
- height: 360px;
- flex-direction: row;
+ position: relative;
+ width: 100%;
+ height: 360px;
+ flex-direction: row;
`;
-const ImgWrap = styled.Image<{ width: number }>`
- width: ${({ width }) => width}px;
- height: 100%;
+const ImgWrap = styled.Image<{width: number}>`
+ width: ${({width}) => width}px;
+ height: 100%;
`;
const ListWrap = styled.View`
- width: 100%;
- position: absolute;
- flex-direction: row;
- bottom: 0px;
- justify-content: center;
- gap: 8px;
- padding: 12px;
+ width: 100%;
+ position: absolute;
+ flex-direction: row;
+ bottom: 0px;
+ justify-content: center;
+ gap: 8px;
+ padding: 12px;
`;
-const List = styled.View<{ isActive: boolean }>`
- width: 8px;
- height: 8px;
- border-radius: 100px;
- background-color: ${({ isActive }) => (isActive ? color.amber600 : color.gray300)};
+const List = styled.View<{isActive: boolean}>`
+ width: 8px;
+ height: 8px;
+ border-radius: 100px;
+ background-color: ${({isActive}) =>
+ isActive ? color.amber600 : color.gray300};
`;
diff --git a/src/components/Review/NewMarkTag.tsx b/src/components/Review/NewMarkTag.tsx
index 6dbf4dd..c9c7906 100644
--- a/src/components/Review/NewMarkTag.tsx
+++ b/src/components/Review/NewMarkTag.tsx
@@ -1,16 +1,20 @@
-import { Font } from "../../styles/font";
-import { color } from "../../styles/color";
-import styled from "styled-components/native";
-import { TouchableOpacity } from "react-native";
+import {Font, color} from '@/styles';
+import styled from 'styled-components/native';
+import {TouchableOpacity} from 'react-native';
interface PropsType {
text?: string;
mark?: boolean;
selected?: boolean;
- onPress?: () => void
+ onPress?: () => void;
}
-export const NewMarkTag = ({ text, mark, selected = false, onPress }: PropsType) => {
+export const NewMarkTag = ({
+ text,
+ mark,
+ selected = false,
+ onPress,
+}: PropsType) => {
return (
@@ -25,14 +29,15 @@ export const NewMarkTag = ({ text, mark, selected = false, onPress }: PropsType)
);
};
-const Container = styled.View<{ selected: boolean }>`
+const Container = styled.View<{selected: boolean}>`
display: flex;
flex-direction: row;
padding: 8px 10px;
gap: 10px;
border-radius: 6px;
- border: 1px solid ${({ selected }) => (selected ? color.amber300 : color.gray200)};
- background-color: ${({ selected }) => (selected ? color.amber50 : color.white)};
+ border: 1px solid
+ ${({selected}) => (selected ? color.amber300 : color.gray200)};
+ background-color: ${({selected}) => (selected ? color.amber50 : color.white)};
`;
const NewMark = styled.View`
diff --git a/src/components/Review/QuestionBox.tsx b/src/components/Review/QuestionBox.tsx
index e2e5694..d362a6c 100644
--- a/src/components/Review/QuestionBox.tsx
+++ b/src/components/Review/QuestionBox.tsx
@@ -1,5 +1,5 @@
import styled from 'styled-components/native';
-import {Font, color} from '../../styles';
+import {Font, color} from '@/styles';
import {Bell, Answer} from '../../assets';
import {useState} from 'react';
import {TouchableOpacity} from 'react-native';
@@ -26,7 +26,7 @@ export const QuestionBox = () => {
-
+
diff --git a/src/components/Review/ReplyBox.tsx b/src/components/Review/ReplyBox.tsx
index 1b1f0ad..b726694 100644
--- a/src/components/Review/ReplyBox.tsx
+++ b/src/components/Review/ReplyBox.tsx
@@ -1,5 +1,5 @@
import styled from 'styled-components/native';
-import {Font, color} from '../../styles';
+import {Font, color} from '@/styles';
export default function ReplyBox() {
return (
diff --git a/src/components/Review/ReviewBox.tsx b/src/components/Review/ReviewBox.tsx
index 5badca1..d8aae3c 100644
--- a/src/components/Review/ReviewBox.tsx
+++ b/src/components/Review/ReviewBox.tsx
@@ -2,8 +2,7 @@ import React from 'react';
import styled from 'styled-components/native';
import {Setting} from '../../assets';
import StarRating from '../StarRating';
-import {Font} from '../../styles/font';
-import {color} from '../../styles/color';
+import {Font, color} from '@/styles';
import Profile from '../../assets/Profile.png';
interface PropsType {
diff --git a/src/components/Review/SchoolTag.tsx b/src/components/Review/SchoolTag.tsx
index c6dae1f..e5dbf3a 100644
--- a/src/components/Review/SchoolTag.tsx
+++ b/src/components/Review/SchoolTag.tsx
@@ -1,7 +1,6 @@
import React from 'react';
import styled from 'styled-components/native';
-import {color} from '../../styles/color';
-import {Font} from '../../styles/font';
+import {color, Font} from '@/styles';
export default function SchoolTag({text}: {text: string}) {
return (
diff --git a/src/components/Review/SelectBox.tsx b/src/components/Review/SelectBox.tsx
index d838c81..56c1e85 100644
--- a/src/components/Review/SelectBox.tsx
+++ b/src/components/Review/SelectBox.tsx
@@ -1,7 +1,6 @@
import React from 'react';
import styled from 'styled-components/native';
-import {color} from '../../styles/color';
-import {Font} from '../../styles/font';
+import {color, Font} from '@/styles';
import {Arrow} from '../../assets/Arrow';
interface PropsType {
diff --git a/src/components/Review/Tag.tsx b/src/components/Review/Tag.tsx
index 47061bb..5322f61 100644
--- a/src/components/Review/Tag.tsx
+++ b/src/components/Review/Tag.tsx
@@ -1,29 +1,29 @@
-import React from "react";
-import styled from "styled-components/native";
-import {Font} from "../../styles/font"
-import { color } from "../../styles/color";
+import React from 'react';
+import styled from 'styled-components/native';
+import {Font, color} from '@/styles';
interface PropsType {
- text?: string
- selected?: boolean
- onPress?: () => void
+ text?: string;
+ selected?: boolean;
+ onPress?: () => void;
}
-export default function Tag({text, selected = false, onPress} : PropsType) {
- return (
-
-
-
- )
+export default function Tag({text, selected = false, onPress}: PropsType) {
+ return (
+
+
+
+ );
}
-const Container = styled.TouchableOpacity<{selected : boolean}>`
-padding: 8px 12px;
-background-color: ${({ selected }) => (selected ? color.amber50 : color.white)};
-border: 1px solid ${({ selected }) => (selected ? color.amber200 : color.gray200)};
-border-radius: 4px;
-`
+const Container = styled.TouchableOpacity<{selected: boolean}>`
+ padding: 8px 12px;
+ background-color: ${({selected}) => (selected ? color.amber50 : color.white)};
+ border: 1px solid
+ ${({selected}) => (selected ? color.amber200 : color.gray200)};
+ border-radius: 4px;
+`;
-const StyledFont = styled(Font)<{selected : boolean}>`
- color: ${({ selected }) => (selected ? color.amber800 : color.black)};
-`
+const StyledFont = styled(Font)<{selected: boolean}>`
+ color: ${({selected}) => (selected ? color.amber800 : color.black)};
+`;
diff --git a/src/components/Review/WriteButton.tsx b/src/components/Review/WriteButton.tsx
index 44296f5..86777c7 100644
--- a/src/components/Review/WriteButton.tsx
+++ b/src/components/Review/WriteButton.tsx
@@ -1,7 +1,6 @@
import React from 'react';
import styled from 'styled-components/native';
-import {Font} from '../../styles/font';
-import {color} from '../../styles/color';
+import {Font, color} from '@/styles';
import {Pen} from '../../assets';
import {useNavigation} from '@react-navigation/native';
import {StackNavigationProp} from '@react-navigation/stack';
diff --git a/src/components/StarRating.tsx b/src/components/StarRating.tsx
index cd925f5..554aa28 100644
--- a/src/components/StarRating.tsx
+++ b/src/components/StarRating.tsx
@@ -11,20 +11,19 @@ interface PropsType {
function StarRating({num = 0, size = 14, isText = true}: PropsType) {
const stars: React.ReactNode[] = [];
- for (let i = 0; i < num; i++) {
+ const floorNum = Math.floor(num);
+ for (let i = 0; i < floorNum; i++) {
stars.push();
}
- for (let i = 0; i < 5 - num; i++) {
+ for (let i = 0; i < 5 - floorNum; i++) {
stars.push();
}
return (
{stars}
- {isText && (
-
- )}
+ {isText && }
);
}
diff --git a/src/components/community/Comment.tsx b/src/components/community/Comment.tsx
index d49c73a..3791d89 100644
--- a/src/components/community/Comment.tsx
+++ b/src/components/community/Comment.tsx
@@ -1,8 +1,7 @@
import React from 'react';
import styled from 'styled-components/native';
-import {Font} from '../../styles/font';
+import {Font, color} from '@/styles';
import {Menu} from '../../assets';
-import {color} from '../../styles/color';
interface PropsType {
userName?: string;
diff --git a/src/components/main/EventCard.tsx b/src/components/main/EventCard.tsx
index 2813e6c..0cd2b70 100644
--- a/src/components/main/EventCard.tsx
+++ b/src/components/main/EventCard.tsx
@@ -1,7 +1,6 @@
import React from 'react';
import styled from 'styled-components/native';
-import {color} from '../../styles/color';
-import {Font} from '../../styles/font';
+import {color, Font} from '@/styles';
import {Arrow} from '../../assets';
function EventCard() {
diff --git a/src/components/main/Header.tsx b/src/components/main/Header.tsx
index 9cb0f6e..d91933c 100644
--- a/src/components/main/Header.tsx
+++ b/src/components/main/Header.tsx
@@ -1,7 +1,7 @@
import React from 'react';
import {Dimensions} from 'react-native';
import styled from 'styled-components/native';
-import {color} from '../../styles/color';
+import {color} from '@/styles';
import {Logo, Search, Bell} from '../../assets';
function Header() {
diff --git a/src/components/main/ReviewCard.tsx b/src/components/main/ReviewCard.tsx
index f22998f..c915c07 100644
--- a/src/components/main/ReviewCard.tsx
+++ b/src/components/main/ReviewCard.tsx
@@ -1,9 +1,8 @@
import React, {useState} from 'react';
import {styled} from 'styled-components/native';
-import {Font} from '../../styles/font';
-// import {Bookmark} from '../../assets';
-import {color} from '../../styles/color';
-// import StarRating from '../StarRating';
+import {Font, color} from '@/styles';
+import {Bookmark} from '../../assets';
+import StarRating from '../StarRating';
interface PropsType {
schoolName: string;
@@ -23,10 +22,11 @@ function ReviewCard({schoolName, location, userName, num, review}: PropsType) {
setPressBookmark(!pressBookmark)}>
- {/* */}
+ fill={pressBookmark ? color.gray700 : color.white}
+ color={color.gray700}
+ />
diff --git a/src/components/search/SchoolCard.tsx b/src/components/search/SchoolCard.tsx
index f30adc8..e487da7 100644
--- a/src/components/search/SchoolCard.tsx
+++ b/src/components/search/SchoolCard.tsx
@@ -1,8 +1,7 @@
import React, {useState} from 'react';
import styled from 'styled-components/native';
import {Logo_Img, Bookmark} from '../../assets';
-import {Font} from '../../styles/font';
-import {color} from '../../styles/color';
+import {Font, color} from '@/styles';
import StarRating from '../StarRating';
interface PropsType {
@@ -23,7 +22,10 @@ export default function SchoolCard({
return (
-
+
+
+
+
@@ -41,7 +43,8 @@ export default function SchoolCard({
setPressBookmark(!pressBookmark)}>
@@ -77,3 +80,13 @@ const ReviewWrap = styled.View`
const BookMarkBox = styled.TouchableOpacity`
padding: 4px;
`;
+
+const ImageBox = styled.View`
+ border-radius: 6px;
+ border: 1px solid ${color.gray100};
+ width: 48px;
+ height: 48px;
+ background-color: ${color.gray50};
+ justify-content: center;
+ align-items: center;
+`;
diff --git a/src/components/signup/SchoolList.tsx b/src/components/signup/SchoolList.tsx
index 6437cf0..0376cdf 100644
--- a/src/components/signup/SchoolList.tsx
+++ b/src/components/signup/SchoolList.tsx
@@ -1,8 +1,7 @@
import React from 'react';
import styled from 'styled-components/native';
-import {color} from '../../styles/color';
+import {color, Font} from '@/styles';
import {Arrow, Logo_Img} from '../../assets';
-import {Font} from '../../styles/font';
interface ListPropsType {
img?: string;
diff --git a/tsconfig.json b/tsconfig.json
index 304ab4e..bc2d73e 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,3 +1,20 @@
{
+ "compilerOptions": {
+ // "paths": {
+ // "@components": ["./src/components/index"],
+ // "@apis": ["./src/apis/index"],
+ // "@assets": ["./src/assets/index"],
+ // "@interfaces": ["./src/interfaces/index"],
+ // "@styles": ["./src/styles/index"],
+ // "@types": ["./src/types/index"],
+ // "@utils": ["./src/utils/index"]
+ // }
+ "skipLibCheck": true,
+ "baseUrl": ".",
+ "paths": {
+ "@/*": ["src/*"],
+ "@components/*": ["src/components/*"]
+ }
+ },
"extends": "@react-native/typescript-config/tsconfig.json"
}