From bb0de38dff085b255efa9e094c574f1fb592273c Mon Sep 17 00:00:00 2001 From: farhantock Date: Wed, 15 May 2024 19:24:24 +0700 Subject: [PATCH] feat(component): presence page --- src/screens/presence/index.js | 143 ++++++++++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 src/screens/presence/index.js diff --git a/src/screens/presence/index.js b/src/screens/presence/index.js new file mode 100644 index 0000000..808e315 --- /dev/null +++ b/src/screens/presence/index.js @@ -0,0 +1,143 @@ +import { TouchableRipple, TextInput, Card, Text, Appbar } from 'react-native-paper'; +import { View, StyleSheet, ScrollView } from 'react-native'; +import React, { useState } from 'react'; +import { colors } from '../../utils/color' +import Icon from 'react-native-vector-icons/AntDesign'; +import moment from 'moment'; +import 'moment/locale/id'; +moment.locale('id'); +export default function PresenceScreen({ route, navigation }) { + + const dummyData = [ + { id: '1', date: '2024-02-09', timeIn: '08:00', timeOut: '17:00', shift: "Pagi", duration: new Date(0, 0, 0, 8, 0, 0) }, + { id: '2', date: '2024-02-10', timeIn: '08:15', timeOut: '17:30', shift: "Pagi", duration: new Date(0, 0, 0, 8, 30, 0) }, + { id: '3', date: '2024-02-11', timeIn: '08:10', timeOut: '17:20', shift: "Pagi", duration: new Date(0, 0, 0, 9, 0, 0) }, + { id: '4', date: '2024-02-12', timeIn: '08:10', timeOut: '17:20', shift: "Pagi", duration: new Date(0, 0, 0, 10, 0, 0) }, + { id: '5', date: '2024-02-13', timeIn: '08:10', timeOut: '17:20', shift: "Pagi", duration: new Date(0, 0, 0, 11, 0, 0) }, + { id: '6', date: '2024-02-14', timeIn: '08:10', timeOut: '17:20', shift: "Pagi", duration: new Date(0, 0, 0, 9, 30, 0) }, + { id: '7', date: '2024-02-15', timeIn: '08:10', timeOut: '17:20', shift: "Pagi", duration: new Date(0, 0, 0, 12, 0, 0) }, + ]; + + return ( + <> + + { navigation.goBack() }} /> + + + + + {dummyData.map((item) => ( + + + + + + + {moment(item.date).format('dddd, DD MMMM - YYYY')} + + + + + Shift {item.shift} + + + + + + + + + Durasi Kerja + + + + Masuk + + Keluar + + + + + {item.timeIn} Jam + + + {item.timeIn} + + {item.timeOut} + + + + + ))} + + + ) +} + +const styles = StyleSheet.create({ + boldText: { + fontWeight: 'bold', + }, + container: { + flex: 1, + marginTop: 20 + }, + precenseDate: { + backgroundColor: colors.semiBlue, + borderRadius: 10, + padding: 5, + }, + header: { + flexDirection: 'row', + alignItems: 'center', + borderBottomLeftRadius: 30, + borderBottomRightRadius: 30, + paddingHorizontal: 20, + paddingVertical: 30, + }, + avatar: { + marginRight: 10, + }, + textContainer: { + marginLeft: 10, + }, + welcomeText: { + fontSize: 18, + fontWeight: 'bold', + marginBottom: 1, + }, + subWelcomeText: { + fontSize: 14, + }, + card: { + margin: 10, + alignItems: 'center' + }, + cardContent: { + alignItems: 'center' + }, + row: { + flexDirection: 'row', + alignItems: 'center', + marginBottom: 5, + }, + iconButtonContainer: { + flex: 1, + alignItems: 'center', + }, + iconButton: { + marginLeft: 10, + }, + bottomSheet: { + margin: 10, + }, + scrollView: { + paddingBottom: 20, + }, + cardPrecense: { + marginHorizontal: 10, + marginVertical: 2, + elevation: 4, + backgroundColor: colors.pureWhite + }, +}); \ No newline at end of file