Fakultas Ilmu Komputer UI

RegisterGoogleFacebookScreen.tsx 4.62 KB
Newer Older
1
2
import { Text, View } from "../../components/Themed";
import * as React from "react";
3
import { useState } 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

angelin depthios's avatar
angelin depthios committed
12
const RegisterGoogleFacebookScreen = ({
13
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
angelin depthios's avatar
angelin depthios committed
14
15
  navigation,
}: RootTabScreenProps<"TabOne">) => {
16
17
18
19
  const [firstName, setFirstName] = useState("");
  const [lastName, setLastName] = useState("");
  const [phoneNo, setPhoneNo] = useState("");
  const [picked, setPicked] = useState("");
20
21
22
23
24
25
  const [categories, setCategories] = useState([
    { label: "Agrikultur", value: "B" },
    { label: "Pertanian", value: "D" },
    { label: "Pertambangan", value: "E" },
    { label: "Perikanan", value: "F" },
    { label: "Real Estat", value: "G" },
26
27
28
29
30
31
    { label: "Makanan dan Minuman", value: "H" },
    { label: "Otomotif", value: "I" },
    { label: "Industri Berat", value: "J" },
    { label: "Pengolahan Bahan Mentah", value: "K" },
    { label: "Distributor", value: "L" },
    { label: "Pasar Modal", value: "M" },
32
33
34
35
36
37
38
39
40
  ]);
  // const [categories, setCategories] = useState<IDD[]>();
  //
  // useEffect(() => {
  //   getCategories().then((res) =>
  //     setCategories(ddConverter<ICategory>("name", "id", res))
  //   );
  // }, []);

41
  return (
42
43
    <View style={styles.container}>
      <ScrollView nestedScrollEnabled={true}>
44
45
46
47
48
49
50
51
52
53
        <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
54
        <View style={styles.componentWrapper}>
55
56
57
58
59
60
61
62
63
          <PlainForm
            formTitle={"Nama Depan"}
            text={firstName}
            setText={setFirstName}
            placeholder={"Masukkan Nama Depan"}
            disabled
          />
        </View>
        <Spacer variant={"l"} />
Bagus Prabowo's avatar
Bagus Prabowo committed
64
        <View style={styles.componentWrapper}>
65
66
67
68
69
70
71
72
73
          <PlainForm
            formTitle={"Nama Belakang"}
            text={lastName}
            setText={setLastName}
            placeholder={"Masukkan Nama Belakang"}
            disabled
          />
        </View>
        <Spacer variant={"l"} />
Bagus Prabowo's avatar
Bagus Prabowo committed
74
        <View style={styles.componentWrapper}>
75
76
77
78
79
80
          <PlainForm
            formTitle={"No. Handphone"}
            text={phoneNo}
            setText={setPhoneNo}
            placeholder={"Masukkan No. Handphone"}
            phone
Bagus Prabowo's avatar
Bagus Prabowo committed
81
            errorMessage={"Silahkan masukkan no. handphone"}
82
83
84
          />
        </View>
        <Spacer variant={"l"} />
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
      </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"} />
107
      <View style={styles.componentWrapper}>
108
        <MainButton text="Daftar" colors="primary" onPress={() => {}} />
109
      </View>
110
111
      <Spacer variant={"xl"} />
    </View>
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
  );
};

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",
  },
145
146
147
148
149
150
151
152
  titleContainer: {
    paddingBottom: 8,
  },
  formTitle: {
    fontSize: 14,
    width: "100%",
    color: Colors.text.subtitle,
  },
Bagus Prabowo's avatar
Bagus Prabowo committed
153
  componentWrapper: {
154
155
156
157
158
    width: "100%",
  },
});

export default RegisterGoogleFacebookScreen;