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
2021
Kelas D
PT Gizi Sehat - Dietela
Dietela Mobile
Commits
79bd553e
Commit
79bd553e
authored
May 18, 2021
by
Doan Andreas Nathanael
Browse files
[GREEN] implemented client list admin
parent
5fe31b52
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/constants/navigation.ts
View file @
79bd553e
...
...
@@ -182,7 +182,17 @@ export const adminNavigation: NavRoute[] = [
},
{
name
:
ROUTES
.
clientProfileAdmin
,
component
:
ClientProfileForAdmin
,
component
:
ComingSoonPage
,
header
:
'
Profil Klien
'
,
},
{
name
:
ROUTES
.
clientDietReportAdmin
,
component
:
ComingSoonPage
,
header
:
'
Profil Klien
'
,
},
{
name
:
ROUTES
.
clientChatAdmin
,
component
:
ComingSoonPage
,
header
:
'
Profil Klien
'
,
},
];
...
...
src/scenes/admin/ClientListAdmin/index.tsx
View file @
79bd553e
import
React
,
{
FC
}
from
'
react
'
;
import
{
Text
}
from
'
react-native
'
;
import
{
ScrollView
}
from
'
react-native-gesture-handler
'
;
import
{
BigButton
,
Loader
}
from
'
components/core
'
;
import
{
useNavigation
}
from
'
@react-navigation/core
'
;
import
{
useApi
,
useDownloadFiles
}
from
'
hooks
'
;
const
ClientListAdmin
:
FC
=
()
=>
<
Text
>
hai
</
Text
>;
import
{
ClientCardNutritionist
}
from
'
scenes/nutritionist/ClientListNutritionist/components
'
;
import
{
retrieveClientListApi
}
from
'
services/profiles
'
;
import
*
as
ROUTES
from
'
constants/routes
'
;
import
{
layoutStyles
}
from
'
styles
'
;
import
{
Dimensions
,
StyleSheet
,
View
}
from
'
react-native
'
;
import
{
Section
}
from
'
components/layout
'
;
import
{
getAbsoluteUrl
}
from
'
utils/format
'
;
const
ClientListAdmin
:
FC
=
()
=>
{
const
navigation
=
useNavigation
();
const
{
isLoading
,
data
:
clients
=
[]
}
=
useApi
(
retrieveClientListApi
);
const
{
download
}
=
useDownloadFiles
(
getAbsoluteUrl
(
'
exportcsv
'
));
if
(
isLoading
)
{
return
<
Loader
/>;
}
return
(
<
View
style
=
{
layoutStyles
}
>
<
ScrollView
style
=
{
styles
.
container
}
>
{
clients
.
map
((
client
,
idx
)
=>
(
<
ClientCardNutritionist
key
=
{
idx
}
clientName
=
{
client
.
user
.
name
}
onPressClientProfile
=
{
()
=>
{
navigation
.
navigate
(
ROUTES
.
clientProfileAdmin
,
{
id
:
client
.
diet_questionnaire_id
,
});
}
}
onPressClientDietReport
=
{
()
=>
{
navigation
.
navigate
(
ROUTES
.
clientDietReportAdmin
,
{});
}
}
onPressClientChat
=
{
()
=>
{
navigation
.
navigate
(
ROUTES
.
clientChatAdmin
,
{});
}
}
/>
))
}
</
ScrollView
>
<
Section
>
<
BigButton
title
=
"Download CSV"
onPress
=
{
download
}
/>
</
Section
>
</
View
>
);
};
const
styles
=
StyleSheet
.
create
({
container
:
{
height
:
Dimensions
.
get
(
'
window
'
).
height
*
0.83
},
});
export
default
ClientListAdmin
;
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