Admin Component

Add:
- GridViewCustomSpan
- GridView_4_4_4

Fix:
- BackButtonAntTitle: penambahan new component
- SelectCustom: penambahan container style

Admin Donasi
Add:
- admin/donation/[id]

Fix:
- admin/donation/[status]/status

Admin Fix: perubahan nama halaman sesuai fitur

### No Issue
This commit is contained in:
2025-08-13 14:18:30 +08:00
parent 6f3cc03fa5
commit 52c16b25b7
16 changed files with 842 additions and 68 deletions

View File

@@ -5,9 +5,11 @@ import {
FlatList,
Modal,
Pressable,
StyleProp,
Text,
TouchableOpacity,
View,
ViewStyle,
} from "react-native";
type SelectItem = {
@@ -24,6 +26,7 @@ type SelectProps = {
disabled?: boolean; // <-- tambahkan prop disabled
onChange: (value: string | number) => void;
borderRadius?: number;
styleContainer?: StyleProp<ViewStyle>;
};
const SelectCustom: React.FC<SelectProps> = ({
@@ -35,6 +38,7 @@ const SelectCustom: React.FC<SelectProps> = ({
disabled = false, // <-- default false
onChange,
borderRadius = 8,
styleContainer,
}) => {
const [modalVisible, setModalVisible] = useState(false);
@@ -43,7 +47,7 @@ const SelectCustom: React.FC<SelectProps> = ({
const hasError = required && value === null; // <-- check if empty and required
return (
<View style={GStyles.inputContainerArea}>
<View style={[GStyles.inputContainerArea, styleContainer]}>
{label && (
<Text style={GStyles.inputLabel}>
{label}
@@ -52,7 +56,7 @@ const SelectCustom: React.FC<SelectProps> = ({
)}
<Pressable
style={[
{ borderRadius },
{ borderRadius, },
hasError ? GStyles.inputErrorBorder : null,
GStyles.inputContainerInput,
disabled && GStyles.disabledBox,

View File

@@ -5,28 +5,37 @@ import AdminBackButton from "./BackButton";
export default function AdminBackButtonAntTitle({
title,
rightComponent,
newComponent,
}: {
title: string;
title?: string;
rightComponent?: React.ReactNode;
newComponent?: React.ReactNode;
}) {
return (
<>
<Grid>
<Grid.Col span={2}>
<Grid.Col span={2} style={{ justifyContent: "center" }}>
<AdminBackButton />
</Grid.Col>
<Grid.Col
span={8}
style={{ alignItems: "center", justifyContent: "center" }}
>
</Grid.Col>
<Grid.Col
span={newComponent ? 10 : 8}
style={{ alignItems: "center", justifyContent: "center" }}
>
{newComponent ? (
newComponent
) : (
<TextCustom bold size={"large"} align="center">
{title}
</TextCustom>
</Grid.Col>
<Grid.Col span={2} style={{ alignItems: "flex-end" }}>
{rightComponent}
</Grid.Col>
</Grid>
</>
);
}
)}
</Grid.Col>
<Grid.Col
span={newComponent ? 0 : 2}
style={{ alignItems: "flex-end" }}
>
{rightComponent}
</Grid.Col>
</Grid>
</>
);
}

View File

@@ -0,0 +1,40 @@
import { Grid } from "@/components";
export const GridViewCustomSpan = ({
span1,
span2,
span3,
component1,
component2,
component3,
}: {
span1: number;
span2: number;
span3: number;
component1: React.ReactNode;
component2: React.ReactNode;
component3: React.ReactNode;
}) => {
return (
<Grid>
<Grid.Col
span={span1 || 4}
style={{ justifyContent: "center", paddingRight: 5, paddingLeft: 5 }}
>
{component1}
</Grid.Col>
<Grid.Col
span={span2 || 4}
style={{ justifyContent: "center", paddingRight: 5, paddingLeft: 5 }}
>
{component2}
</Grid.Col>
<Grid.Col
span={span3 || 4}
style={{ justifyContent: "center", paddingRight: 5, paddingLeft: 5 }}
>
{component3}
</Grid.Col>
</Grid>
);
};

View File

@@ -0,0 +1,34 @@
import { Grid } from "@/components";
export const GridView_4_4_4 = ({
component1,
component2,
component3,
}: {
component1: React.ReactNode;
component2: React.ReactNode;
component3: React.ReactNode;
}) => {
return (
<Grid>
<Grid.Col
span={4}
style={{ justifyContent: "center", paddingRight: 5, paddingLeft: 5 }}
>
{component1}
</Grid.Col>
<Grid.Col
span={4}
style={{ justifyContent: "center", paddingRight: 5, paddingLeft: 5 }}
>
{component2}
</Grid.Col>
<Grid.Col
span={4}
style={{ justifyContent: "center", paddingRight: 5, paddingLeft: 5 }}
>
{component3}
</Grid.Col>
</Grid>
);
};