Skip to content

Commit

Permalink
Form page + milestone (vechain#6)
Browse files Browse the repository at this point in the history
* form start

* form

* milestones

---------

Co-authored-by: WillowMT <[email protected]>
  • Loading branch information
Tapple214 and WillowMT authored Sep 14, 2024
1 parent 14c6196 commit 9fa027d
Show file tree
Hide file tree
Showing 5 changed files with 188 additions and 21 deletions.
15 changes: 11 additions & 4 deletions apps/frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import Home from "./routes/home";
import Protected from "./routes/protected";
import Settings from "./routes/settings";
import Login from "./routes/login";
import Form from "./routes/form";
import Milestones from "./routes/milestones";

function App() {
const path = location.pathname;
// const path = location.pathname;

return (
<BrowserRouter>
<ChakraProvider theme={lightTheme}>
Expand All @@ -22,16 +24,21 @@ function App() {
logLevel={"DEBUG"}
>
<div className="">
{path != "/" ? <Navbar /> : <></>}
{/* {path === "/" || path === "/form" ? null : <Navbar />} */}

<div className="min-h-[80vh] relative">
<Routes>
<Route path="/" element={<Home />} />
<Route path="/reduceForm" element={<Form type="reduce" />} />
<Route path="/offsetForm" element={<Form type="offset" />} />
<Route path="/protected" element={<Protected />} />
<Route path="/settings" element={<Settings />} />
<Route path="/login" element={<Login />} />
<Route path="/milestones" element={<Milestones />} />
</Routes>
</div>
{path != "/" ? <Footer /> : <></>}

{/* {path === "/" || path === "/form" ? null : <Footer />} */}
</div>
{/* MODALS */}
<SubmissionModal />
Expand Down
16 changes: 16 additions & 0 deletions apps/frontend/src/routes/form.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@


.parallax {
min-height: 70px;
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}

.scroll-container {
height: 870px;
background-color: #efefef;
font-size: 36px;
padding: 40px;
}
99 changes: 99 additions & 0 deletions apps/frontend/src/routes/form.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import React, { useState } from "react";
import { Box, Button, HStack, Text } from "@chakra-ui/react";
import { Dropzone } from "../components";
import { Link } from "react-router-dom";
import "./form.css";

export default function Form({ type }: { type: "reduce" | "offset" }) {
const [category, setCategory] = useState("All");

// Define categories based on the type prop
const categories =
type === "reduce"
? ["Transport", "Self care"]
: ["Tree planting", "Volunteering"];

return (
<Box
bg="#efefef"
minHeight="100vh"
position="relative"
padding="5"
color="#2a3d29"
>
<div style={{ position: "absolute", top: "10px", right: "10px" }}>
<Link to="/" style={{ textDecoration: "none" }}>
<Button
bg="#2a3d29"
color="#c5dcc2"
_hover={{ bg: "#c5dcc2", color: "#2a3d29" }}
width="200px"
>
Go back
</Button>
</Link>
</div>
<Text textAlign="center" fontSize="5xl" fontWeight="bold">
How to get your vet?{" "}
</Text>

{/* Category area */}
<Text fontSize="2xl" fontWeight="bold">
{" "}
Step 1{" "}
</Text>
<Text paddingTop="1"> Step 1asdkjndsfkjcnkjsd </Text>
<HStack spacing={3} overflowX="auto">
{categories.map((categoryName) => (
<Button
key={categoryName}
px={4}
borderRadius="full"
variant={category === categoryName ? "solid" : "outline"}
bg={category === categoryName ? "#4e6b4c" : "#c5dcc2"}
color={category === categoryName ? "#c5dcc2" : "#2a3d29"}
onClick={() => setCategory(categoryName)}
>
{categoryName}
</Button>
))}
</HStack>

{/* Dropzone area */}
<Text fontSize="2xl" fontWeight="bold" paddingTop="2">
{" "}
Step 2{" "}
</Text>
<Text> Step 1asdkjndsfkjcnkjsd </Text>
<Dropzone />

{/* Submit area */}
<Text fontSize="2xl" fontWeight="bold" paddingTop="2">
{" "}
Step 3{" "}
</Text>
<Text> Step 1asdkjndsfkjcnkjsd </Text>

<div style={{ position: "absolute", bottom: "10px", right: "10px" }}>
<Button
bg="#2a3d29"
color="#c5dcc2"
_hover={{ bg: "#c5dcc2", color: "#2a3d29" }}
width="100px"
marginRight="15"
>
Generate
</Button>

<Button
bg="#2a3d29"
color="#c5dcc2"
_hover={{ bg: "#c5dcc2", color: "#2a3d29" }}
width="100px"
>
Confirm
</Button>
</div>
</Box>
);
}
39 changes: 22 additions & 17 deletions apps/frontend/src/routes/home.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Card, CardBody, Flex, Button, Image, Text } from "@chakra-ui/react";
import { Link } from "react-router-dom";
import "./home.css";

export default function Home() {
Expand All @@ -18,7 +19,7 @@ export default function Home() {
<div className="parallax"></div>
<Image src="/hill.png" />

<div className="scroll-container">
<div className="scroll-container" style={{ backgroundColor: "#4e6b4c" }}>
<Flex justifyContent="center" alignItems="center" height="100%" gap={8}>
<div>
<Text color="#efefef" fontSize="5xl">
Expand All @@ -45,14 +46,16 @@ export default function Home() {
</Text>

<Flex justify="center" mt="4">
<Button
bg="#2a3d29"
color="#c5dcc2"
_hover={{ bg: "#c5dcc2", color: "#2a3d29" }}
width="200px"
>
Button
</Button>
<Link to="/reduceForm" style={{ textDecoration: "none" }}>
<Button
bg="#2a3d29"
color="#c5dcc2"
_hover={{ bg: "#c5dcc2", color: "#2a3d29" }}
width="200px"
>
Get your vet!
</Button>
</Link>
</Flex>
</CardBody>
</Card>
Expand Down Expand Up @@ -83,14 +86,16 @@ export default function Home() {
</Text>

<Flex justify="center" mt="4">
<Button
bg="#2a3d29"
color="#c5dcc2"
_hover={{ bg: "#c5dcc2", color: "#2a3d29" }}
width="200px"
>
Button
</Button>
<Link to="/offsetForm" style={{ textDecoration: "none" }}>
<Button
bg="#2a3d29"
color="#c5dcc2"
_hover={{ bg: "#c5dcc2", color: "#2a3d29" }}
width="200px"
>
Get your vet!
</Button>
</Link>
</Flex>
</CardBody>
</Card>
Expand Down
40 changes: 40 additions & 0 deletions apps/frontend/src/routes/milestones.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { Grid, GridItem, Box, Text, Card } from "@chakra-ui/react";

export default function Milestones() {
return (
<Box p={4} zIndex={1000} bg="#4e6b4c" minHeight="100vh">
{/* `toast` prop is not needed unless custom configuration is passed */}
<Grid
templateColumns={{ base: "1fr", md: "2fr 1fr 1fr" }}
gap={4}
minHeight="96vh"
>
{/* Left side of the page */}
<Card>
<Box className="left-section">
{/* Form component */}
<Box className="task-form" mb={4}>
{/* <Form type="task" fetchData={fetchTasks} /> */}
</Box>
</Box>
</Card>

{/* Center column */}
<Card>
<Box textAlign="center">
<Text fontSize="2xl" fontWeight="bold" mb={2}>
Task Manager
</Text>
<Text fontSize="sm">Note your TO-DOs and keep in check!</Text>
<Box mt={4}>{/* Badges */}hi</Box>
</Box>
</Card>

{/* Right column */}
<Card>
{/* Add any additional content for the right column here */}
</Card>
</Grid>
</Box>
);
}

0 comments on commit 9fa027d

Please sign in to comment.