Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Ticket #32 - Import Image Assets for Frontend Team #155

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions frontend/web-app/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet">

<title>React App</title>
</head>
<body>
Expand Down
1 change: 1 addition & 0 deletions frontend/web-app/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import RouterProvider from './Components/Router';
import './Styles/global.css'

function App() {
return (
Expand Down
17 changes: 17 additions & 0 deletions frontend/web-app/src/Components/AddNewPlantCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react'
import '../Styles/custom/addNewPlantCard.css'

function AddNewPlantCard() {
return (
<div className='addNewPlantCard'>
<div className='addNewPlantCard-text'>
Add a new plant
</div>
<div className='addNewPlantCard-icon'>
+
</div>
</div>
)
}

export default AddNewPlantCard
49 changes: 37 additions & 12 deletions frontend/web-app/src/Components/NavBar.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,42 @@
import React from 'react'
import { Link, Outlet } from 'react-router-dom';
import React, { useMemo } from 'react'
import { Link, Outlet, useLocation } from 'react-router-dom';
import '../Styles/custom/navBar.css'

function NavBar() {
return (
<div>
<div>
<Link to="/">Home</Link>
<Link to="/about">About</Link>
<Link to="/faq">FAQ</Link>
</div>
<Outlet />
</div>
)

const location = useLocation();

const pageArray = useMemo(() => {
return [
{
name: 'Home',
path: '/',
},
{
name: 'About',
path: '/about',
},
{
name: 'FAQ',
path: '/faq',
}
]
}, [])

return (
<>
<div className='navbar'>
<div>Sproutly</div>
<div className='navbar-link-container'>
{pageArray.map((page, index)=>{
return <Link key={index} className={`navbar-link${location.pathname===page.path? ' text-white': ''}`} to={page.path}>{page.name}</Link>
})}
</div>
<button className='navbar-login-logout-button'>Log In</button>
</div>
<Outlet />
</>
)
};

export default NavBar;
25 changes: 25 additions & 0 deletions frontend/web-app/src/Components/PlantCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react'
import '../Styles/custom/plantCard.css'
import dummyImage from '../Images/dummy-image.png'

function PlantCard({status}: {status: string}) {
return (
<div className={`plantCard ${status}`}>
{status==='dry'? <div className='plantCard-dry-status-indicator'><b>Water Me!</b></div> : null}
<img className='plantCard-image' src={dummyImage} alt='Error Img'/>
<div className='plantCard-detail'>
<div>
Name: <b>Red Rose</b>
</div>
<div>
Status: <b>Good</b>
</div>
<div>
Last Watered: <b>3:15 pm</b> on <b>2/6/2025</b>
</div>
</div>
</div>
)
}

export default PlantCard
Binary file added frontend/web-app/src/Images/display-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/web-app/src/Images/display-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/web-app/src/Images/display-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/web-app/src/Images/error-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/web-app/src/Images/faq-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/web-app/src/Images/rose.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions frontend/web-app/src/Images/sproutly-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions frontend/web-app/src/Images/sproutly-text.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 16 additions & 1 deletion frontend/web-app/src/Pages/HomePage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import React, { useEffect } from 'react'
import authController from '../Controller/AuthController'
import '../Styles/custom/homePage.css'
import PlantCard from '../Components/PlantCard'
import AddNewPlantCard from '../Components/AddNewPlantCard'

function HomePage() {
// example of using APIs
Expand All @@ -17,7 +20,19 @@ function HomePage() {
}, [])

return (
<div>HomePage</div>
<div className='homePage'>
<div className='nameBar'>Vy's Plants</div>
<div className='plantViewer'>
<PlantCard status='dry'/>
<PlantCard status='good'/>
<PlantCard status='dry'/>
<PlantCard status='good'/>
<PlantCard status='good'/>
<PlantCard status='dry'/>
<PlantCard status='good'/>
<AddNewPlantCard />
</div>
</div>
)
}

Expand Down
27 changes: 27 additions & 0 deletions frontend/web-app/src/Styles/custom/addNewPlantCard.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.addNewPlantCard{
height: 532px;
width: 356px;
border-radius: 18px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background-color: #E6F2D7;
}


.addNewPlantCard-text{
font-family: 'Poppins', sans-serif;
font-weight: 700;
font-size: 25px;
line-height: 37px;
margin-bottom: 22px;
}

.addNewPlantCard-icon{
font-family: 'Poppins', sans-serif;
font-weight: 700;
font-size: 100px;
line-height: 100px;
}

23 changes: 23 additions & 0 deletions frontend/web-app/src/Styles/custom/homePage.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* Home Page CSS */

.homePage{
display: flex;
flex-direction: column;
padding: 44px 82px 94px 82px;
}

.nameBar{
font-family: "Poppins", serif;
font-size: 42px;
font-weight: 800;
color: #4C5740;
}

.plantViewer{
padding-top: 31px;
display: grid;
justify-content: center;
grid-template-columns: auto auto auto auto;
row-gap: 30px;
column-gap: 24px;
}
42 changes: 42 additions & 0 deletions frontend/web-app/src/Styles/custom/navBar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* NavBar CSS */

.navbar {
display: flex;
flex-direction: row;
justify-content: space-between;
height: 72px;
align-items: center;
padding-left: 50px;
padding-right: 50px;
background-color: #AFD582;
}

.navbar > *{
font-family: "Poppins", serif;
font-weight: 1000;
text-decoration: none;
color: #4C5740;
}

.navbar-link-container{
width: 30%;
display: flex;
flex-direction: row;
justify-content: space-between;
}

.navbar-link{
text-decoration: none;
color: #4C5740;
}

.navbar-login-logout-button{
height: 41.5px;
background-color: #E6F2D7;
display: flex;
line-height: 41.5px;
padding-left: 26px;
padding-right: 26px;
border-radius: 15px;
border-color: #E6F2D7;
}
58 changes: 58 additions & 0 deletions frontend/web-app/src/Styles/custom/plantCard.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/* Plant Card CSS */

.plantCard{
height: 532px;
width: 356px;
border-radius: 18px;
display: flex;
flex-direction: column;
align-items: center;
}

.good{
background-color: #E6F2D7;
}

.dry{
background-color: #F2DDD7;
}

.plantCard-image{
height: 326px;
width: 302px;
border-radius: 15px;
margin-top: 23px;
}

.plantCard-detail{
width: 302px;
height: 133px;
margin-top: 15px;
}

.plantCard-detail > *{
font-family: 'Poppins', sans-serif;
font-weight: 400;
font-size: 23px;
line-height: 34px;
}

.plantCard-dry-status-indicator{
background-color: #7CD1F0;
width: 150px;
height: 47px;
border-radius: 23px;
display: flex;
justify-content: center;
align-items: center;
position: absolute;
margin-top: 11px;
margin-left: 192px;
}

.plantCard-dry-status-indicator > * {
font-family: 'Poppins', sans-serif;
font-weight: 700;
font-size: 23px;
line-height: 34px;
}
14 changes: 14 additions & 0 deletions frontend/web-app/src/Styles/global.css
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
/* Global CSS */

html, body, #root, .App {
height: 100%;
width: 100%;
margin: 0px;
}

body{
overflow: scroll;
}

.text-white{
color: #FFFFFF;
}