Compare commits

...

3 Commits

Author SHA1 Message Date
c2c3821ce2 Working on login screen 2024-05-05 17:44:42 +02:00
77e5082680 Added: web support 2024-05-04 00:16:27 +02:00
3a7b83b990 Added: base expo installation 2024-05-04 00:13:58 +02:00
14 changed files with 14485 additions and 0 deletions

35
frontend/.gitignore vendored Normal file
View File

@ -0,0 +1,35 @@
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
# dependencies
node_modules/
# Expo
.expo/
dist/
web-build/
# Native
*.orig.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision
# Metro
.metro-health-check*
# debug
npm-debug.*
yarn-debug.*
yarn-error.*
# macOS
.DS_Store
*.pem
# local env files
.env*.local
# typescript
*.tsbuildinfo

18
frontend/App.js Normal file
View File

@ -0,0 +1,18 @@
import { StatusBar } from "expo-status-bar";
import { StyleSheet, Text, View } from "react-native";
import { LoginForm } from "./screens/Login";
export default function App() {
return (
<View style={styles.container}>
<StatusBar style="light" />
<LoginForm />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
});

30
frontend/app.json Normal file
View File

@ -0,0 +1,30 @@
{
"expo": {
"name": "deguapp",
"slug": "deguapp",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#ffffff"
}
},
"web": {
"favicon": "./assets/favicon.png"
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
frontend/assets/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
frontend/assets/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
frontend/assets/splash.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

6
frontend/babel.config.js Normal file
View File

@ -0,0 +1,6 @@
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
};
};

View File

@ -0,0 +1,33 @@
import React from "react";
import { Text, StyleSheet, Pressable } from "react-native";
export default function Button(props) {
const { onPress, title = "Save", color = "black" } = props;
return (
<Pressable
style={[styles.button, { backgroundColor: color }]}
onPress={onPress}
>
<Text style={styles.text}>{title}</Text>
</Pressable>
);
}
const styles = StyleSheet.create({
button: {
alignItems: "center",
justifyContent: "center",
paddingVertical: 12,
paddingHorizontal: 32,
borderRadius: 4,
elevation: 3,
backgroundColor: "black",
},
text: {
fontSize: 16,
lineHeight: 21,
fontWeight: "bold",
letterSpacing: 0.25,
color: "white",
},
});

View File

View File

@ -0,0 +1,8 @@
export const colors = {
gold: "#FFD700ff",
brown: "#8B4513ff",
green: "#228B22ff",
charcoal: "#2C3E50ff",
black: "#020405ff",
dark: "#010611",
};

14265
frontend/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

24
frontend/package.json Normal file
View File

@ -0,0 +1,24 @@
{
"name": "deguapp",
"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"
},
"dependencies": {
"expo": "~50.0.17",
"expo-status-bar": "~1.11.1",
"react": "18.2.0",
"react-native": "0.73.6",
"react-native-web": "~0.19.6",
"react-dom": "18.2.0",
"@expo/metro-runtime": "~3.1.3"
},
"devDependencies": {
"@babel/core": "^7.20.0"
},
"private": true
}

66
frontend/screens/Login.js Normal file
View File

@ -0,0 +1,66 @@
import {
StyleSheet,
TouchableOpacity,
TextInput,
View,
Text,
} from "react-native";
import Button from "../components/Button";
import { colors } from "../components/style";
export function LoginForm() {
return (
<View style={styles.container}>
<Text style={styles.header}>Please Log In</Text>
<TextInput
style={styles.input}
placeholder="Enter your email"
autoCapitalize="none"
autoCompleteType="email"
textContentType="emailAddress"
keyboardType="email-address"
placeholderTextColor={"#aaaaaa"}
returnKeyType="next"
/>
<TextInput
style={styles.input}
secureTextEntry={true}
placeholder="Enter your password"
placeholderTextColor={"#aaaaaa"}
returnKeyType="done"
/>
<View style={styles.btnContainer}>
<Button style={styles.button} title="Sign Up" color={colors.charcoal} />
<Button style={styles.button} title="Log In" color={colors.green} />
</View>
</View>
);
}
const styles = StyleSheet.create({
container: {
backgroundColor: colors.dark,
flex: 1,
gap: 15,
alignItems: "center",
justifyContent: "center",
width: "100%",
},
header: {
color: "#FFF",
fontSize: 22,
},
input: {
height: "auto",
width: "60%",
borderColor: "gray",
borderWidth: 1,
borderRadius: 5,
padding: 10,
},
button: {},
btnContainer: {
flexDirection: "row",
gap: 10,
},
});