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
62e3bffa
Commit
62e3bffa
authored
Oct 09, 2021
by
Bagus Prabowo
Browse files
Merge branch 'eslint-fix' into 'master'
Refactor: Eslint Configuration Fix See merge request
!72
parents
4eee1812
d627b3ce
Pipeline
#86121
passed with stage
in 9 minutes and 20 seconds
Changes
31
Pipelines
1
Show whitespace changes
Inline
Side-by-side
.eslintrc.js
View file @
62e3bffa
...
...
@@ -27,6 +27,7 @@ module.exports = {
"
linebreak-style
"
:
[
"
error
"
,
"
unix
"
],
quotes
:
[
"
error
"
,
"
double
"
],
semi
:
[
"
error
"
,
"
always
"
],
"
@typescript-eslint/no-unused-vars
"
:
2
,
"
no-empty-function
"
:
"
off
"
,
"
@typescript-eslint/no-empty-function
"
:
"
off
"
,
"
react/display-name
"
:
"
off
"
,
...
...
.prettierrc.js
View file @
62e3bffa
...
...
@@ -15,5 +15,6 @@ module.exports = {
"
tabWidth
"
:
2
,
"
trailingComma
"
:
"
es5
"
,
"
useTabs
"
:
false
,
"
parser
"
:
"
typescript
"
"
parser
"
:
"
typescript
"
,
"
enOfline
"
:
"
auto
"
}
src/components/Cards/HorizontalCards.tsx
View file @
62e3bffa
...
...
@@ -3,8 +3,6 @@ import React from "react";
import
{
Text
,
StyleSheet
,
TouchableOpacity
,
View
,
Image
}
from
"
react-native
"
;
import
Colors
from
"
../../constants/Colors
"
;
import
Spacer
from
"
../../components/Spacer/Spacer
"
;
import
{
useAppSelector
}
from
"
../../hooks/reduxHooks
"
;
import
{
IUser
}
from
"
../../types/firestore/User
"
;
import
Layout
from
"
../../constants/Layout
"
;
type
props
=
{
...
...
@@ -16,7 +14,6 @@ type props = {
};
const
HorizontalCards
=
({
image
,
member
,
title
,
rate
,
onPress
}:
props
)
=>
{
const
user
:
IUser
=
useAppSelector
((
state
)
=>
state
.
user
);
return
(
<
View
>
<
TouchableOpacity
onPress
=
{
()
=>
onPress
()
}
>
...
...
src/components/__tests__/firebase/basic.test.tsx
View file @
62e3bffa
import
{
cleanup
,
render
,
fireEvent
}
from
"
@testing-library/react-native
"
;
import
{
cleanup
}
from
"
@testing-library/react-native
"
;
import
FirebaseConfig
from
"
../../../../config/firebase
"
;
import
firebase
from
"
firebase/app
"
;
import
"
firebase/firestore
"
;
...
...
src/components/button/PlainButton.tsx
View file @
62e3bffa
...
...
@@ -20,7 +20,7 @@ const PlainButton = ({ text, desc, onPress, descText }: props) => {
<
MaterialIcons
name
=
"group"
size
=
{
15
}
color
=
{
Colors
.
icon
.
inactive
}
color
=
{
Colors
.
icon
.
tab
.
inactive
}
/>
</
View
>
<
View
style
=
{
{
flex
:
1
,
paddingRight
:
7
}
}
>
...
...
src/navigation/BottomTabNavigator.tsx
View file @
62e3bffa
import
*
as
React
from
"
react
"
;
import
{
createBottomTabNavigator
}
from
"
@react-navigation/bottom-tabs
"
;
import
{
RootTabParamList
,
RootTabScreenProps
}
from
"
../types/navigation
"
;
import
TabOneScreen
from
"
../screens/TabOneScreen
"
;
import
{
RootTabParamList
}
from
"
../types/navigation
"
;
import
{
FontAwesome
}
from
"
@expo/vector-icons
"
;
import
{
Pressable
}
from
"
react-native
"
;
import
Colors
from
"
../constants/Colors
"
;
...
...
@@ -17,34 +16,11 @@ const BottomTab = createBottomTabNavigator<RootTabParamList>();
const
BottomTabNavigator
=
()
=>
{
return
(
<
BottomTab
.
Navigator
initialRouteName
=
"
TabOne
"
initialRouteName
=
"
Ecosystem
"
screenOptions
=
{
{
tabBarActiveTintColor
:
Colors
.
icon
.
tab
.
active
,
//TODO ganti warna nya
}
}
>
<
BottomTab
.
Screen
name
=
"TabOne"
component
=
{
TabOneScreen
}
options
=
{
()
=>
({
title
:
"
Tab One
"
,
tabBarIcon
:
({
color
})
=>
<
TabBarIcon
name
=
"code"
color
=
{
color
}
/>,
headerRight
:
()
=>
(
<
Pressable
onPress
=
{
()
=>
null
}
style
=
{
({
pressed
})
=>
({
opacity
:
pressed
?
0.5
:
1
,
})
}
>
<
FontAwesome
name
=
"info-circle"
size
=
{
25
}
color
=
{
Colors
.
text
.
title
}
//TODO ganti warna
style
=
{
{
marginRight
:
15
}
}
/>
</
Pressable
>
),
})
}
/>
<
BottomTab
.
Screen
name
=
"Ecosystem"
component
=
{
EcosystemStackNavigator
}
...
...
src/redux/store.tsx
View file @
62e3bffa
import
{
combineReducers
,
createStore
,
applyMiddleware
}
from
"
redux
"
;
import
{
configureStore
}
from
"
@reduxjs/toolkit
"
;
import
userReducer
from
"
./user/reducer
"
;
...
...
src/redux/user/actions.tsx
View file @
62e3bffa
import
{
Dispatch
}
from
"
react-redux/node_modules/@types/react
"
;
import
*
as
userService
from
"
../../service/firestore/user
"
;
import
{
IUser
}
from
"
../../types/firestore/User
"
;
import
*
as
authService
from
"
../../service/firebase/auth
"
;
import
{
ActionErrorRes
}
from
"
../../types/redux
"
;
import
{
AnyAction
}
from
"
redux
"
;
export
const
getUser
=
(
uid
:
string
)
=>
{
return
async
(
dispatch
:
Dispatch
<
any
>
)
=>
{
...
...
@@ -21,7 +18,7 @@ export const getUser = (uid: string) => {
};
export
const
setProfilePic
=
(
url
:
string
,
id
:
string
)
=>
{
return
async
(
dispatch
:
Dispatch
<
any
>
,
getState
:
IUser
)
=>
{
return
async
(
dispatch
:
Dispatch
<
any
>
)
=>
{
try
{
await
userService
.
addProfilePic
(
url
,
id
);
...
...
src/screens/CreateBusinessEcosystemScreen.tsx
deleted
100644 → 0
View file @
4eee1812
import
{
useNavigation
}
from
"
@react-navigation/core
"
;
import
*
as
React
from
"
react
"
;
import
{
StyleSheet
}
from
"
react-native
"
;
import
{
Text
,
View
}
from
"
../components/Themed
"
;
import
Colors
from
"
../constants/Colors
"
;
const
BusinessCategoryScreen
=
()
=>
{
const
nav
=
useNavigation
();
return
(
<
View
style
=
{
styles
.
container
}
>
<
View
>
<
Text
>
Layar Buat Ekosistem Bisnis
</
Text
>
</
View
>
</
View
>
);
};
const
styles
=
StyleSheet
.
create
({
container
:
{
flex
:
1
,
backgroundColor
:
Colors
.
background
,
paddingHorizontal
:
24
,
justifyContent
:
"
center
"
,
},
});
export
default
BusinessCategoryScreen
;
src/screens/SuccessChangePasswordScreen.tsx
View file @
62e3bffa
import
{
useNavigation
}
from
"
@react-navigation/core
"
;
import
{
NativeStackNavigationProp
}
from
"
@react-navigation/native-stack
"
;
import
*
as
React
from
"
react
"
;
import
{
StyleSheet
}
from
"
react-native
"
;
import
MainButton
from
"
../components/button/MainButton
"
;
...
...
@@ -7,7 +6,6 @@ import Spacer from "../components/Spacer/Spacer";
import
{
Text
,
View
}
from
"
../components/Themed
"
;
import
Colors
from
"
../constants/Colors
"
;
import
{
ProfileStackParamList
}
from
"
../types/navigation
"
;
export
default
function
SuccessChangePasswordScreen
()
{
const
nav
=
useNavigation
();
...
...
@@ -27,7 +25,7 @@ export default function SuccessChangePasswordScreen() {
<
View
style
=
{
styles
.
buttonContainer
}
>
<
MainButton
text
=
{
"
Kembali
"
}
onPress
=
{
()
=>
nav
.
navigate
(
"
AccountSettings
"
)
}
onPress
=
{
()
=>
nav
.
navigate
(
"
Profile
"
,
{
screen
:
"
AccountSettings
"
}
)
}
colors
=
{
"
Secondary
"
}
/>
</
View
>
...
...
src/screens/TabOneScreen.tsx
deleted
100644 → 0
View file @
4eee1812
import
{
useNavigation
}
from
"
@react-navigation/core
"
;
import
*
as
React
from
"
react
"
;
import
{
StyleSheet
}
from
"
react-native
"
;
import
{
TouchableOpacity
}
from
"
react-native-gesture-handler
"
;
import
MainButton
from
"
../components/button/MainButton
"
;
import
SmallButton
from
"
../components/button/SmallButton
"
;
import
{
Text
,
View
}
from
"
../components/Themed
"
;
import
Colors
from
"
../constants/Colors
"
;
import
{
RootTabScreenProps
}
from
"
../types/navigation
"
;
export
default
function
TabOneScreen
({
navigation
,
}:
RootTabScreenProps
<
"
TabOne
"
>
)
{
const
nav
=
useNavigation
();
return
(
<
View
style
=
{
styles
.
container
}
>
<
TouchableOpacity
onPress
=
{
()
=>
nav
.
navigate
(
"
Auth
"
)
}
>
<
Text
>
To Auth
</
Text
>
</
TouchableOpacity
>
<
SmallButton
text
=
"test"
colors
=
"primary"
onPress
=
{
()
=>
nav
.
navigate
(
"
Auth
"
)
}
/>
</
View
>
);
}
const
styles
=
StyleSheet
.
create
({
container
:
{
flex
:
1
,
alignItems
:
"
center
"
,
justifyContent
:
"
center
"
,
backgroundColor
:
Colors
.
background
,
},
title
:
{
fontSize
:
20
,
fontWeight
:
"
bold
"
,
},
separator
:
{
marginVertical
:
30
,
height
:
1
,
width
:
"
80%
"
,
},
});
src/screens/auth/ForgotPasswordDone.tsx
View file @
62e3bffa
...
...
@@ -8,6 +8,7 @@ import { MaterialIcons } from "@expo/vector-icons";
import
MainButton
from
"
../../components/button/MainButton
"
;
export
default
function
ForgotPasswordDone
({
// eslint-disable-next-line @typescript-eslint/no-unused-vars
navigation
,
}:
RootTabScreenProps
<
"
TabOne
"
>
)
{
const
nav
=
useNavigation
();
...
...
src/screens/auth/InputForgotPassword.tsx
View file @
62e3bffa
...
...
@@ -8,11 +8,10 @@ import PlainForm from "../../components/Forms/PlainForm";
import
Spacer
from
"
../../components/Spacer/Spacer
"
;
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
({
// eslint-disable-next-line @typescript-eslint/no-unused-vars
navigation
,
}:
RootTabScreenProps
<
"
TabOne
"
>
)
{
const
[
email
,
setEmail
]
=
useState
(
""
);
...
...
@@ -51,7 +50,7 @@ export default function InputForgotPassword({
.
then
(()
=>
nav
.
navigate
(
"
Auth
"
,
{
screen
:
"
ForgotPasswordDone
"
})
)
.
catch
((
e
)
=>
.
catch
(()
=>
Alert
.
alert
(
"
Email tidak ditemukan
"
,
"
Silahkan masukkan email yang terdaftar
"
...
...
src/screens/auth/LandingScreen.tsx
View file @
62e3bffa
import
{
useNavigation
}
from
"
@react-navigation/core
"
;
import
React
,
{
useEffect
}
from
"
react
"
;
import
React
from
"
react
"
;
import
{
StyleSheet
,
Image
}
from
"
react-native
"
;
import
{
View
}
from
"
../../components/Themed
"
;
import
Colors
from
"
../../constants/Colors
"
;
...
...
@@ -7,9 +6,9 @@ import { RootTabScreenProps } from "../../types/navigation";
import
Layout
from
"
../../constants/Layout
"
;
export
default
function
LandingScreen
({
// eslint-disable-next-line @typescript-eslint/no-unused-vars
navigation
,
}:
RootTabScreenProps
<
"
TabOne
"
>
)
{
const
nav
=
useNavigation
();
return
(
<
View
style
=
{
styles
.
container
}
>
<
Image
...
...
src/screens/auth/LoginScreen.tsx
View file @
62e3bffa
...
...
@@ -11,9 +11,8 @@ import { RootTabScreenProps } from "../../types/navigation";
import
Spacer
from
"
../../components/Spacer/Spacer
"
;
import
{
useAppDispatch
}
from
"
../../hooks/reduxHooks
"
;
import
{
loginUser
}
from
"
../../redux/user/actions
"
;
import
{
IUser
}
from
"
../../types/firestore/User
"
;
import
{
ActionErrorRes
}
from
"
../../types/redux
"
;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const
LoginScreen
=
({
navigation
}:
RootTabScreenProps
<
"
TabOne
"
>
)
=>
{
const
nav
=
useNavigation
();
const
[
email
,
setEmail
]
=
useState
(
""
);
...
...
@@ -23,8 +22,8 @@ const LoginScreen = ({ navigation }: RootTabScreenProps<"TabOne">) => {
const
handleSubmit
=
()
=>
{
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
dispatch
(
loginUser
(
email
,
password
))
.
then
((
e
:
IUser
)
=>
nav
)
.
catch
((
e
:
ActionErrorRes
)
=>
Alert
.
alert
(
"
Invalid credentials
"
));
.
then
(()
=>
nav
)
.
catch
(()
=>
Alert
.
alert
(
"
Invalid credentials
"
));
};
return
(
...
...
src/screens/auth/OnBoardingScreen.tsx
View file @
62e3bffa
...
...
@@ -9,6 +9,7 @@ import Spacer from "../../components/Spacer/Spacer";
import
Layout
from
"
../../constants/Layout
"
;
export
default
function
OnBoardingScreen
({
// eslint-disable-next-line @typescript-eslint/no-unused-vars
navigation
,
}:
RootTabScreenProps
<
"
TabOne
"
>
)
{
const
nav
=
useNavigation
();
...
...
src/screens/auth/RegisterGoogleFacebookScreen.tsx
View file @
62e3bffa
import
{
Text
,
View
}
from
"
../../components/Themed
"
;
import
*
as
React
from
"
react
"
;
import
{
useEffect
,
useState
}
from
"
react
"
;
import
{
useState
}
from
"
react
"
;
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
"
;
import
{
getCategories
}
from
"
../../db/categories
"
;
import
{
ddConverter
}
from
"
../../helpers/ddConverter
"
;
import
{
ICategory
,
IDD
}
from
"
../../types/firestore
"
;
import
{
RootTabScreenProps
}
from
"
../../types/navigation
"
;
import
{
useNavigation
}
from
"
@react-navigation/core
"
;
const
RegisterGoogleFacebookScreen
=
({
// eslint-disable-next-line @typescript-eslint/no-unused-vars
navigation
,
}:
RootTabScreenProps
<
"
TabOne
"
>
)
=>
{
const
nav
=
useNavigation
();
const
[
firstName
,
setFirstName
]
=
useState
(
""
);
const
[
lastName
,
setLastName
]
=
useState
(
""
);
const
[
phoneNo
,
setPhoneNo
]
=
useState
(
""
);
...
...
src/screens/auth/RegisterScreen.tsx
View file @
62e3bffa
import
{
Text
,
View
}
from
"
../../components/Themed
"
;
import
*
as
React
from
"
react
"
;
import
{
useEffect
,
useState
}
from
"
react
"
;
import
{
ScrollView
,
StyleSheet
}
from
"
react-native
"
;
import
{
useState
}
from
"
react
"
;
import
{
ScrollView
,
StyleSheet
,
Alert
}
from
"
react-native
"
;
import
Colors
from
"
../../constants/Colors
"
;
import
PlainForm
from
"
../../components/Forms/PlainForm
"
;
import
IconForm
from
"
../../components/Forms/IconForm
"
;
...
...
@@ -11,10 +11,10 @@ import DropdownForm from "../../components/Forms/DropdownForm";
import
{
RootTabScreenProps
}
from
"
../../types/navigation
"
;
import
{
useNavigation
}
from
"
@react-navigation/core
"
;
import
{
validateEmail
,
validateEmpty
}
from
"
../../helpers/Validators
"
;
import
RegisterGoogleFacebookScreen
from
"
./RegisterGoogleFacebookScreen
"
;
import
{
useAppDispatch
}
from
"
../../hooks/reduxHooks
"
;
import
{
signupUser
}
from
"
../../redux/user/actions
"
;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const
RegisterScreen
=
({
navigation
}:
RootTabScreenProps
<
"
TabOne
"
>
)
=>
{
const
nav
=
useNavigation
();
const
[
firstName
,
setFirstName
]
=
useState
(
""
);
...
...
@@ -23,7 +23,6 @@ const RegisterScreen = ({ navigation }: RootTabScreenProps<"TabOne">) => {
const
[
password
,
setPassword
]
=
useState
(
""
);
const
[
phoneNo
,
setPhoneNo
]
=
useState
(
""
);
const
[
picked
,
setPicked
]
=
useState
(
""
);
const
[
isError
,
setIsError
]
=
useState
(
false
);
const
[
categories
,
setCategories
]
=
useState
([
{
label
:
"
Agrikultur
"
,
value
:
"
B
"
},
{
label
:
"
Pertanian
"
,
value
:
"
D
"
},
...
...
@@ -55,7 +54,7 @@ const RegisterScreen = ({ navigation }: RootTabScreenProps<"TabOne">) => {
)
{
dispatch
(
signupUser
(
firstName
,
lastName
,
email
,
password
));
}
else
{
setIsError
(
true
);
Alert
.
alert
(
"
Form Tidak Lengkap
"
,
"
Silahkan isi form dengan benar
"
);
}
};
...
...
src/screens/ecosystem/BusinessCategoryScreen.tsx
View file @
62e3bffa
import
{
useNavigation
}
from
"
@react-navigation/core
"
;
import
*
as
React
from
"
react
"
;
import
{
StyleSheet
}
from
"
react-native
"
;
import
{
Text
,
View
}
from
"
../../components/Themed
"
;
import
{
View
}
from
"
../../components/Themed
"
;
import
Colors
from
"
../../constants/Colors
"
;
import
AlphabetGroupList
from
"
../../components/GroupList/AlphabetGroupList
"
;
const
BusinessCategoryScreen
=
()
=>
{
const
nav
=
useNavigation
();
const
data
=
[
{
value
:
"
Accomodation and Food Services
"
,
key
:
"
1
"
},
{
...
...
src/screens/ecosystem/BusinessListScreen.tsx
View file @
62e3bffa
import
{
useNavigation
}
from
"
@react-navigation/core
"
;
import
*
as
React
from
"
react
"
;
import
{
StyleSheet
}
from
"
react-native
"
;
import
{
Text
,
View
}
from
"
../../components/Themed
"
;
import
Colors
from
"
../../constants/Colors
"
;
const
BusinessListScreen
=
()
=>
{
const
nav
=
useNavigation
();
return
(
<
View
style
=
{
styles
.
container
}
>
<
View
>
...
...
Prev
1
2
Next
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