Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
PPL KI Ganjil 2021 2022
Clicks - Ecosystem Business
clicks-frontend
Commits
dab51d0b
Commit
dab51d0b
authored
Sep 30, 2021
by
Bagus Prabowo
Browse files
Dropdown fix
parent
9a815414
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/components/Forms/DropdownForm.tsx
View file @
dab51d0b
...
...
@@ -36,6 +36,7 @@ const DropdownForm = ({
}
return
(
<
DropDownPicker
listMode
=
{
"
MODAL
"
}
open
=
{
open
}
value
=
{
value
}
items
=
{
items
}
...
...
src/screens/auth/InputForgotPassword.tsx
View file @
dab51d0b
import
{
useNavigation
}
from
"
@react-navigation/core
"
;
import
React
from
"
react
"
;
import
{
useState
}
from
"
react
"
;
import
{
StyleSheet
,
View
,
Text
}
from
"
react-native
"
;
import
{
StyleSheet
,
View
,
Text
,
Alert
}
from
"
react-native
"
;
import
Colors
from
"
../../constants/Colors
"
;
import
{
RootTabScreenProps
}
from
"
../../types/navigation
"
;
import
PlainForm
from
"
../../components/Forms/PlainForm
"
;
...
...
@@ -10,6 +10,7 @@ import { MaterialIcons } from "@expo/vector-icons";
import
MainButton
from
"
../../components/button/MainButton
"
;
import
firebase
from
"
firebase
"
;
import
{
validateEmail
}
from
"
../../helpers/Validators
"
;
import
{
forgotPassword
}
from
"
../../service/firebase/auth
"
;
export
default
function
InputForgotPassword
({
navigation
,
...
...
@@ -46,10 +47,16 @@ export default function InputForgotPassword({
text
=
{
"
Reset Password
"
}
colors
=
{
"
Primary
"
}
onPress
=
{
()
=>
{
if
(
validateEmail
(
email
))
{
firebase
.
auth
().
sendPasswordResetEmail
(
email
);
nav
.
navigate
(
"
Auth
"
,
{
screen
:
"
ForgotPasswordDone
"
});
}
forgotPassword
(
email
)
.
then
(()
=>
nav
.
navigate
(
"
Auth
"
,
{
screen
:
"
ForgotPasswordDone
"
})
)
.
catch
((
e
)
=>
Alert
.
alert
(
"
Email tidak ditemukan
"
,
"
Silahkan masukkan email yang terdaftar
"
)
);
}
}
/>
</
View
>
...
...
src/screens/auth/RegisterScreen.tsx
View file @
dab51d0b
...
...
@@ -54,87 +54,85 @@ const RegisterScreen = ({ navigation }: RootTabScreenProps<"TabOne">) => {
};
return
(
<
View
style
=
{
styles
.
container
}
>
<
ScrollView
>
<
View
>
<
Text
style
=
{
styles
.
titleText
}
>
Selamat Datang!
</
Text
>
</
View
>
<
Spacer
variant
=
{
"
xl
"
}
/>
<
View
style
=
{
styles
.
componentWrapper
}
>
<
MainButton
text
=
"Daftar Menggunakan Google"
colors
=
"secondary"
onPress
=
{
()
=>
nav
.
navigate
(
"
Auth
"
,
{
screen
:
"
RegisterGoogle
"
})
}
/>
</
View
>
<
Spacer
variant
=
{
"
l
"
}
/>
<
View
style
=
{
styles
.
componentWrapper
}
>
<
MainButton
text
=
"Daftar Menggunakan Facebook"
colors
=
"secondary"
onPress
=
{
()
=>
nav
.
navigate
(
"
Auth
"
,
{
screen
:
"
RegisterGoogle
"
})
}
/>
</
View
>
<
Spacer
variant
=
{
"
xl
"
}
/>
<
View
>
<
Text
style
=
{
styles
.
description
}
>
Silakan isi formulir berikut untuk membuat akun Click
</
Text
>
</
View
>
<
Spacer
variant
=
{
"
xl
"
}
/>
<
View
style
=
{
styles
.
componentWrapper
}
>
<
PlainForm
formTitle
=
{
"
Nama Depan
"
}
text
=
{
firstName
}
setText
=
{
setFirstName
}
placeholder
=
{
"
Masukkan Nama Depan
"
}
errorMessage
=
{
"
Tolong masukkan nama depan
"
}
/>
</
View
>
<
Spacer
variant
=
{
"
l
"
}
/>
<
View
style
=
{
styles
.
componentWrapper
}
>
<
PlainForm
formTitle
=
{
"
Nama Belakang
"
}
text
=
{
lastName
}
setText
=
{
setLastName
}
placeholder
=
{
"
Masukkan Nama Belakang
"
}
errorMessage
=
{
"
Tolong masukkan nama belakang
"
}
/>
</
View
>
<
Spacer
variant
=
{
"
l
"
}
/>
<
View
style
=
{
styles
.
componentWrapper
}
>
<
PlainForm
formTitle
=
{
"
Email
"
}
text
=
{
email
}
setText
=
{
setEmail
}
placeholder
=
{
"
Masukkan Email
"
}
email
errorMessage
=
{
"
Tolong masukkan email yang benar
"
}
/>
</
View
>
<
Spacer
variant
=
{
"
l
"
}
/>
<
View
style
=
{
styles
.
componentWrapper
}
>
<
IconForm
formTitle
=
{
"
Password
"
}
text
=
{
password
}
setText
=
{
setPassword
}
placeholder
=
{
"
Masukkan Password
"
}
password
errorMessage
=
{
"
Tolong masukkan password
"
}
/>
</
View
>
<
Spacer
variant
=
{
"
l
"
}
/>
<
View
style
=
{
styles
.
componentWrapper
}
>
<
PlainForm
formTitle
=
{
"
No. Handphone
"
}
text
=
{
phoneNo
}
setText
=
{
setPhoneNo
}
placeholder
=
{
"
Masukkan No. Handphone
"
}
phone
errorMessage
=
{
"
Tolong masukkan no. handphone
"
}
/>
</
View
>
</
ScrollView
>
<
ScrollView
style
=
{
styles
.
container
}
>
<
View
>
<
Text
style
=
{
styles
.
titleText
}
>
Selamat Datang!
</
Text
>
</
View
>
<
Spacer
variant
=
{
"
xl
"
}
/>
<
View
style
=
{
styles
.
componentWrapper
}
>
<
MainButton
text
=
"Daftar Menggunakan Google"
colors
=
"secondary"
onPress
=
{
()
=>
nav
.
navigate
(
"
Auth
"
,
{
screen
:
"
RegisterGoogle
"
})
}
/>
</
View
>
<
Spacer
variant
=
{
"
l
"
}
/>
<
View
style
=
{
styles
.
componentWrapper
}
>
<
MainButton
text
=
"Daftar Menggunakan Facebook"
colors
=
"secondary"
onPress
=
{
()
=>
nav
.
navigate
(
"
Auth
"
,
{
screen
:
"
RegisterGoogle
"
})
}
/>
</
View
>
<
Spacer
variant
=
{
"
xl
"
}
/>
<
View
>
<
Text
style
=
{
styles
.
description
}
>
Silakan isi formulir berikut untuk membuat akun Click
</
Text
>
</
View
>
<
Spacer
variant
=
{
"
xl
"
}
/>
<
View
style
=
{
styles
.
componentWrapper
}
>
<
PlainForm
formTitle
=
{
"
Nama Depan
"
}
text
=
{
firstName
}
setText
=
{
setFirstName
}
placeholder
=
{
"
Masukkan Nama Depan
"
}
errorMessage
=
{
"
Tolong masukkan nama depan
"
}
/>
</
View
>
<
Spacer
variant
=
{
"
l
"
}
/>
<
View
style
=
{
styles
.
componentWrapper
}
>
<
PlainForm
formTitle
=
{
"
Nama Belakang
"
}
text
=
{
lastName
}
setText
=
{
setLastName
}
placeholder
=
{
"
Masukkan Nama Belakang
"
}
errorMessage
=
{
"
Tolong masukkan nama belakang
"
}
/>
</
View
>
<
Spacer
variant
=
{
"
l
"
}
/>
<
View
style
=
{
styles
.
componentWrapper
}
>
<
PlainForm
formTitle
=
{
"
Email
"
}
text
=
{
email
}
setText
=
{
setEmail
}
placeholder
=
{
"
Masukkan Email
"
}
email
errorMessage
=
{
"
Tolong masukkan email yang benar
"
}
/>
</
View
>
<
Spacer
variant
=
{
"
l
"
}
/>
<
View
style
=
{
styles
.
componentWrapper
}
>
<
IconForm
formTitle
=
{
"
Password
"
}
text
=
{
password
}
setText
=
{
setPassword
}
placeholder
=
{
"
Masukkan Password
"
}
password
errorMessage
=
{
"
Tolong masukkan password
"
}
/>
</
View
>
<
Spacer
variant
=
{
"
l
"
}
/>
<
View
style
=
{
styles
.
componentWrapper
}
>
<
PlainForm
formTitle
=
{
"
No. Handphone
"
}
text
=
{
phoneNo
}
setText
=
{
setPhoneNo
}
placeholder
=
{
"
Masukkan No. Handphone
"
}
phone
errorMessage
=
{
"
Tolong masukkan no. handphone
"
}
/>
</
View
>
<
Spacer
variant
=
{
"
l
"
}
/>
<
View
style
=
{
styles
.
titleContainer
}
testID
=
"TitleContainer"
>
<
Text
style
=
{
styles
.
formTitle
}
testID
=
"Title"
>
...
...
@@ -161,18 +159,15 @@ const RegisterScreen = ({ navigation }: RootTabScreenProps<"TabOne">) => {
<
View
style
=
{
styles
.
componentWrapper
}
>
<
MainButton
text
=
"Daftar"
colors
=
"primary"
onPress
=
{
handleSubmit
}
/>
</
View
>
<
Spacer
variant
=
{
"
xl
"
}
/>
</
View
>
<
Spacer
variant
=
"xl"
/>
</
Scroll
View
>
);
};
const
styles
=
StyleSheet
.
create
({
container
:
{
flex
:
1
,
fontStyle
:
"
normal
"
,
display
:
"
flex
"
,
padding
:
24
,
backgroundColor
:
Colors
.
background
,
paddingHorizontal
:
24
,
},
titleText
:
{
fontSize
:
32
,
...
...
src/service/firebase/auth.ts
View file @
dab51d0b
...
...
@@ -35,3 +35,7 @@ export const changePassword = async (password: string) => {
export
const
signUpAuth
=
async
(
email
:
string
,
password
:
string
)
=>
{
return
await
firebase
.
auth
().
createUserWithEmailAndPassword
(
email
,
password
);
};
export
const
forgotPassword
=
async
(
email
:
string
)
=>
{
return
await
firebase
.
auth
().
sendPasswordResetEmail
(
email
);
};
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment