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

Home Page Styling #61

Merged
merged 11 commits into from
Apr 4, 2024
7 changes: 6 additions & 1 deletion src/api/useAuth.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { addUserToDatabase } from './firebase.js';
*/
export const SignInButton = () => (
<button
className="bg-pale-green rounded-lg px-3 py-1 text-eggshell border-2 border-sage text-off-black"
type="button"
onClick={() => signInWithPopup(auth, new GoogleAuthProvider())}
>
Expand All @@ -21,7 +22,11 @@ export const SignInButton = () => (
* A button that signs the user out of the app using Firebase Auth.
*/
export const SignOutButton = () => (
<button type="button" onClick={() => auth.signOut()}>
<button
className="bg-pale-green rounded-lg px-3 py-1 text-eggshell border-2 border-sage text-off-black"
type="button"
onClick={() => auth.signOut()}
>
Sign Out
</button>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/SingleList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function SingleList({ name, path, setListPath }) {
}

return (
<li className="SingleList">
<li className="SingleList border-2 border-sage rounded-lg bg-pale-green my-2 px-3 py-2 text-off-black w-full md:w-1/2">
DevinaG007 marked this conversation as resolved.
Show resolved Hide resolved
<button onClick={handleClick}>{name}</button>
</li>
);
Expand Down
4 changes: 2 additions & 2 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

:root.theme-light {
--color-accent: var(--color-cobalt-blue);
--color-bg: var(--color-white);
--color-bg: #fdfdf2;
--color-border: hsla(220, 13%, 78%, 1);
--color-text: var(--color-black);
}
Expand Down Expand Up @@ -59,7 +59,7 @@ html {
}

body {
background-color: var(--color-bg);
background-color: #fdfdf2;
color: var(--color-text);
font-family:
-apple-system,
Expand Down
21 changes: 12 additions & 9 deletions src/views/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,27 @@ export function Home({ data, userId, userEmail, setListPath }) {
};

return (
<div className="Home">
<p>
Hello from the home (<code>/</code>) page!
</p>
<form onSubmit={handleSubmit}>
<label htmlFor="listName">
New list name:
<div className="Home mt-8 font-Rubik">
<form
onSubmit={handleSubmit}
className="flex justify-between rounded-lg items-center"
DevinaG007 marked this conversation as resolved.
Show resolved Hide resolved
>
<label htmlFor="listName" className="text-off-black">
New list:
<input
type="text"
id="listName"
name="listName"
value={newListName}
onChange={handleChange}
className="w-2/3 ml-2 border-2 border-sage rounded-lg bg-eggshell"
/>
</label>
<button>Create</button>
<button className="bg-pale-green rounded-lg px-3 py-1 text-eggshell border-2 border-sage text-off-black">
Create
</button>
</form>
<ul>
<ul className="flex flex-col my-8 items-center text-2xl">
{data.map((item, index) => {
return (
<SingleList
Expand Down
8 changes: 5 additions & 3 deletions src/views/Layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ export function Layout() {
return (
<>
<div className="Layout">
<header className="Layout-header">
<header className="Layout-header font-Rubik flex flex-col">
<h1>Smart shopping list</h1>
{!!user ? (
<div>
<span>Signed in as {auth.currentUser.displayName}</span> (
<SignOutButton />)
<span className="mx-3">
Signed in as {auth.currentUser.displayName}
</span>
<SignOutButton />
</div>
) : (
<SignInButton />
Expand Down
1 change: 1 addition & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default {
yellow: '#FEFAE0',
vanilla: '#FAEDCD',
'pale-green': '#E9EDC9',
'off-black': '#353839',
},
extend: {
fontFamily: {
Expand Down
Loading