upd: redesign
Deskripsi: - fitur ganti mode tema - penerapan tema pada semua fitur NO Issues
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import Styles from "@/constants/Styles";
|
||||
import { useTheme } from "@/providers/ThemeProvider";
|
||||
import { Pressable, View } from "react-native";
|
||||
import Text from "./Text";
|
||||
|
||||
@@ -12,8 +13,17 @@ type Props = {
|
||||
}
|
||||
|
||||
export default function EventItem({ category, title, user, jamAwal, jamAkhir, onPress }: Props) {
|
||||
const { theme } = useTheme();
|
||||
|
||||
const getBackgroundColor = (cat: 'purple' | 'orange') => {
|
||||
if (theme === 'dark') {
|
||||
return cat === 'orange' ? '#5A2D0C' : '#1F2255';
|
||||
}
|
||||
return cat === 'orange' ? '#FED6C5' : '#D8D8F1';
|
||||
};
|
||||
|
||||
return (
|
||||
<Pressable style={[Styles.itemEvent, { backgroundColor: category == 'orange' ? '#FED6C5' : '#D8D8F1' }]} onPress={onPress}>
|
||||
<Pressable style={[Styles.itemEvent, { backgroundColor: getBackgroundColor(category) }]} onPress={onPress}>
|
||||
<View style={[Styles.dividerEvent, { backgroundColor: category == 'orange' ? '#FB804C' : '#535FCA' }]} />
|
||||
<View style={[Styles.w90]}>
|
||||
<Text>{jamAwal} - {jamAkhir}</Text>
|
||||
|
||||
Reference in New Issue
Block a user