Skip to content

Commit

Permalink
Update light theme for mobile first design
Browse files Browse the repository at this point in the history
  • Loading branch information
oxr463 committed Oct 3, 2024
1 parent 0ebe52d commit 7e45a1d
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 30 deletions.
2 changes: 1 addition & 1 deletion frontend/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function App() {
return userAuth ? (
<div className="container-fluid">
<div className="row">
<div className={`col-md-4 col-lg-3 ${tagStyles.scroller} ${tagStyles.tagList}`}>
<div className={`col-md-4 col-lg-3 ${tagStyles.scroller} ${tagStyles.tagList}`} style={{ borderRadius: '0', backgroundColor: '#29b5bf' }}>
<TagList />
</div>
<div className="col-md-8 col-lg-9">
Expand Down
3 changes: 2 additions & 1 deletion frontend/components/Bookmark/bookmarkCard.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[data-bs-theme="light"] {
--tag-list-bg: #d6e6f2;
--card-bg: #d9e9e6;
--card-bg: #fff;
}

[data-bs-theme="dark"] {
Expand Down Expand Up @@ -38,6 +38,7 @@
color: mintcream;
border-color: aliceblue;
}

.container {
flex-wrap: wrap;
align-items: center;
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/Import/ImportModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ export default function ImportModal({
const handleShow = () => setModalShow(true);

return (
<div className="float-left mr-4" data-testid={dataTestId}>
<div data-testid={dataTestId}>
<button className="btn" data-testid="import-btn" onClick={handleShow}>
<i className="bi bi-file-earmark-arrow-up-fill"></i>
<i className="bi bi-file-earmark-arrow-up-fill" style={{ border: "solid", borderRadius: "10px", padding: "10px", color: "#717a83" }}></i>
</button>

<Modal
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/Navbar/Export.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ export default function Export({ 'data-testid': dataTestId }: { 'data-testid'?:

return (
<button
className="btn float-left mr-4"
className="btn"
data-testid={dataTestId}
data-bs-placement="bottom"
title="Export Bookmarks"
onClick={exportAllBookmarks}
>
<i className="bi bi-download"></i>
<i className="bi bi-download" style={{ border: "solid", borderRadius: "10px", padding: "10px", color: "#717a83" }}></i>
</button>
);
}
4 changes: 2 additions & 2 deletions frontend/components/Navbar/LightDarkToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ export default function LightDarkToggle() {
}, [theme]);

return (
<div className="float-left text-center items-center mr-5 ">
<div className="text-center items-center mr-5 ">
<button className="btn" data-testid="light-dark" onClick={changeTheme}>
<i className="bi bi-lamp-fill"></i>
<i className="bi bi-lamp-fill" style={{ border: "solid", borderRadius: "10px", padding: "10px", color: "#717a83" }}></i>
</button>
</div>
);
Expand Down
19 changes: 11 additions & 8 deletions frontend/components/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client";
import { Navbar, Button, ButtonGroup, Container } from "react-bootstrap";
import { Nav, Navbar, Button, ButtonGroup, Container } from "react-bootstrap";
import { useRouter } from "next/navigation";
import authService, { AuthStatus } from "@services/auth.service";
import useAuth from "@components/UseAuth";
Expand Down Expand Up @@ -47,7 +47,7 @@ const GlobalNavbar: React.FC = () => {
return (
<Navbar
expand="lg"
style={{ borderBottom: "1px solid", height: "60px" }}
style={{ borderBottom: "1px solid", height: "60px", zIndex: "1030" }}
className="bg-body-tertiary"
>
<Container>
Expand All @@ -64,12 +64,15 @@ const GlobalNavbar: React.FC = () => {
/>
FindFirst
</Navbar.Brand>
<div className="mx-3">
{userAuth === AuthStatus.Authorized ? <ImportModal file={undefined} show={false} data-testid="import-modal" /> : null}
{userAuth === AuthStatus.Authorized ? <Export data-testid="export-component" /> : null}
<LightDarkToggle />
{authButton()}
</div>
<Navbar.Toggle aria-controls="basic-navbar-nav" />
<Navbar.Collapse>
<Nav style={{ background: '#ffffff' }} className="float-right">
{userAuth === AuthStatus.Authorized ? <Nav.Link><ImportModal file={undefined} show={false} data-testid="import-modal" /></Nav.Link> : null}
{userAuth === AuthStatus.Authorized ? <Nav.Link><Export data-testid="export-component" /></Nav.Link> : null}
<Nav.Link><LightDarkToggle /></Nav.Link>
<Nav.Link>{authButton()}</Nav.Link>
</Nav>
</Navbar.Collapse>
</Container>
</Navbar>
);
Expand Down
7 changes: 4 additions & 3 deletions frontend/components/Tags/TagList.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"use client";
import React, { useEffect, useState } from "react";
import { Badge, ListGroup } from "react-bootstrap";
import { ArrowsCollapseVertical } from 'react-bootstrap-icons';
import { Badge, Button, ListGroup } from "react-bootstrap";
import { useTags } from "@/contexts/TagContext";
import useAuth from "@components/UseAuth";
import api from "@/api/Api";
Expand Down Expand Up @@ -61,7 +62,7 @@ const TagList = () => {
className={`d-flex m-0 w-full btn ${styles.btn} justify-content-between align-items-start`}
>
{tagCnt.tagTitle}
<Badge bg="primary" pill>
<Badge pill bg="" style={{ backgroundColor: '#717a83', color: 'white' }}>
<div
data-testid={`${tagCnt.tagTitle}-list-item-cnt`}
key={`${tagCnt.tagTitle}-list-item-badge`}
Expand Down Expand Up @@ -91,7 +92,7 @@ const TagList = () => {
return (
<div>
{!loading ? (
<ListGroup className="pt-3 w-full">{groupItems}</ListGroup>
<><ListGroup className="pt-3 w-full">{groupItems}</ListGroup></>
) : (
<div></div>
)}
Expand Down
4 changes: 1 addition & 3 deletions frontend/components/Tags/tag-pill.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@

&:hover
{
background-color: #5cb85c;
background-color: #717a83;
}
}

.on {
background-color: #29b5bf;
color: white;
}


1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"postcss": "^8.4.41",
"react": "18.3.1",
"react-bootstrap": "^2.10.4",
"react-bootstrap-icons": "^1.11.4",
"react-dom": "18.3.1",
"rxjs": "^7.8.1",
"sass": "^1.77.8",
Expand Down
19 changes: 16 additions & 3 deletions frontend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions frontend/styles/tag.module.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
.tagList {
min-height: calc(100vh - 70px);
margin-top: 5px;
padding-bottom: 5px;
min-height: calc(100vh);
border-radius: 10px;

background-color: var(--tag-list-bg);
overflow: auto;

@media screen and (max-width: 800px) {
Expand All @@ -22,7 +19,7 @@
}

@media screen and (min-width: 760px) {
max-height: calc(100vh - 70px);
max-height: calc(100vh);
}
}

Expand Down

0 comments on commit 7e45a1d

Please sign in to comment.