Skip to content

Commit 8b2c4ef

Browse files
author
YONGJAE LEE
committed
[#60] 코드 리팩토링을 하라
**테스트 코드 작성 전까지 컴포넌트 분리 및 코드 정리** - [x] style 파일 정리 및 구조화 - [x] 쓸모없는 주석 제거 - [x] 컴포넌트 분리
1 parent 897aca3 commit 8b2c4ef

51 files changed

Lines changed: 740 additions & 1010 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

App.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import App from './src/App';
1+
import Index from './src/Index';
22

33
const STORYBOOK_START = false;
44
/* eslint-disable global-require */
55
export default STORYBOOK_START ? require('./storybook').default
6-
: App;
6+
: Index;
77
/* eslint-enable global-require */

package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,17 @@
1414
"styled-components": "^5"
1515
},
1616
"dependencies": {
17+
"@babel/plugin-proposal-class-properties": "^7.10.4",
18+
"@babel/plugin-syntax-jsx": "^7.10.4",
19+
"@babel/plugin-transform-react-jsx": "^7.10.4",
20+
"@babel/preset-react": "^7.10.4",
1721
"@emotion/core": "^10.0.34",
1822
"@emotion/native": "^10.0.27",
1923
"@emotion/styled": "^10.0.27",
24+
"@expo-google-fonts/inter": "^0.1.0",
25+
"@expo-google-fonts/nanum-gothic-coding": "^0.1.0",
26+
"@expo-google-fonts/nanum-myeongjo": "^0.1.0",
27+
"@expo-google-fonts/nunito": "^0.1.0",
2028
"@fortawesome/free-solid-svg-icons": "^5.14.0",
2129
"@fortawesome/react-fontawesome": "^0.1.11",
2230
"@react-native-community/masked-view": "^0.1.10",
@@ -34,6 +42,7 @@
3442
"expo": "~38.0.1",
3543
"expo-auth-session": "~1.4.0",
3644
"expo-camera": "~8.3.1",
45+
"expo-font": "~8.2.1",
3746
"expo-location": "~8.2.1",
3847
"expo-random": "~8.2.1",
3948
"expo-status-bar": "^1.0.0",

src/App.jsx

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/Index.jsx

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/* eslint-disable camelcase */
2+
import React from 'react';
3+
4+
import { ActivityIndicator, Text } from 'react-native';
5+
6+
import { Provider } from 'react-redux';
7+
8+
import { useFonts, Nunito_900Black } from '@expo-google-fonts/nunito';
9+
import { NanumGothicCoding_700Bold } from '@expo-google-fonts/nanum-gothic-coding';
10+
11+
import store from './store';
12+
13+
import RootStackNavigator from './components/navigation/RootStackNavigator';
14+
15+
import { CenterView } from './components/constants';
16+
17+
export default function Index() {
18+
const [fontsLoaded] = useFonts({
19+
Nunito_900Black,
20+
NanumGothicCoding_700Bold,
21+
});
22+
23+
if (!fontsLoaded) {
24+
return (
25+
<CenterView>
26+
<ActivityIndicator color="black" size="large" />
27+
<Text>aa</Text>
28+
</CenterView>
29+
);
30+
}
31+
32+
return (
33+
<Provider store={store}>
34+
<RootStackNavigator />
35+
</Provider>
36+
);
37+
}

src/assets/Beta.png

-7.84 KB
Binary file not shown.

src/assets/Doctor.png

-36.9 KB
Binary file not shown.

src/assets/PetEnroll.png

-12.1 KB
Binary file not shown.

src/assets/Search.png

-6.16 KB
Binary file not shown.
-6.16 KB
Binary file not shown.

src/components/constants.js

Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,20 @@
11
import styled from '@emotion/native';
22

3-
export const constantsValue = {
4-
COLOR_SECONDARY: '#71C0BB',
5-
COLOR_LIGHT: '#808080',
6-
COLOR_LIGHTER: '#EEEEEE',
7-
COLOR_LIGHTEST: '#FFF',
8-
COLOR_PRIMARY: '#f44336',
9-
COLOR_RED: '#c43a31',
10-
COLOR_GREEN: '#BBF1C4',
11-
FONTSIZE_BIGGEST: 35,
12-
FONTSIZE_BIGGER: 25,
13-
FONTSIZE_BIG: 22,
14-
FONTSIZE_SMALL: 17,
15-
FONTSIZE_SMALLER: 15,
16-
FONTSIZE_SAMALLEST: 12,
17-
MAX_HEIGHT: 768,
18-
MAX_WIDTH: 512,
19-
};
20-
21-
const {
22-
// COLOR_SECONDARY,
23-
// COLOR_LIGHT,
24-
// COLOR_LIGHTER,
25-
COLOR_LIGHTEST,
26-
// COLOR_PRIMARY,
27-
// FONTSIZE_BIGGEST,
28-
// FONTSIZE_BIGGER,
29-
FONTSIZE_BIG,
30-
FONTSIZE_SMALL,
31-
// FONTSIZE_SMALLER,
32-
FONTSIZE_SMALLEST,
33-
} = constantsValue;
3+
export const COLOR_SECONDARY = '#71C0BB';
4+
export const COLOR_LIGHT = '#808080';
5+
export const COLOR_LIGHTER = '#EEEEEE';
6+
export const COLOR_LIGHTEST = '#FFF';
7+
export const COLOR_PRIMARY = '#f44336';
8+
export const COLOR_RED = '#c43a31';
9+
export const COLOR_GREEN = '#BBF1C4';
10+
export const FONTSIZE_BIGGEST = 35;
11+
export const FONTSIZE_BIGGER = 25;
12+
export const FONTSIZE_BIG = 22;
13+
export const FONTSIZE_SMALL = 17;
14+
export const FONTSIZE_SMALLER = 15;
15+
export const FONTSIZE_SMALLEST = 12;
16+
export const MAX_HEIGHT = 768;
17+
export const MAX_WIDTH = 512;
3418

3519
export const Container = styled.SafeAreaView({
3620
flex: 1,
@@ -40,14 +24,17 @@ export const Container = styled.SafeAreaView({
4024
});
4125

4226
export const TextWrap = styled.Text({
27+
fontFamily: 'NanumGothicCoding_700Bold',
4328
fontSize: FONTSIZE_SMALLEST,
4429
});
4530

4631
export const TextWrapBig = styled.Text({
32+
fontFamily: 'NanumGothicCoding_700Bold',
4733
fontSize: FONTSIZE_BIG,
4834
});
4935

5036
export const TextWrapBold = styled.Text({
37+
fontFamily: 'NanumGothicCoding_700Bold',
5138
fontWeight: 'bold',
5239
fontSize: FONTSIZE_SMALL,
5340
marginBottom: '5%',
@@ -56,3 +43,9 @@ export const TextWrapBold = styled.Text({
5643
export const TextWrapContainer = styled.View({
5744
marginTop: '7%',
5845
});
46+
47+
export const CenterView = styled.View({
48+
flex: 1,
49+
justifyContent: 'center',
50+
alignItems: 'center',
51+
});

0 commit comments

Comments
 (0)