From bff859e6586da519b8c11f3b5acc91cbc0cca8ba Mon Sep 17 00:00:00 2001
From: Matthew Mahendra <13521007@std.stei.itb.ac.id>
Date: Tue, 14 Nov 2023 19:27:19 +0700
Subject: [PATCH] feat: Differentitate View on University User

---
 src/App.tsx                                   |  7 ++-
 .../Dashboard/UniversityDashboard.tsx         |  6 +-
 src/components/Home/UniversityHome.tsx        | 62 +++++++++++++++++++
 3 files changed, 71 insertions(+), 4 deletions(-)
 create mode 100644 src/components/Home/UniversityHome.tsx

diff --git a/src/App.tsx b/src/App.tsx
index 37e8209..2522f56 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -17,6 +17,7 @@ import { useEffect, useState } from "react"
 import { OrganizationDashboard } from "./components/Dashboard/OrganizationDashboard"
 import { UniversityDashboard } from "./components/Dashboard/UniversityDashboard"
 import { handleGetInfo } from "./utils/auth"
+import UniversityHome from "./components/Home/UniversityHome"
 
 const ROLES = {
   Organization: "organization",
@@ -73,7 +74,11 @@ function App() {
                 path="/"
                 element={
                   <Sidebar>
-                    <Home />
+                    {userInfo.role === "organization" ? (
+                      <Home />
+                    ) : (
+                      <UniversityHome />
+                    )}
                   </Sidebar>
                 }
               />
diff --git a/src/components/Dashboard/UniversityDashboard.tsx b/src/components/Dashboard/UniversityDashboard.tsx
index ed848b1..177225d 100644
--- a/src/components/Dashboard/UniversityDashboard.tsx
+++ b/src/components/Dashboard/UniversityDashboard.tsx
@@ -1,4 +1,4 @@
-import { EmailIcon } from "@chakra-ui/icons"
+import { InfoIcon } from "@chakra-ui/icons"
 import {
   Heading,
   Grid,
@@ -59,11 +59,11 @@ export const UniversityDashboard = () => {
           <GridItem w={["80%", "50%"]}>
             <Card>
               <CardHeader>
-                <EmailIcon w="8" h="8" />
+                <InfoIcon w="8" h="8" />
                 <Heading size={"lg"}>{studentCount}</Heading> Students
               </CardHeader>
               <CardBody>
-                <Link to={`/scholarships`}>
+                <Link to={`/report`}>
                   <Button colorScheme="blue" size={["sm", "lg"]}>
                     View Here
                   </Button>
diff --git a/src/components/Home/UniversityHome.tsx b/src/components/Home/UniversityHome.tsx
new file mode 100644
index 0000000..42037f3
--- /dev/null
+++ b/src/components/Home/UniversityHome.tsx
@@ -0,0 +1,62 @@
+import { Flex, Box, SimpleGrid, Heading, Text, useColorModeValue, useColorMode } from "@chakra-ui/react"
+import { ArrowForwardIcon } from "@chakra-ui/icons"
+import { Link } from "react-router-dom"
+
+const UniversityHome = () => {
+  const { colorMode, toggleColorMode } = useColorMode()
+  const boxColor = useColorModeValue("green.200", "green.800")
+
+  return (
+    <Flex direction="column" alignItems="center" justifyContent="center">
+      <Heading as="h1" size="2xl">
+        Home
+      </Heading>
+
+      <Text
+        as="h5"
+        fontSize="lg"
+        fontWeight="normal"
+        fontStyle="italic"
+        textAlign="center"
+        mt={4}
+      >
+        What do you want to do?
+      </Text>
+
+      <SimpleGrid columns={2} spacing={10} mt={8}>
+        <Box
+          bg={boxColor}
+          height="80px"
+          borderRadius="md"
+          p={4}
+          display="flex"
+          alignItems="center"
+          justifyContent="center"
+        >
+          <Link
+            to = {`/report`}
+          >
+          <ArrowForwardIcon w={6} h={6} mr={2} /> View Students
+          </Link>
+        </Box>
+        <Box
+          bg={boxColor}
+          height="80px"
+          borderRadius="md"
+          p={4}
+          display="flex"
+          alignItems="center"
+          justifyContent="center"
+        >
+          <Link
+            to = {`/dashboard`}
+          >
+            <ArrowForwardIcon w={6} h={6} mr={2} /> View Dashboard
+          </Link>
+        </Box>
+      </SimpleGrid>
+    </Flex>
+  )
+}
+
+export default UniversityHome
-- 
GitLab