Skip to content

Commit

Permalink
Set up mobile development environment and directory structure
Browse files Browse the repository at this point in the history
  • Loading branch information
hee-suh committed Feb 17, 2022
1 parent 7fa0026 commit 267990c
Show file tree
Hide file tree
Showing 20 changed files with 6,065 additions and 0 deletions.
4 changes: 4 additions & 0 deletions react-native/.expo-shared/assets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"12bb71342c6255bbf50437ec8f4441c083f47cdb74bd89160c15e4f43e52a1cb": true,
"40b842e832070c58deac6aa9e08fa459302ee3f9da492c7e77d93d2fbf4a56fd": true
}
14 changes: 14 additions & 0 deletions react-native/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
node_modules/
.expo/
dist/
npm-debug.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision
*.orig.*
web-build/

# macOS
.DS_Store
45 changes: 45 additions & 0 deletions react-native/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import * as React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { Provider as PaperProvider } from 'react-native-paper';
import { theme } from './core/theme';
import LoginScreen from './screens/LoginScreen';
import JoinScreen from './screens/JoinScreen';
import ForgotPasswordScreen from './screens/ForgotPasswordScreen';
import HomeScreen from './screens/HomeScreen';

const Stack = createNativeStackNavigator();

export default function App() {
return (
<PaperProvider theme={theme}>
<NavigationContainer>
<Stack.Navigator
initialRouteName="Login"
screenOptions={{
contentStyle: { backgroundColor: '#fff' }
}}
>
<Stack.Screen
name="Login"
component={LoginScreen}
options={{headerShown: false}}
/>
<Stack.Screen
name="Join"
component={JoinScreen}
/>
<Stack.Screen
name="ForgotPassword"
component={ForgotPasswordScreen}
/>
<Stack.Screen
name="Home"
component={HomeScreen}
options={{headerShown: false}}
/>
</Stack.Navigator>
</NavigationContainer>
</PaperProvider>
);
}
32 changes: 32 additions & 0 deletions react-native/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"expo": {
"name": "NotiNote",
"slug": "NotiNote",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#FFFFFF"
}
},
"web": {
"favicon": "./assets/favicon.png"
}
}
}
Binary file added react-native/assets/images/adaptive-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added react-native/assets/images/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added react-native/assets/images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added react-native/assets/images/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions react-native/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
};
};
12 changes: 12 additions & 0 deletions react-native/constants/Layout.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Dimensions } from 'react-native';

const width = Dimensions.get('window').width;
const height = Dimensions.get('window').height;

export default {
window: {
width,
height,
},
isSmallDevice: width < 375,
};
15 changes: 15 additions & 0 deletions react-native/core/theme.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { DefaultTheme } from 'react-native-paper';

export const theme = {
...DefaultTheme,
colors: {
...DefaultTheme.colors,
primary: '#333D79',
accent: '#FAEBEF',
secondary: '#C4C4C4',
text: '#343a40',
surface: '#fff',
background: '#fff',
error: '#f13a59',
},
};
Empty file added react-native/core/utils.tsx
Empty file.
39 changes: 39 additions & 0 deletions react-native/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "notinote",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"@react-navigation/native": "^6.0.8",
"@react-navigation/native-stack": "^6.5.0",
"expo": "~44.0.0",
"expo-status-bar": "~1.2.0",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-native": "0.64.3",
"react-native-paper": "^4.11.2",
"react-native-safe-area-context": "3.3.2",
"react-native-screens": "~3.10.1",
"react-native-vector-icons": "^9.1.0",
"react-native-web": "0.17.1",
"react-navigation": "^4.4.4",
"react-navigation-stack": "^2.10.4",
"react-redux": "^7.2.6",
"redux": "^4.1.2"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@types/react": "~17.0.21",
"@types/react-native": "~0.64.12",
"@types/react-redux": "^7.1.22",
"@types/redux": "^3.6.0",
"typescript": "~4.3.5"
},
"private": true
}
11 changes: 11 additions & 0 deletions react-native/screens/ForgotPasswordScreen.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import * as React from 'react';
import { StyleSheet, Text, View, Button } from 'react-native';
import type { Navigation } from '../types';

export default function ForgotPasswordScreen({ navigation }: Navigation) {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>Forgot Password Screen</Text>
</View>
);
}
15 changes: 15 additions & 0 deletions react-native/screens/HomeScreen.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import * as React from 'react';
import { StyleSheet, Text, View, Button } from 'react-native';
import type { Navigation } from '../types';

export default function HomeScreen({ navigation }: Navigation) {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>Home Screen</Text>
<Button
title="Logout"
onPress={() => navigation.navigate('Login')}
/>
</View>
);
};
11 changes: 11 additions & 0 deletions react-native/screens/JoinScreen.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import * as React from 'react';
import { StyleSheet, Text, View, Button } from 'react-native';
import type { Navigation } from '../types';

export default function JoinScreen({ navigation }: Navigation) {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>Join Screen</Text>
</View>
);
}
13 changes: 13 additions & 0 deletions react-native/screens/LoginScreen.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React, { useState } from 'react';
import { StyleSheet, Text, SafeAreaView, View, Alert, Image } from 'react-native';
import { TextInput, Button } from 'react-native-paper';
import { theme } from '../core/theme';
import type { Navigation } from '../types';

export default function LoginScreen({ navigation }: Navigation) {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>Login Screen</Text>
</View>
);
}
6 changes: 6 additions & 0 deletions react-native/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "expo/tsconfig.base",
"compilerOptions": {
"strict": true
}
}
15 changes: 15 additions & 0 deletions react-native/types.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { NativeStackScreenProps } from '@react-navigation/native-stack';

export type RootStackParamList = {
Login: undefined;
Join: undefined;
ForgotPassword: undefined;
Home: undefined;
};

export type Navigation = NativeStackScreenProps<RootStackParamList, 'Home'>;

export type TextInput = {
errorText: string;
description: string;
}
Loading

0 comments on commit 267990c

Please sign in to comment.