Fakultas Ilmu Komputer UI

RegisterGoogleFacebookScreen.tsx 4.16 KB
Newer Older
1
2
import { Text, View } from "../../components/Themed";
import * as React from "react";
3
import { useState, useEffect } from "react";
4
5
6
7
8
9
import { ScrollView, StyleSheet } from "react-native";
import PlainForm from "../../components/Forms/PlainForm";
import Spacer from "../../components/Spacer/Spacer";
import MainButton from "../../components/button/MainButton";
import Colors from "../../constants/Colors";
import DropdownForm from "../../components/Forms/DropdownForm";
angelin depthios's avatar
angelin depthios committed
10
import { RootTabScreenProps } from "../../types/navigation";
11
12
import { getCategoriesAsDdFormat } from "../../helpers/ddConverter";
import { IDD } from "../../types/firestore";
13

angelin depthios's avatar
angelin depthios committed
14
const RegisterGoogleFacebookScreen = ({
15
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
angelin depthios's avatar
angelin depthios committed
16
17
  navigation,
}: RootTabScreenProps<"TabOne">) => {
18
19
20
21
  const [firstName, setFirstName] = useState("");
  const [lastName, setLastName] = useState("");
  const [phoneNo, setPhoneNo] = useState("");
  const [picked, setPicked] = useState("");
22
23
24
25
  const [categories, setCategories] = useState<IDD[]>([]);
  useEffect(() => {
    getCategoriesAsDdFormat().then((res) => setCategories(res));
  });
26

27
  return (
28
29
    <View style={styles.container}>
      <ScrollView nestedScrollEnabled={true}>
30
31
32
33
34
35
36
37
38
39
        <View>
          <Text style={styles.titleText}>Selamat Datang!</Text>
        </View>
        <Spacer variant={"xl"} />
        <View>
          <Text style={styles.description}>
            Silakan isi formulir berikut untuk membuat akun Click
          </Text>
        </View>
        <Spacer variant={"xl"} />
Bagus Prabowo's avatar
Bagus Prabowo committed
40
        <View style={styles.componentWrapper}>
41
42
43
44
45
46
47
48
49
          <PlainForm
            formTitle={"Nama Depan"}
            text={firstName}
            setText={setFirstName}
            placeholder={"Masukkan Nama Depan"}
            disabled
          />
        </View>
        <Spacer variant={"l"} />
Bagus Prabowo's avatar
Bagus Prabowo committed
50
        <View style={styles.componentWrapper}>
51
52
53
54
55
56
57
58
59
          <PlainForm
            formTitle={"Nama Belakang"}
            text={lastName}
            setText={setLastName}
            placeholder={"Masukkan Nama Belakang"}
            disabled
          />
        </View>
        <Spacer variant={"l"} />
Bagus Prabowo's avatar
Bagus Prabowo committed
60
        <View style={styles.componentWrapper}>
61
62
63
64
65
66
          <PlainForm
            formTitle={"No. Handphone"}
            text={phoneNo}
            setText={setPhoneNo}
            placeholder={"Masukkan No. Handphone"}
            phone
Bagus Prabowo's avatar
Bagus Prabowo committed
67
            errorMessage={"Silahkan masukkan no. handphone"}
68
69
70
          />
        </View>
        <Spacer variant={"l"} />
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
      </ScrollView>
      <View style={styles.titleContainer} testID="TitleContainer">
        <Text style={styles.formTitle} testID="Title">
          Kategori Bisnis
        </Text>
      </View>
      <DropdownForm
        formPlaceholder={"Kategori Bisnis"}
        searchPlaceholder={"Cari Kategori Bisnis"}
        value={picked}
        setValue={setPicked}
        items={categories}
        setItems={setCategories}
      />
      <Spacer variant={"l"} />
      <View>
        <Text style={styles.textView}>
          Dengan membuat akun Click, saya telah setuju dengan Syarat & Ketentuan
          serta Kebijakan Privasi yang telah ditetapkan oleh Click.
        </Text>
      </View>
      <Spacer variant={"l"} />
93
      <View style={styles.componentWrapper}>
94
        <MainButton text="Daftar" colors="primary" onPress={() => {}} />
95
      </View>
96
97
      <Spacer variant={"xl"} />
    </View>
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    fontStyle: "normal",
    display: "flex",
    backgroundColor: Colors.background,
    paddingHorizontal: 24,
  },
  titleText: {
    fontSize: 32,
    fontStyle: "normal",
    fontWeight: "400",
    letterSpacing: 0,
    textAlign: "left",
    paddingTop: 50,
  },
  description: {
    fontSize: 20,
    fontStyle: "normal",
    fontWeight: "300",
    letterSpacing: 0,
    textAlign: "left",
  },
  textView: {
    fontSize: 14,
    fontStyle: "normal",
    fontWeight: "300",
    letterSpacing: 0,
    textAlign: "left",
  },
131
132
133
134
135
136
137
138
  titleContainer: {
    paddingBottom: 8,
  },
  formTitle: {
    fontSize: 14,
    width: "100%",
    color: Colors.text.subtitle,
  },
Bagus Prabowo's avatar
Bagus Prabowo committed
139
  componentWrapper: {
140
141
142
143
144
    width: "100%",
  },
});

export default RegisterGoogleFacebookScreen;