fix : tampilan
Deskripsi: - home divisi : caraousel dokumen diganti ga pake caraousel - home divisi : judul divis - detail tugas divisi : judul tugas divis - kalender divisi : indicator kalender, pake loading No Issues
This commit is contained in:
@@ -40,6 +40,7 @@ export default function CalendarDivision() {
|
||||
const [month, setMonth] = useState<number>(new Date().getMonth());
|
||||
const update = useSelector((state: any) => state.calendarUpdate)
|
||||
const [loading, setLoading] = useState(true)
|
||||
const [loadingBtn, setLoadingBtn] = useState(false)
|
||||
|
||||
|
||||
async function handleLoad(loading: boolean) {
|
||||
@@ -61,6 +62,7 @@ export default function CalendarDivision() {
|
||||
|
||||
async function handleLoadIndicator() {
|
||||
try {
|
||||
setLoadingBtn(true)
|
||||
const newDate = new Date(selected?.getFullYear(), month, 1);
|
||||
const hasil = await decryptToken(String(token?.current));
|
||||
const response = await apiGetIndicatorCalendar({
|
||||
@@ -71,6 +73,8 @@ export default function CalendarDivision() {
|
||||
setDataIndicator(response.data);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
} finally {
|
||||
setLoadingBtn(false)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,11 +103,11 @@ export default function CalendarDivision() {
|
||||
/>
|
||||
);
|
||||
},
|
||||
IconNext: <Pressable onPress={() => setMonth(month + 1)}>
|
||||
<Feather name="chevron-right" size={20} />
|
||||
IconNext: <Pressable onPress={() => !loadingBtn ? setMonth(month + 1) : null}>
|
||||
<Feather name="chevron-right" size={20} color={loadingBtn ? 'gray' : 'black'} />
|
||||
</Pressable>,
|
||||
IconPrev: <Pressable onPress={() => setMonth(month - 1)}>
|
||||
<Feather name="chevron-left" size={20} />
|
||||
IconPrev: <Pressable onPress={() => !loadingBtn ? setMonth(month - 1) : null}>
|
||||
<Feather name="chevron-left" size={20} color={loadingBtn ? 'gray' : 'black'} />
|
||||
</Pressable>,
|
||||
};
|
||||
|
||||
@@ -135,8 +139,6 @@ export default function CalendarDivision() {
|
||||
styles={{
|
||||
selected: Styles.selectedDate,
|
||||
}}
|
||||
|
||||
|
||||
/>
|
||||
</View>
|
||||
<View style={[Styles.mb15, Styles.mt15]}>
|
||||
|
||||
@@ -55,7 +55,7 @@ export default function DetailTaskDivision() {
|
||||
<Stack.Screen
|
||||
options={{
|
||||
headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
|
||||
headerTitle: loading ? 'Loading...' : data?.title,
|
||||
headerTitle: loading ? 'Loading... ' : data?.title,
|
||||
headerTitleAlign: 'center',
|
||||
headerRight: () => <HeaderRightTaskDetail id={detail} division={id} status={data?.status}/>,
|
||||
}}
|
||||
|
||||
@@ -50,7 +50,7 @@ export default function DetailDivisionFitur() {
|
||||
<Stack.Screen
|
||||
options={{
|
||||
headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
|
||||
headerTitle: loading ? 'Loading...' : data?.name,
|
||||
headerTitle: loading ? 'Loading... ' : data?.name,
|
||||
headerTitleAlign: 'center',
|
||||
headerRight: () => <HeaderRightDivisionDetail id={id} />,
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user