Merge branch 'feature/admin-view3' into 'main'

Add style and interactivity features to M&E Data Entry view

See merge request vkuchenik/website-framework!71
This commit is contained in:
Dan Hansen
2025-08-25 22:15:12 +00:00
@@ -111,14 +111,30 @@ const items = [
female: 550,
total: 1100,
},
{
id: "r6",
section: "Gas",
volcano: "Ranier",
country: "US",
start: "2024-07-02",
end: "2027-05-12",
type: "Deployment",
vpi10: "Yes",
downstream: 1200,
male: 570,
female: 570,
total: 1400,
},
];
export function MEDataEntry() {
const [value, setValue] = useState("");
const [selection, setSelection] = useState([]);
const {
register,
handleSubmit,
reset,
watch,
formState: { errors },
} = useForm();
@@ -184,15 +200,16 @@ export function MEDataEntry() {
<Box m={4} mt={1} border="1px solid" borderRadius="sm" borderColor="gray.500">
<Box m={4} border="1px solid">
<Box pl={1} bg="gray.200" border="1px solid" borderColor="gray.300" overflow="hidden">
<Box pl={1} bg="gray.200" border="1px solid" borderColor="gray.400">
Number of people benefitting from VDAP activities, disaggregate by sex
</Box>
<Box overflowX="auto">
<Table.Root variant="outline" size="sm">
{/* <Box overflowX="auto"> */}
<Table.ScrollArea height="240px">
<Table.Root variant="outline" overflow="initial" size="sm" stickyHeader interactive>
<Table.Header>
<Table.Row>
<Table.ColumnHeader /> {/* padding for checkboxes */}
<Table.Row bg="bg.subtle">
<Table.ColumnHeader w="40px"/>
<Table.ColumnHeader>Section</Table.ColumnHeader>
<Table.ColumnHeader>Volcano</Table.ColumnHeader>
<Table.ColumnHeader>Country</Table.ColumnHeader>
@@ -211,7 +228,8 @@ export function MEDataEntry() {
{rows}
</Table.Body>
</Table.Root>
</Box>
</Table.ScrollArea>
{/* </Box> */}
</Box>
{/* Row actions aligned right */}
<HStack justify="flex-end" p={3} pt={0} borderBottom="1px solid" borderColor="gray.300" spacing={3} >
@@ -223,8 +241,13 @@ export function MEDataEntry() {
</HStack>
{/* Form Section */}
<Box m={4} border="1px solid">
<Box pl={1} bg="gray.200" border="1px solid" borderColor="gray.300" overflow="hidden">
<Box
as="form"
onSubmit={handleSubmit(onSubmit)}
m={4}
border="1px solid"
>
<Box pl={1} bg="gray.200" border="1px solid" borderColor="gray.400" overflow="hidden">
Fill in Form
</Box>
@@ -237,7 +260,7 @@ export function MEDataEntry() {
<Field.Root orientation="horizontal" flex="1" minW="260px">
<Field.Label>Start Date of Assistance:</Field.Label>
<Input {...register("startdate")} placeholder="9/6/1987" />
<Input {...register("startdate", { valueAsDate: true })} placeholder="9/6/1987" />
</Field.Root>
<Field.Root orientation="horizontal" flex="1">
@@ -254,29 +277,29 @@ export function MEDataEntry() {
<Field.Root orientation="horizontal" flex="1" minW="260px">
<Field.Label>End Date of Assistance:</Field.Label>
<Input {...register("enddate")} placeholder="7/14/2054" />
<Input {...register("enddate", { valueAsDate: true })} placeholder="7/14/2054" />
</Field.Root>
<Field.Root orientation="horizontal" flex="1">
<Field.Label>Downstream Affected Population:</Field.Label>
<Input {...register("downstream")} placeholder="1337" />
<Input {...register("downstream", { valueAsNumber: true })} placeholder="1337" />
</Field.Root>
</HStack>
<HStack spacing={6} align="flex-start" w="100%" flexWrap="wrap">
<Field.Root orientation="horizontal" flex="1" minW="260px">
<Field.Label>Male Population:</Field.Label>
<Input {...register("male")} placeholder="1776" />
<Input {...register("male", { valueAsNumber: true })} placeholder="1776" />
</Field.Root>
<Field.Root orientation="horizontal" flex="1" minW="260px">
<Field.Label>Female Population:</Field.Label>
<Input {...register("female")} placeholder="1892" />
<Input {...register("female", { valueAsNumber: true })} placeholder="1892" />
</Field.Root>
<Field.Root orientation="horizontal" flex="1">
<Field.Label>Total Population:</Field.Label>
<Input {...register("total")} placeholder="3668" />
<Input {...register("total", { valueAsNumber: true })} placeholder="3668" />
</Field.Root>
</HStack>
@@ -290,7 +313,7 @@ export function MEDataEntry() {
<Button type="submit" variant="solid" colorPalette="green" >
Add
</Button>
<Button type="submit">
<Button onClick={() => reset()}>
Reset
</Button>
</ButtonGroup>