Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add LargeTextButton #300

Merged
merged 2 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions client/app/components/auth/LargeTextButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React from "react";
import { StyleSheet, Text, TouchableOpacity, Dimensions } from "react-native";

import { LargeTextButtonProps } from "../../types/Props";

const LargeTextButton: React.FC<LargeTextButtonProps> = ({ onPress, buttonText }) => {
return (
<TouchableOpacity style={styles.button} onPress={onPress}>
<Text style={styles.button_text}>{buttonText}</Text>
</TouchableOpacity>
);
};

const styles = StyleSheet.create({
button: {
backgroundColor: "#5dbea3",
width: Dimensions.get("window").width * 0.5,
height: Dimensions.get("window").height * 0.05,
display: "flex",
justifyContent: "center",
alignItems: "center",
borderRadius: 10,
},

button_text: {
color: "white",
fontFamily: "Gilroy-ExtraBold",
fontSize: Dimensions.get("window").height * 0.03,
},
});

export default LargeTextButton;
24 changes: 2 additions & 22 deletions client/app/components/auth/LogInButton.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,12 @@
import React from "react";
import { StyleSheet, Text, TouchableOpacity, Dimensions } from "react-native";

import { LogInButtonProps } from "../../types/Props";
import LargeTextButton from "./LargeTextButton"

const LogInButton: React.FC<LogInButtonProps> = ({ onPress }) => {
return (
dyland88 marked this conversation as resolved.
Show resolved Hide resolved
<TouchableOpacity style={styles.button} onPress={onPress}>
<Text style={styles.button_text}>Log In</Text>
</TouchableOpacity>
<LargeTextButton onPress={onPress} buttonText="Log In" />
);
};

const styles = StyleSheet.create({
button: {
backgroundColor: "#5dbea3",
width: Dimensions.get("window").width * 0.5,
height: Dimensions.get("window").height * 0.05,
display: "flex",
justifyContent: "center",
alignItems: "center",
borderRadius: 10,
},

button_text: {
color: "white",
fontFamily: "Gilroy-ExtraBold",
fontSize: Dimensions.get("window").height * 0.03,
},
});

export default LogInButton;
24 changes: 2 additions & 22 deletions client/app/components/auth/SignUpButton.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,12 @@
import React from "react";
import { StyleSheet, Text, TouchableOpacity, Dimensions } from "react-native";
import LargeTextButton from "./LargeTextButton";

import { SignUpButtonProps } from "../../types/Props";

const SignUpButton: React.FC<SignUpButtonProps> = ({ onPress }) => {
return (
<TouchableOpacity style={styles.button} onPress={onPress}>
<Text style={styles.button_text}>Sign Up</Text>
</TouchableOpacity>
<LargeTextButton onPress={onPress} buttonText="Sign Up"/>
);
};

const styles = StyleSheet.create({
button: {
backgroundColor: "#5dbea3",
width: Dimensions.get("window").width * 0.5,
height: Dimensions.get("window").height * 0.05,
display: "flex",
justifyContent: "center",
alignItems: "center",
borderRadius: 10,
},

button_text: {
color: "white",
fontFamily: "Gilroy-ExtraBold",
fontSize: Dimensions.get("window").height * 0.03,
},
});

export default SignUpButton;
5 changes: 5 additions & 0 deletions client/app/types/Props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ import React from "react";
import { Message } from "./Message";

/* button props */
export type LargeTextButtonProps = {
onPress?: () => void;
buttonText: string;
}

export type LogInButtonProps = {
onPress?: () => void;
};
Expand Down