upd: redesign
This commit is contained in:
@@ -31,15 +31,14 @@ export default function HeaderRightAnnouncementDetail({ id }: Props) {
|
||||
const hasil = await decryptToken(String(token?.current))
|
||||
const response = await apiDeleteAnnouncement({ user: hasil }, id)
|
||||
if (response.success) {
|
||||
dispatch(setUpdateAnnouncement(!update))
|
||||
setVisible(false)
|
||||
Toast.show({ type: 'small', text1: 'Berhasil menghapus data', })
|
||||
router.back()
|
||||
dispatch(setUpdateAnnouncement(!update))
|
||||
return Toast.show({ type: 'small', text1: 'Berhasil menghapus data', })
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
setVisible(false)
|
||||
setShowDeleteModal(false)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ export default function ButtonNextHeader({ onPress, disable }: Props) {
|
||||
return (
|
||||
<>
|
||||
<ButtonHeader
|
||||
item={<Feather name="chevron-right" size={20} color={disable ? "grey" : "white"} />}
|
||||
item={<Feather name="chevron-right" size={25} color={disable ? "grey" : "white"} />}
|
||||
onPress={() => {
|
||||
!disable && onPress && onPress()
|
||||
}}
|
||||
|
||||
21
components/loadingCenter.tsx
Normal file
21
components/loadingCenter.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import Text from '@/components/Text';
|
||||
import Styles from '@/constants/Styles';
|
||||
import { useTheme } from '@/providers/ThemeProvider';
|
||||
import { ActivityIndicator, View } from 'react-native';
|
||||
|
||||
type Props = {
|
||||
size?: 'small' | 'large'
|
||||
}
|
||||
|
||||
export default function LoadingCenter({ size = 'large' }: Props) {
|
||||
const { colors } = useTheme();
|
||||
|
||||
return (
|
||||
<View style={[Styles.loadingCenter]}>
|
||||
<View style={[Styles.loadingBox, Styles.shadowBox, { backgroundColor: colors.modalBackground }]}>
|
||||
<ActivityIndicator size={size} color={colors.dimmed} />
|
||||
<Text style={{ color: colors.dimmed }}>Loading</Text>
|
||||
</View>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
@@ -157,7 +157,7 @@ export default function ModalSelectMultiple({ open, close, title, category, choo
|
||||
{
|
||||
data.map((item: any, index: number) => {
|
||||
return (
|
||||
<Pressable key={index} style={[Styles.itemSelectModal]} onPress={() => {
|
||||
<Pressable key={index} style={[Styles.itemSelectModal, { borderColor: colors.icon + 20 }]} onPress={() => {
|
||||
handleDivisionClick(index)
|
||||
}}>
|
||||
<Text numberOfLines={1} style={[Styles.w80]}>{item.name}</Text>
|
||||
@@ -175,7 +175,7 @@ export default function ModalSelectMultiple({ open, close, title, category, choo
|
||||
data.map((item: any, index: number) => {
|
||||
return (
|
||||
<View key={index}>
|
||||
<Pressable style={[Styles.itemSelectModal]} onPress={() => { handleGroupCheck(item.id) }}>
|
||||
<Pressable style={[Styles.itemSelectModal, { borderColor: colors.icon + 20 }]} onPress={() => { handleGroupCheck(item.id) }}>
|
||||
<Text style={[Styles.textMediumSemiBold]}>{item.name}</Text>
|
||||
{
|
||||
checked[item.id] && checked[item.id]?.length === item.Division?.length
|
||||
@@ -188,7 +188,7 @@ export default function ModalSelectMultiple({ open, close, title, category, choo
|
||||
{
|
||||
item.Division.map((child: any, v: number) => {
|
||||
return (
|
||||
<Pressable key={v} style={[Styles.itemSelectModal]} onPress={() => { handleCheck(item.id, child.id) }}>
|
||||
<Pressable key={v} style={[Styles.itemSelectModal, { borderColor: colors.icon + 20 }]} onPress={() => { handleCheck(item.id, child.id) }}>
|
||||
<Text style={[Styles.ml10, Styles.textMediumNormal, Styles.w80]} numberOfLines={1} ellipsizeMode="tail" >{child.name}</Text>
|
||||
{
|
||||
checked[item.id] && checked[item.id].includes(child.id) && <AntDesign name="check" size={20} color={colors.text} />
|
||||
|
||||
@@ -77,7 +77,7 @@ export default function ModalListDetailTugasProject({ isVisible, setVisible, idT
|
||||
getItem={getItem}
|
||||
renderItem={({ item, index }: { item: Props, index: number }) => {
|
||||
return (
|
||||
<View key={index} style={[Styles.borderBottom, Styles.pv05, { borderBottomColor: colors.icon }]}>
|
||||
<View key={index} style={[Styles.borderBottom, Styles.pv05, { borderBottomColor: colors.icon + "20" }]}>
|
||||
<Text style={[Styles.textDefaultSemiBold]}>{item.date}</Text>
|
||||
<View style={[Styles.rowSpaceBetween]}>
|
||||
<View style={[{ width: "48%" }]}>
|
||||
|
||||
@@ -157,7 +157,6 @@ export default function SectionFile({ status, member, refreshing }: { status: nu
|
||||
title={item.name + '.' + item.extension}
|
||||
titleWeight="normal"
|
||||
onPress={() => { setSelectFile(item); setModal(true) }}
|
||||
width={65}
|
||||
/>
|
||||
)
|
||||
})
|
||||
|
||||
@@ -96,7 +96,6 @@ export default function SectionLink({ status, member, refreshing }: { status: nu
|
||||
title={item.link}
|
||||
titleWeight="normal"
|
||||
onPress={() => { setSelectLink(item); setModal(true) }}
|
||||
width={65}
|
||||
/>
|
||||
)
|
||||
})
|
||||
|
||||
@@ -151,7 +151,6 @@ export default function SectionFileTask({ refreshing, isMemberDivision }: { refr
|
||||
title={item.name + '.' + item.extension}
|
||||
titleWeight="normal"
|
||||
onPress={() => { setSelectFile(item); setModal(true) }}
|
||||
width={65}
|
||||
/>
|
||||
)
|
||||
})
|
||||
|
||||
@@ -88,7 +88,6 @@ export default function SectionLinkTask({ refreshing, isMemberDivision }: { refr
|
||||
title={item.link}
|
||||
titleWeight="normal"
|
||||
onPress={() => { setSelectLink(item); setModal(true) }}
|
||||
width={65}
|
||||
/>
|
||||
)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user