Skip to content

Commit

Permalink
Merge pull request #47 from the-collab-lab/sign-out-btn-style
Browse files Browse the repository at this point in the history
Position of sign in/out button
  • Loading branch information
sillytsundere authored Apr 5, 2024
2 parents 22ee641 + df0b3c9 commit 427e415
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
12 changes: 4 additions & 8 deletions src/components/SingleList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@ import { useAuth } from '../api';
export function SingleList({ name, path, setListPath }) {
const { user } = useAuth();

const navigate = useNavigate();

function handleClick() {
setListPath(path);
navigate("list")
}

async function deleteSelectedList() {
if (
window.confirm(
Expand All @@ -34,13 +31,12 @@ export function SingleList({ name, path, setListPath }) {
return (
<div className="SingleList">
<li>
<button onClick={handleClick}>{name}</button>
<button aria-label={`Delete ${name}`} onClick={deleteSelectedList}>
<FontAwesomeIcon icon={faTrashCan} />
</button>
<Link to="/list" className="list-link" onClick={handleClick}>
{name}
</Link>
<button aria-label={`Delete ${name}`} onClick={deleteSelectedList}>
<FontAwesomeIcon icon={faTrashCan} />
</button>
</li>
</div>
);
Expand Down
11 changes: 10 additions & 1 deletion src/views/Layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@
margin: 0;
}

.sign-in {
display: flex;
justify-content: flex-end;
padding-top: 1em;
}

.sign-in-btn {
font-size: 1.2em;
}

.Layout-main {
margin: 0 auto;
padding-block: 0;
Expand All @@ -48,7 +58,6 @@

@media screen and (min-width: 850px) {
.home-links {
/* width: auto; */
flex-direction: row;
padding-left: 0.7em;
}
Expand Down
4 changes: 3 additions & 1 deletion src/views/Layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ export function Layout() {
<>
<div className="Layout">
<header className="Layout-header">
<div className="sign-in">
{!!user ? <SignOutButton /> : <SignInButton />}
</div>
<h1>Smart shopping list</h1>
{!!user ? <SignOutButton /> : <SignInButton />}
<Flex justify="end" px="3">
<DarkModeToggle
onChange={toggleDarkMode}
Expand Down

0 comments on commit 427e415

Please sign in to comment.