diff --git a/package-lock.json b/package-lock.json index e7ce9c8..bc575ad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5128,6 +5128,7 @@ "@jest/types": "^24.9.0", "anymatch": "^2.0.0", "fb-watchman": "^2.0.0", + "fsevents": "^1.2.7", "graceful-fs": "^4.1.15", "invariant": "^2.2.4", "jest-serializer": "^24.9.0", diff --git a/src/App.tsx b/src/App.tsx index 2477dca..44ddc6e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,12 +1,12 @@ -import { StatusBar } from 'expo-status-bar'; -import React from 'react'; -import { StyleSheet, Text, View } from 'react-native'; -import FindFriends from './pages/find-friends.component'; -import { NavigationContainer } from '@react-navigation/native'; -import { createStackNavigator } from '@react-navigation/stack'; -import { registerRootComponent } from 'expo'; -import { useFonts } from '@expo-google-fonts/nunito-sans'; -import * as NunitoSans from '@expo-google-fonts/nunito-sans'; +import { StatusBar } from "expo-status-bar"; +import React from "react"; +import { StyleSheet, Text, View } from "react-native"; +import FindFriends from "./pages/find-friends.component"; +import { NavigationContainer } from "@react-navigation/native"; +import { createStackNavigator } from "@react-navigation/stack"; +import { registerRootComponent } from "expo"; +import { useFonts } from "@expo-google-fonts/nunito-sans"; +import * as NunitoSans from "@expo-google-fonts/nunito-sans"; const Stack = createStackNavigator(); function App() { @@ -16,7 +16,7 @@ function App() { { + const styles = StyleSheet.create({ + button: { + backgroundColor, + height: BUTTON_HEIGHT * size + "%", + width: BUTTON_WIDTH * size + "%", + borderRadius: borderType * size, + borderWidth: 0, + justifyContent: "center", + }, + text: { + color: textColor, + fontSize: Styles.FONT_SIZE * size, + textAlign: "center", + fontFamily: "NunitoSans_600SemiBold", + }, + }); + if ("height" in overriddenStyles) { + styles.button.height = overriddenStyles.height; + } + if ("width" in overriddenStyles) { + styles.button.width = overriddenStyles.width; + } + return ( + + {text} + + ); +}; +export default Button; + +// Sample usage: +// diff --git a/src/pages/find-friends.component.tsx b/src/pages/find-friends.component.tsx index daf4db6..5e6b0cf 100644 --- a/src/pages/find-friends.component.tsx +++ b/src/pages/find-friends.component.tsx @@ -1,14 +1,15 @@ -import React from 'react'; -import { Pressable, StyleSheet, Text, View, TextInput } from 'react-native'; -import Page from '../components/Page.component'; - +import React from "react"; +import { Pressable, StyleSheet, Text, View, TextInput } from "react-native"; +import Page from "../components/Page.component"; +import * as Styles from "../Styles"; +import Button from "../components/Button"; export default function HomePage() { return ( find friends - + - {'search'} + {"search"} ); @@ -17,44 +18,44 @@ export default function HomePage() { const styles = StyleSheet.create({ container: { flex: 1, - backgroundColor: '#023237', - alignItems: 'center', - justifyContent: 'center', + backgroundColor: "#023237", + alignItems: "center", + justifyContent: "center", }, title: { - color: '#FFC65C', + color: "#FFC65C", fontSize: 40, - fontStyle: 'italic', - fontWeight: 'bold', + fontStyle: "italic", + fontWeight: "bold", textShadowOffset: { width: 5, height: 5 }, textShadowRadius: 10, - textShadowColor: '#998440', + textShadowColor: "#998440", }, input: { - backgroundColor: '#89C1D2', - placeholderTextColor: '#000', + backgroundColor: "#89C1D2", + placeholderTextColor: "#000", fontSize: 25, - fontStyle: 'italic', - fontWeight: 'bold', + fontStyle: "italic", + fontWeight: "bold", borderRadius: 27, paddingHorizontal: 50, paddingVertical: 10, marginVertical: 10, - textAlign: 'center', + textAlign: "center", }, button: { - backgroundColor: '#107E7B', + backgroundColor: "#107E7B", borderRadius: 50, paddingHorizontal: 50, paddingVertical: 10, marginVertical: 10, - width: '75%', + width: "75%", }, text: { - color: '#FFF', + color: "#FFF", fontSize: 50, - fontStyle: 'italic', - fontWeight: 'bold', - textAlign: 'center', + fontStyle: "italic", + fontWeight: "bold", + textAlign: "center", }, });