Add new tabs and views under Admin sidebar tab
This commit is contained in:
@@ -1,24 +1,144 @@
|
||||
import { Box, Text } from '@chakra-ui/react';
|
||||
import { Box, Text, Flex, Tabs, HStack } from '@chakra-ui/react';
|
||||
import { MEDataEntry } from './AdminTabs/MEDataEntry';
|
||||
import { ProjectCollector } from './AdminTabs/ProjectCollector';
|
||||
import { NASApplication } from './AdminTabs/NASApplication';
|
||||
import { IVANS } from './AdminTabs/IVANS'
|
||||
import { SearchBar } from "../CanvasComponents/SearchBar";
|
||||
import { SettingsButton } from "../CanvasComponents/SettingsButton";
|
||||
|
||||
export default function Admin() {
|
||||
export default function Admin({ view, onChangeView, onEditWidgets, appendWidget }) {
|
||||
// Prop Forwarding
|
||||
// const { view, layout, setLayout, setOriginalLayout, onLayoutChange, onChangeView, onCancel, setOriginalWidgets,
|
||||
// isDelete, setIsDelete, beginEditIfNeeded, isEditable, setIsEditable, widgetArray, setWidgetArray } = props;
|
||||
|
||||
// const MyDashboardProps = { layout, onLayoutChange, isEditable, beginEditIfNeeded, isDelete, DeleteWidget, widgetArray, appendWidget };
|
||||
const settingsButtonProps = { onEditWidgets, appendWidget };
|
||||
|
||||
return (
|
||||
<Box p={8} mt={4} ml="auto" mr="auto" width="600px">
|
||||
<Box
|
||||
bg="bg"
|
||||
shadow="md"
|
||||
borderRadius="md"
|
||||
p={8}
|
||||
width="600px"
|
||||
height="100px"
|
||||
textAlign="center"
|
||||
display="flex"
|
||||
alignItems="center"
|
||||
justifyContent="center"
|
||||
/* HEADER */
|
||||
<Tabs.Root
|
||||
width="100%"
|
||||
height="100%"
|
||||
lazyMount
|
||||
value={ view }
|
||||
variant="line"
|
||||
// Prevent navigation away from 'My Dashboard' while in Edit mode
|
||||
onValueChange={(e) => {
|
||||
const nextView = e.value;
|
||||
onChangeView(nextView);
|
||||
}}
|
||||
>
|
||||
<Flex
|
||||
as="header"
|
||||
position="sticky"
|
||||
top="0"
|
||||
zIndex="dropdown" // zIndex: 1100
|
||||
bg="base200"
|
||||
px={5}
|
||||
pt={3}
|
||||
pb={2}
|
||||
align="center"
|
||||
justify="space-between"
|
||||
width="100%"
|
||||
>
|
||||
<Text fontsize="2xl" fontWeight="bold" color="gray.700">
|
||||
Admin Canvas coming soon!
|
||||
</Text>
|
||||
</Box>
|
||||
</Box>
|
||||
<Tabs.List>
|
||||
<Tabs.Trigger value="medataentry" fontSize="lg">
|
||||
M&E Data Entry
|
||||
</Tabs.Trigger>
|
||||
<Tabs.Trigger value="projectcollector" fontSize="lg">
|
||||
Project Collector
|
||||
</Tabs.Trigger>
|
||||
<Tabs.Trigger value="nasapplication" fontSize="lg">
|
||||
NAS Application
|
||||
</Tabs.Trigger><Tabs.Trigger value="ivans" fontSize="lg">
|
||||
IVANS
|
||||
</Tabs.Trigger>
|
||||
</Tabs.List>
|
||||
|
||||
<HStack width="258px" justifyContent="flex-end">
|
||||
<SearchBar />
|
||||
<SettingsButton {...settingsButtonProps}/>
|
||||
</HStack>
|
||||
</Flex>
|
||||
|
||||
{/* CANVAS */}
|
||||
<Tabs.Content value="medataentry">
|
||||
<MEDataEntry />
|
||||
</Tabs.Content>
|
||||
<Tabs.Content value="projectcollector">
|
||||
<ProjectCollector />
|
||||
</Tabs.Content>
|
||||
<Tabs.Content value="nasapplication">
|
||||
<NASApplication />
|
||||
</Tabs.Content>
|
||||
<Tabs.Content value="ivans">
|
||||
<IVANS />
|
||||
</Tabs.Content>
|
||||
</Tabs.Root>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// return (
|
||||
// /* HEADER */
|
||||
// <Tabs.Root
|
||||
// width="100%"
|
||||
// height="100%"
|
||||
// lazyMount
|
||||
// value={ view }
|
||||
// variant="line"
|
||||
// // Prevent navigation away from 'My Dashboard' while in Edit mode
|
||||
// onValueChange={(e) => {
|
||||
// const nextView = e.value;
|
||||
// onChangeView(nextView);
|
||||
// }}
|
||||
// >
|
||||
// <Flex
|
||||
// as="header"
|
||||
// position="sticky"
|
||||
// top="0"
|
||||
// zIndex="dropdown" // zIndex: 1100
|
||||
// bg="base200"
|
||||
// px={5}
|
||||
// pt={3}
|
||||
// pb={2}
|
||||
// align="center"
|
||||
// justify="space-between"
|
||||
// width="100%"
|
||||
// >
|
||||
// <Tabs.List>
|
||||
// <Tabs.Trigger value="medataentry" fontSize="lg">
|
||||
// M&E Data Entry
|
||||
// </Tabs.Trigger>
|
||||
// <Tabs.Trigger value="projectcollector" fontSize="lg">
|
||||
// Project Collector
|
||||
// </Tabs.Trigger>
|
||||
// <Tabs.Trigger value="nasapplication" fontSize="lg">
|
||||
// NAS Application
|
||||
// </Tabs.Trigger><Tabs.Trigger value="ivans" fontSize="lg">
|
||||
// IVANS
|
||||
// </Tabs.Trigger>
|
||||
// </Tabs.List>
|
||||
// <HStack width="258px" justifyContent="flex-end">
|
||||
// <SearchBar />
|
||||
// <SettingsButton onEditWidgets={onEditWidgets} appendWidget={appendWidget}/>
|
||||
// </HStack>
|
||||
// </Flex>
|
||||
|
||||
// {/* CANVAS */}
|
||||
// <Tabs.Content value="medataentry">
|
||||
// <MEDataEntry />
|
||||
// </Tabs.Content>
|
||||
// <Tabs.Content value="projectcollector">
|
||||
// <ProjectCollector />
|
||||
// </Tabs.Content>
|
||||
// <Tabs.Content value="nasapplication">
|
||||
// <NASApplication />
|
||||
// </Tabs.Content>
|
||||
// <Tabs.Content value="ivans">
|
||||
// <IVANS />
|
||||
// </Tabs.Content>
|
||||
// </Tabs.Root>
|
||||
// );
|
||||
// }
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
import { Box, Text } from "@chakra-ui/react";
|
||||
|
||||
export function IVANS() {
|
||||
return(
|
||||
<Box p={8} mt={4} ml="auto" mr="auto" width="600px">
|
||||
<Box
|
||||
bg="bg"
|
||||
shadow="md"
|
||||
borderRadius="md"
|
||||
p={8}
|
||||
width="600px"
|
||||
height="100px"
|
||||
textAlign="center"
|
||||
display="flex"
|
||||
alignItems="center"
|
||||
justifyContent="center"
|
||||
>
|
||||
<Text fontsize="2xl" fontWeight="bold" color="gray.700">IVANS dashboard coming soon.</Text>
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import { Box, Text } from "@chakra-ui/react";
|
||||
|
||||
export function MEDataEntry() {
|
||||
return(
|
||||
<Box p={8} mt={4} ml="auto" mr="auto" width="600px">
|
||||
<Box
|
||||
bg="bg"
|
||||
shadow="md"
|
||||
borderRadius="md"
|
||||
p={8}
|
||||
width="600px"
|
||||
height="100px"
|
||||
textAlign="center"
|
||||
display="flex"
|
||||
alignItems="center"
|
||||
justifyContent="center"
|
||||
>
|
||||
<Text fontsize="2xl" fontWeight="bold" color="gray.700">M&E Data Entry dashboard coming soon.</Text>
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import { Box, Text } from "@chakra-ui/react";
|
||||
|
||||
export function NASApplication() {
|
||||
return(
|
||||
<Box p={8} mt={4} ml="auto" mr="auto" width="600px">
|
||||
<Box
|
||||
bg="bg"
|
||||
shadow="md"
|
||||
borderRadius="md"
|
||||
p={8}
|
||||
width="600px"
|
||||
height="100px"
|
||||
textAlign="center"
|
||||
display="flex"
|
||||
alignItems="center"
|
||||
justifyContent="center"
|
||||
>
|
||||
<Text fontsize="2xl" fontWeight="bold" color="gray.700">NAS Application dashboard coming soon.</Text>
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import { Box, Text } from "@chakra-ui/react";
|
||||
|
||||
export function ProjectCollector() {
|
||||
return(
|
||||
<Box p={8} mt={4} ml="auto" mr="auto" width="600px">
|
||||
<Box
|
||||
bg="bg"
|
||||
shadow="md"
|
||||
borderRadius="md"
|
||||
p={8}
|
||||
width="600px"
|
||||
height="100px"
|
||||
textAlign="center"
|
||||
display="flex"
|
||||
alignItems="center"
|
||||
justifyContent="center"
|
||||
>
|
||||
<Text fontsize="2xl" fontWeight="bold" color="gray.700">Project Collector dashboard coming soon.</Text>
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user