mirror of
https://github.com/lemeow125/StudE-Frontend.git
synced 2024-11-17 06:19:25 +08:00
Fixed buttons
This commit is contained in:
parent
e67485d247
commit
0247afe553
3 changed files with 8 additions and 10 deletions
|
@ -9,16 +9,12 @@ export interface props {
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Button({
|
export default function Button({ disabled = false, ...props }: props) {
|
||||||
disabled = false,
|
|
||||||
color = "rgba(52, 52, 52, 0.8)",
|
|
||||||
...props
|
|
||||||
}: props) {
|
|
||||||
return (
|
return (
|
||||||
<Pressable
|
<Pressable
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
onPress={props.onPress}
|
onPress={props.onPress}
|
||||||
style={styles.button_template}
|
style={{ ...styles.button_template, ...{ backgroundColor: props.color } }}
|
||||||
>
|
>
|
||||||
{props.children}
|
{props.children}
|
||||||
</Pressable>
|
</Pressable>
|
||||||
|
|
|
@ -15,7 +15,7 @@ import {
|
||||||
UserInfoParams,
|
UserInfoParams,
|
||||||
Semester,
|
Semester,
|
||||||
} from "../../interfaces/Interfaces";
|
} from "../../interfaces/Interfaces";
|
||||||
import AnimatedContainer from "../../components/AnimatedContainer/AnimatedContainer";
|
import Button from "../../components/Button/Button";
|
||||||
import { TouchableOpacity, Image } from "react-native";
|
import { TouchableOpacity, Image } from "react-native";
|
||||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||||
import {
|
import {
|
||||||
|
@ -215,14 +215,15 @@ export default function UserInfoPage() {
|
||||||
setOpen={(open) => setSubjectsOpen(open)}
|
setOpen={(open) => setSubjectsOpen(open)}
|
||||||
setValue={setSelectedSubjects}
|
setValue={setSelectedSubjects}
|
||||||
placeholder="Subjects"
|
placeholder="Subjects"
|
||||||
|
placeholderStyle={styles.text_white_tiny}
|
||||||
style={styles.input}
|
style={styles.input}
|
||||||
textStyle={styles.text_white_small_bold}
|
textStyle={styles.text_white_small_bold}
|
||||||
dropDownContainerStyle={{ backgroundColor: "white" }}
|
dropDownContainerStyle={{ backgroundColor: "white" }}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<TouchableOpacity
|
<Button
|
||||||
style={styles.button_template}
|
color={colors.secondary_3}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
if (isEditable) {
|
if (isEditable) {
|
||||||
mutation.mutate({
|
mutation.mutate({
|
||||||
|
@ -240,7 +241,7 @@ export default function UserInfoPage() {
|
||||||
<Text style={styles.text_white_small}>
|
<Text style={styles.text_white_small}>
|
||||||
{isEditable && StudentInfo.isSuccess ? "Save" : "Edit Profile"}
|
{isEditable && StudentInfo.isSuccess ? "Save" : "Edit Profile"}
|
||||||
</Text>
|
</Text>
|
||||||
</TouchableOpacity>
|
</Button>
|
||||||
</AnimatedContainerNoScroll>
|
</AnimatedContainerNoScroll>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
|
|
@ -148,6 +148,7 @@ const styles = StyleSheet.create({
|
||||||
overflow: "hidden",
|
overflow: "hidden",
|
||||||
},
|
},
|
||||||
input: {
|
input: {
|
||||||
|
paddingHorizontal: 8,
|
||||||
marginVertical: 12,
|
marginVertical: 12,
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
color: colors.text_default,
|
color: colors.text_default,
|
||||||
|
|
Loading…
Reference in a new issue