upd: redesign
Deskripsi: - fitur ganti mode tema - penerapan tema pada semua fitur NO Issues
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
import Styles from "@/constants/Styles";
|
||||
import { Dimensions, View } from "react-native";
|
||||
import { BarChart } from "react-native-gifted-charts";
|
||||
import { useTheme } from "@/providers/ThemeProvider";
|
||||
import Text from "../Text";
|
||||
|
||||
export default function ReportChartEvent({ data }: { data: { label: string; value: number; }[] }) {
|
||||
const { colors } = useTheme();
|
||||
const width = Dimensions.get("window").width;
|
||||
const maxValue = Math.max(...data.map(i => i.value))
|
||||
const barData = [
|
||||
@@ -12,9 +14,11 @@ export default function ReportChartEvent({ data }: { data: { label: string; valu
|
||||
];
|
||||
|
||||
return (
|
||||
<View style={[Styles.wrapPaper, Styles.contentItemCenter, Styles.mb15]}>
|
||||
<View style={[Styles.wrapPaper, Styles.contentItemCenter, Styles.mb15, { backgroundColor: colors.card, borderColor: colors.background }]}>
|
||||
<Text style={[Styles.textSubtitle, Styles.mv15]}>ACARA DIVISI</Text>
|
||||
<BarChart
|
||||
xAxisLabelTextStyle={{ color: colors.text }}
|
||||
yAxisTextStyle={{ color: colors.text }}
|
||||
showFractionalValues={false}
|
||||
showYAxisIndices
|
||||
noOfSections={maxValue < 5 ? 2 : 4}
|
||||
@@ -32,7 +36,7 @@ export default function ReportChartEvent({ data }: { data: { label: string; valu
|
||||
justifyContent: 'center',
|
||||
width: width * 0.25
|
||||
}}>
|
||||
<Text>{item.value}</Text>
|
||||
<Text style={{ color: colors.text }}>{item.value}</Text>
|
||||
</View>
|
||||
);
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user