Skip to content

Commit

Permalink
Merge pull request #88 from the-collab-lab/am-update-landing-page
Browse files Browse the repository at this point in the history
  • Loading branch information
amalyam committed Apr 6, 2024
2 parents f0d3651 + 536ac54 commit 6a29da7
Show file tree
Hide file tree
Showing 10 changed files with 97 additions and 24 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
/>
<link rel="icon" type="image/svg+xml" href="/src/favicon.ico" />
<link
href="https://fonts.googleapis.com/css2?family=Righteous&display=swap"
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Righteous&display=swap"
/>
<link
href="https://fonts.googleapis.com/css2?family=Reddit+Mono:[email protected]&display=swap"
Expand Down
Binary file removed public/img/checkbox.png
Binary file not shown.
1 change: 1 addition & 0 deletions public/img/home-welcome-image.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/api/useAuth.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.large-size {
margin: auto;
font-size: 35px;
height: 80px;
width: 270px;
margin-bottom: 70px;
}
12 changes: 9 additions & 3 deletions src/api/useAuth.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ import { useEffect, useState } from 'react';
import { auth } from './config.js';
import { GoogleAuthProvider, signInWithPopup } from 'firebase/auth';
import { addUserToDatabase } from './firebase.js';
import './useAuth.css';

/**
* A button that signs the user in using Google OAuth. When clicked,
* the button redirects the user to the Google OAuth sign-in page.
* After the user signs in, they are redirected back to the app.
*/
export const SignInButton = () => (
export const SignInButton = ({ largeSize }) => (
<button
type="button"
onClick={() => signInWithPopup(auth, new GoogleAuthProvider())}
className={largeSize ? 'large-size' : ''}
>
Sign In
</button>
Expand All @@ -31,8 +33,12 @@ async function handleSignOut() {
}
}

export const SignOutButton = () => (
<button type="button" onClick={() => handleSignOut()}>
export const SignOutButton = ({ largeSize }) => (
<button
type="button"
onClick={() => handleSignOut()}
className={largeSize ? 'large-size' : ''}
>
Sign Out
</button>
);
Expand Down
5 changes: 5 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ h1 {
font-family: 'Righteous', sans-serif;
}

h2,
h3 {
font-family: 'Reddit Mono', monospace;
}

h5,
p {
margin: 0;
Expand Down
9 changes: 9 additions & 0 deletions src/views/About.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
font-size: 1.5rem;
}

.About-credits {
text-align: center;
margin-left: 250px;
}

@media only screen and (max-width: 900px) {
.About-main {
max-width: 600px;
Expand All @@ -38,4 +43,8 @@
flex-direction: column;
text-align: center;
}

.About-credits {
margin-left: 0;
}
}
12 changes: 12 additions & 0 deletions src/views/About.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Link } from 'react-router-dom';
import { Emoji } from '../components';
import './About.css';

Expand Down Expand Up @@ -61,6 +62,17 @@ export function About() {
</p>
</div>
</section>
<section className="About-section">
<div className="About-section-text">
<div className="About-credits">
<h2>Credits</h2>
<p>
Home page illustration by{' '}
<Link to="https://storyset.com/web">Storyset</Link>
</p>
</div>
</div>
</section>
</main>
</>
);
Expand Down
35 changes: 31 additions & 4 deletions src/views/Home.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,39 @@
margin: 0;
}

.intro-text {
.Home-app-name {
color: #5a23b3;
font-size: 45px;
text-shadow: 1px 0.5px 0 white;
}

.Home-intro-text {
display: flex;
justify-content: center;
width: 400px;
margin: auto;
padding-bottom: 20px;
margin-top: 20px;
margin-bottom: 20px;
}

.Home-welcome-to {
font-size: 30px;
margin: auto;
margin-top: 30px;
margin-bottom: 10px;
}

.Home-register-here {
margin-top: 40px;
}

.Home-button {
font-size: 35px;
margin: auto;
height: 80px;
width: 270px;
}

img.Landing-check {
height: 200px;
img.Home-welcome {
height: 400px;
}
38 changes: 22 additions & 16 deletions src/views/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,38 @@ export function Home() {
<>
<div className="Home">
<header className="Home-header">
<h2>Welcome to Aisle Be There!</h2>
<h3 className="intro-text">
<h2 className="Home-welcome-to">welcome to</h2>
<h1 className="Home-app-name">Aisle Be There!</h1>
<h3 className="Home-intro-text">
The app for making smart shopping lists. Create lists to manage any
type of shopping, and mark items by how soon you'll need them again.
type of shopping and mark items by how soon you'll need them again.
</h3>
<img
className="Landing-check"
src="img/checkbox.png"
alt="black checkbox with green check"
className="Home-welcome"
src="img/home-welcome-image.svg"
alt="two people standing in front of a large list with a floating hand checking an item off"
/>
<h3>
New to the app? Click <Link to="/about">here</Link> to learn more!
</h3>
{!!user ? (
<div>
<span>Welcome back {auth.currentUser.displayName}!</span> (
<SignOutButton />)
<h2>Welcome back</h2>
<h2>{auth.currentUser.displayName}!</h2>
<br />
<Link to="/list">
<button className="Home-button">View Lists</button>
</Link>
<br />
<br />
<br />
<span>
View your lists <Link to="/list">here</Link>
</span>
<SignOutButton largeSize />
</div>
) : (
<div>
<span>Click 'Sign In' to register and get started: </span>
<SignInButton />
<h3>New to the app?</h3>
<Link to="/about">
<button className="Home-button">Learn More</button>
</Link>
<h3 className="Home-register-here">Register here:</h3>
<SignInButton largeSize />
</div>
)}
</header>
Expand Down

0 comments on commit 6a29da7

Please sign in to comment.