Skip to content

Commit

Permalink
Merge pull request #65 from the-collab-lab/fz-design-homepage
Browse files Browse the repository at this point in the history
Issue#55: Style Home Page
  • Loading branch information
zahrafalak authored Oct 16, 2024
2 parents 942a42e + 80d3b75 commit 5e27cee
Show file tree
Hide file tree
Showing 11 changed files with 119 additions and 38 deletions.
11 changes: 8 additions & 3 deletions src/components/CreateList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ export function CreateList({ user, setListPath }: Props) {
return (
<>
<Form onSubmit={handleSubmit}>
<h3>Create New Shopping List</h3>
<Form.Label htmlFor="newListName">Name Your List</Form.Label>
<h3 className="heading-text">
<Form.Label htmlFor="newListName">Create A New List</Form.Label>
</h3>
<InputGroup>
<br />
<Form.Control
Expand All @@ -62,7 +63,11 @@ export function CreateList({ user, setListPath }: Props) {
aria-required="true" // Indicates that this field is required
/>
<br />
<Button aria-label="Create new shopping list">Create List</Button>
<div className="custom-button-wrapper">
<Button aria-label="Create new shopping list" type="submit">
Create List
</Button>
</div>
</InputGroup>
</Form>
</>
Expand Down
17 changes: 11 additions & 6 deletions src/components/SingleList.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
@use "../styles/mixins.scss" as *;
@import "../views/unauthenticated/UnauthenticatedHome.scss";

.SingleList {
align-items: baseline;
display: flex;
flex-direction: row;
font-size: 1.2em;
@extend .custom-button-wrapper;
list-style-type: none;
}

.SingleList-label {
margin-left: 0.2em;
.SingleList button {
width: 100%;
margin: 5px;
@include tablet {
margin: 5px;
}
}
12 changes: 12 additions & 0 deletions src/styles/_mixins.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// ====== MEDIA ========
@mixin tablet {
@media (min-width: 768px) {
@content;
}
}

@mixin mobile {
@media (min-width: 375px) {
@content;
}
}
1 change: 1 addition & 0 deletions src/styles/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
$primary-beige: #f1e6cc;
$primary-blue: #3f6476;
$secondary-blue: #001f3f;
$light-blue: #356481;
Empty file removed src/views/Home.scss
Empty file.
1 change: 0 additions & 1 deletion src/views/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from "react";
import "./Home.scss";
import { List, User } from "../api";
import { AuthenticatedHome, UnauthenticatedHome } from "../views";

Expand Down
6 changes: 3 additions & 3 deletions src/views/Layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
height: 100dvh;
}

.Layout > * {
padding-inline: min(5dvw, 3.2rem);
}
// .Layout > * {
// padding-inline: min(5dvw, 3.2rem);
// }

.Layout-header {
background-color: var(--color-bg);
Expand Down
15 changes: 15 additions & 0 deletions src/views/authenticated/AuthenticatedHome.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@use "../../styles/mixins.scss" as *;

.lists {
display: block;
margin-top: 20px;
padding: 0;
margin: 0;

@include tablet {
padding: 0;
display: flex;
justify-content: space-between;
flex-flow: wrap;
}
}
16 changes: 7 additions & 9 deletions src/views/authenticated/AuthenticatedHome.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";
// import React from "react";
import { SingleList, CreateList } from "../../components";
import { List, User } from "../../api";
import "./AuthenticatedHome.scss";

interface Props {
data: List[];
Expand All @@ -10,14 +11,12 @@ interface Props {

export function AuthenticatedHome({ data, setListPath, user }: Props) {
return (
<>
<p>
Hello from the home (<code>/</code>) page!
</p>

<div className="home">
{user && (
<>
<ul>
<CreateList user={user} setListPath={setListPath} />
<h3 className="heading-text">Your Lists</h3>
<ul className="lists">
{data.map((list, index) => (
<SingleList
key={index}
Expand All @@ -27,9 +26,8 @@ export function AuthenticatedHome({ data, setListPath, user }: Props) {
/>
))}
</ul>
<CreateList user={user} setListPath={setListPath} />
</>
)}
</>
</div>
);
}
41 changes: 41 additions & 0 deletions src/views/unauthenticated/UnauthenticatedHome.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
@use "../../styles/variables.scss" as *;

.home {
background-color: rgba($primary-beige, 0.9);
border-radius: 5%;
padding: 40px;
}

.heading-text {
color: $secondary-blue;
text-align: center;
padding: 12px;
}

.normal-text {
color: $light-blue;
text-align: center;
}

.button {
background-color: $primary-blue;
border: none;
color: $primary-beige;
text-align: center;
padding: 10px 40px;
width: 170px;

&:hover {
background-color: $secondary-blue;
}
}

.custom-button-wrapper {
display: flex;
justify-content: center;
align-items: center;
}

.custom-button-wrapper button {
@extend .button;
}
37 changes: 21 additions & 16 deletions src/views/unauthenticated/UnauthenticatedHome.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react";
// import React from "react";
import "./UnauthenticatedHome.scss";
import { useNavigate } from "react-router-dom";
import { SignInButton } from "../../api";
import Button from "react-bootstrap/Button";
Expand All @@ -7,30 +8,34 @@ export function UnauthenticatedHome() {
const navigate = useNavigate();

return (
<div className="Home">
<h2>Welcome to GrocerEase</h2>
<p>
The next best thing to having someone else do the shopping for you!
<div className="home">
<h2 className="heading-text">Welcome to GrocerEase</h2>
<p className="normal-text">
The next best thing to having someone else do the shopping for you!{" "}
<br />
Create and manage smart lists, while it learns your shopping habits to
let you know exactly when you will need to buy that next batch of toilet
paper!
</p>

<article>
<p>New to GrocerEase:</p>
<Button
onClick={() => navigate("/about")}
aria-label="Navigate to the about application page."
className="m-2"
>
Learn More
</Button>
<SignInButton isSignIn={false} />
<h3 className="heading-text">Welcome Back:</h3>
<div className="custom-button-wrapper">
<SignInButton />
</div>
</article>

<article>
<p>Welcome Back:</p>
<SignInButton />
<h5 className="heading-text">New to GrocerEase?</h5>
<div className="custom-button-wrapper">
<Button
onClick={() => navigate("/about")}
aria-label="Navigate to the about application page."
>
Learn More
</Button>
<SignInButton isSignIn={false} />
</div>
</article>
</div>
);
Expand Down

0 comments on commit 5e27cee

Please sign in to comment.