- Tambah halaman /village-calendar dengan monthly grid dan agenda view - Tampilkan acara divisi (DivisionCalendarReminder) dan kegiatan (ProjectTask) se-village - Indikator dot dua warna pada kalender: ungu untuk acara divisi, biru-abu untuk kegiatan - Tambah endpoint apiGetVillageCalendarByDate dan apiGetVillageCalendarIndicator - Tambah menu Kalender di halaman /feature dengan grid layout flexWrap - Sesuaikan warna EventItem dengan TYPE_COLORS village-calendar - Pindahkan inline style ke Styles.ts sebagai class baru
33 lines
1.2 KiB
TypeScript
33 lines
1.2 KiB
TypeScript
import Styles from "@/constants/Styles";
|
|
import { useTheme } from "@/providers/ThemeProvider";
|
|
import { Pressable, View } from "react-native";
|
|
import Text from "../Text";
|
|
|
|
type Props = {
|
|
text: string;
|
|
isSelected: boolean;
|
|
isSign?: boolean;
|
|
isSignCalendar?: boolean;
|
|
isSignTask?: boolean;
|
|
onPress?: () => void;
|
|
}
|
|
|
|
export default function ItemDateCalendar({ text, isSelected, isSign, isSignCalendar, isSignTask, onPress }: Props) {
|
|
const { colors } = useTheme()
|
|
|
|
const showMulti = isSignCalendar !== undefined || isSignTask !== undefined;
|
|
|
|
return (
|
|
<Pressable style={Styles.contentItemCenter} onPress={onPress}>
|
|
<Text style={[isSelected ? Styles.cWhite : { color: colors.text }]}>{text}</Text>
|
|
{showMulti ? (
|
|
<View style={Styles.calendarDotRow}>
|
|
<View style={[Styles.calendarDot, { backgroundColor: isSignCalendar ? (isSelected ? 'white' : '#7886C7') : 'transparent' }]} />
|
|
<View style={[Styles.calendarDot, { backgroundColor: isSignTask ? (isSelected ? 'white' : '#94B4C1') : 'transparent' }]} />
|
|
</View>
|
|
) : (
|
|
<View style={[Styles.signDate, { backgroundColor: isSign ? 'red' : 'transparent' }]} />
|
|
)}
|
|
</Pressable>
|
|
)
|
|
} |