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

feat/developer search paginate #13

Merged
merged 43 commits into from
Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
9236f53
feat: update rate limit
vichannnnn Jun 11, 2023
3c40421
Merge branches 'dev' and 'dev' of https://github.com/vichannnnn/holy-…
SebassNoob Jun 14, 2023
43f7044
Merge branch 'dev' of https://github.com/vichannnnn/holy-grail into dev
SebassNoob Jun 16, 2023
e57972e
Merge branch 'dev' of https://github.com/vichannnnn/holy-grail into dev
SebassNoob Jun 17, 2023
ea81e86
feat: add search and pagination to dev page
SebassNoob Jun 15, 2023
5032d3a
fix: page overflow while searching
SebassNoob Jun 16, 2023
6a00261
fix: fix pr comments
SebassNoob Jun 17, 2023
e5df24b
fix: incorrect override for HStackStyles
SebassNoob Jun 17, 2023
afb164b
fix: remove unnecessary comments, imports
SebassNoob Jun 17, 2023
29d11eb
fix: cleanup editmodal code
SebassNoob Jun 18, 2023
8e637a2
feat: add edit note button on lib for admins
SebassNoob Jun 18, 2023
eae808b
new FE (desktop)
ddaarrrryyll Jun 18, 2023
1c9ed9f
updated FE for mobile
ddaarrrryyll Jun 18, 2023
767f092
ran yarn format
ddaarrrryyll Jun 18, 2023
552dccc
update cards
ddaarrrryyll Jun 18, 2023
e818bd8
fix: use mui for Box component
SebassNoob Jun 19, 2023
a70ac4a
Merge pull request #16 from vichannnnn/feat/lib-edit-admin
ddaarrrryyll Jun 19, 2023
f746812
fix: implement tabcontent design changes
SebassNoob Jun 19, 2023
5ab7059
fix: rewrite in mui
SebassNoob Jun 19, 2023
fe1e3d0
fix: rewrite in mui
SebassNoob Jun 20, 2023
3e56fe2
fix: do approvalscreen
SebassNoob Jun 20, 2023
1e1c211
adjust spacing between text fields
ddaarrrryyll Jun 20, 2023
b568d05
Merge pull request #15 from vichannnnn/fix/cleanup-editmodal
ddaarrrryyll Jun 20, 2023
bbe493b
new FE (desktop)
ddaarrrryyll Jun 18, 2023
ce7eac6
updated FE for mobile
ddaarrrryyll Jun 18, 2023
8bbb575
ran yarn format
ddaarrrryyll Jun 18, 2023
b5d8612
update cards
ddaarrrryyll Jun 18, 2023
f4adbde
Merge branch 'new-FE' of https://github.com/vichannnnn/holy-grail int…
ddaarrrryyll Jun 20, 2023
a9ac095
Merge pull request #17 from vichannnnn/new-FE
ddaarrrryyll Jun 20, 2023
fe90cde
fix: rewrite in mui
SebassNoob Jun 20, 2023
7bb989d
fix: do approvalscreen
SebassNoob Jun 20, 2023
318ec18
Merge branch 'fix/remove-chakra-admin' of https://github.com/vichannn…
ddaarrrryyll Jun 20, 2023
b455721
rebase dev
ddaarrrryyll Jun 20, 2023
c799732
Merge branch 'dev' into fix/remove-chakra-admin
ddaarrrryyll Jun 20, 2023
4f692d2
Merge pull request #18 from vichannnnn/fix/remove-chakra-admin
ddaarrrryyll Jun 20, 2023
a835a5c
feat: add search and pagination to dev page
SebassNoob Jun 15, 2023
26d6fca
fix: page overflow while searching
SebassNoob Jun 16, 2023
76a559b
fix: fix pr comments
SebassNoob Jun 17, 2023
25fb7a4
fix: incorrect override for HStackStyles
SebassNoob Jun 17, 2023
8023247
fix: remove unnecessary comments, imports
SebassNoob Jun 17, 2023
306a263
fix: implement tabcontent design changes
SebassNoob Jun 19, 2023
f33f7e5
Merge branch 'feat/developer-search-paginate' of https://github.com/v…
ddaarrrryyll Jun 20, 2023
6b77973
rebase
ddaarrrryyll Jun 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
200 changes: 195 additions & 5 deletions holy-grail-frontend/src/App.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,188 @@
#root {
text-align: center;
background-color: white;
min-width: 100%;
box-sizing: border-box;
/* font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

:root {
--header-height: 3rem;

/* colors */
--hue: 0;
--sat: 0%;
--title-color: hsl(var(--hue), var(--sat), 20%);
--title-color-dark: hsl(var(--hue), var(--sat), 0%);
--text-color: hsl(var(--hue), var(--sat), 30%);
--body-color: hsl(var(--hue), var(--sat), 98%);
--alt-color: hsl(var(--hue), var(--sat), 50%);
--container-color: #FFFFFF;

/* font */
--body-font: "Poppins", sans-serif;

--big-font-size: 3.5rem;
--h1-font-size: 2.25rem;
--h2-font-size: 1.75rem;
--h3-font-size: 1.25rem;
--normal-font-size: 1rem;
--small-font-size: 0.875rem;
--smaller-font-size: 0.813rem;
--tiny-font-size: 0.625rem;

--font-normal: 400;
--font-medium: 500;
--font-semi-bold: 600;

--mb-0-25: 0.25rem;
--mb-0-5: 0.5rem;
--mb-0-75: 0.75rem;
--mb-1: 1rem;
--mb-1-5: 1.5rem;
--mb-2: 2rem;
--mb-2-5: 2.5rem;
--mb-3: 3rem;

--z-tooltip: 10;
--z-fixed: 100;
--z-modal: 1000;
}

*:not(span) {
margin: 0;
padding: 0;
box-sizing: border-box;
}

a {
color: var(--title-color);
}

html {
scroll-behavior: smooth;
}

body,
button,
input,
textarea {
font-family: var(--body-font);
font-size: var(--normal-font-size);
}

body {
background-color: var(--body-color);
color: var(--text-color)
}

h1, h2, h3 {
color: var(--title-color);
font-weight: var(--font-semi-bold);
}

ul {
list-style: none;
}

a {
text-decoration: none;
}

button {
cursor: pointer;
border: none;
outline: none;
}

img {
max-width: 100%;
height: auto;
}

.hr.horizontal-divider {
border-top: 3px solid var(--alt-color)
}

.text-underline {
text-decoration: underline;
text-decoration-thickness: 2px;
}

.bold-text {
font-weight: var(--font-semi-bold);
font-size: var(--normal-font-size);
}

.section {
padding: 0 2rem;
}

.section__title {
font-size: var(--h1-font-size);
color: var(--title-color);
font-weight: var(--font-semi-bold);
}

.section__subtitle {
display: block;
font-size: var(--normal-font-size);
color: var(--alt-color);
margin-bottom: 2%;
}

.sub-section__title {
font-size: var(--h2-font-size);
font-weight: var(--font-semi-bold);
}

.section__title,
.section__subtitle,
.sub-section__title {
margin-left: auto;
text-align: left;
}

.img-caption {
margin-top: 2rem;
text-align: center;
}
.caption__content,
.caption__title {
width: 100%;
}
.caption__title {
font-weight: var(--font-semi-bold);
}
.caption__content {
font-size: var(--small-font-size);
}
.caption__title,
.caption__content {
display: inline-block;
margin: 0 auto;
}

.button-text {
font-weight: var(--font-semi-bold);
color: var(--text-color);
}

.text__link {
font-weight: var(--font-semi-bold);
color: steelblue;
}

.text__link:hover {
text-decoration: underline;
cursor: pointer;
}

/* layout */
.container {
max-width: 1440px;
margin-left: auto;
margin-right: auto;
}

.grid {
display: grid;
gap: 1.5rem;
}

.logo {
Expand Down Expand Up @@ -39,4 +219,14 @@
a:nth-of-type(2) .logo {
animation: logo-spin infinite 20s linear;
}
}

@media screen and (max-width: 1080px) {
:root {
--h1-font-size: 2rem;
--normal-font-size: 0.95rem;
}
.bold-text {
margin-top: 1rem;
}
}
9 changes: 5 additions & 4 deletions holy-grail-frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import "./App.css";
import { ChakraProvider } from "@chakra-ui/react";
import NavBar from "./features/NavBar/NavBar";
import LoginPage from "./features/SignIn/LoginPage";
import LandingPage from "./features/Landing/LandingPage";
import Library from "./features/Library/Library";
import { BrowserRouter as Router, Route, Routes } from "react-router-dom";
import Footer from "./features/Footer/Footer";
import SignUpPage from "./features/SignUp/SignUpPage";
Expand All @@ -17,16 +15,19 @@ import ForgotPasswordPage from "./features/ForgotPassword/ForgotPasswordPage";
import ResetPasswordPage from "./features/ResetPassword/ResetPasswordPage";
import AccountVerifyPage from "./features/AccountVerify/AccountVerifyPage";

import Header from "./features/Header/Header";

function App() {
return (
<AuthProvider>
<ChakraProvider>
<Router>
<NavBar />
<Header />
{/*<NavBar />*/}
<Routes>
<Route path="/" element={<LandingPage />} />
<Route path="/login" element={<LoginPage />} />
<Route path="/library" element={<Library />} />
{/*<Route path="/library" element={<Library />} />*/}
<Route path="/register" element={<SignUpPage />} />
<Route path="/upload" element={<UploadPage />} />
<Route path="/admin" element={<ApprovalPage />} />
Expand Down
4 changes: 1 addition & 3 deletions holy-grail-frontend/src/components/HomeButton/HomeButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ export const HomeButton = forwardRef<
h="40px"
{...props}
>
<Text fontWeight="bold" color="black">
{children}
</Text>
<div className="button-text">{children}</div>
</Button>
</>
);
Expand Down
22 changes: 9 additions & 13 deletions holy-grail-frontend/src/components/NotesTable/NotesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { ComboboxProps } from "../../features/Library/Combobox";
import { createTheme, ThemeProvider } from "@mui/material/styles";
import { Pagination } from "../Pagination/Pagination";
import { useMediaQuery } from "react-responsive";
import "../../features/Library/library.css";

interface NotesTableProps {
notes: Note[];
categories: ComboboxProps["options"];
Expand Down Expand Up @@ -56,22 +58,16 @@ const NotesTable = ({
return (
<Box>
<ThemeProvider theme={muiTheme}>
<Box
display="flex"
flexDirection="column"
alignItems="center"
mr="auto"
ml="auto"
sx={{ width: "80%" }}
>
<Box display="flex" flexDirection="column" alignItems="center">
<Box
display="flex"
flexDirection={isMobile ? "column" : "row"}
justifyContent="space-around"
gap={2}
marginBottom={2}
sx={{ width: "90%" }}
sx={{ width: "100%" }}
alignItems="center"
>
<div className="bold-text">Filter By:</div>
<Combobox
label="Category"
value={category}
Expand All @@ -80,7 +76,7 @@ const NotesTable = ({
handlePageChange(1);
}}
options={categories}
style={{ width: isMobile ? "100%" : "30%" }}
style={{ width: isMobile ? "100%" : "15%" }}
/>
<Combobox
label="Subject"
Expand All @@ -90,7 +86,7 @@ const NotesTable = ({
handlePageChange(1);
}}
options={subjects}
style={{ width: isMobile ? "100%" : "30%" }}
style={{ width: isMobile ? "100%" : "15%" }}
/>
<Combobox
label="Type"
Expand All @@ -100,7 +96,7 @@ const NotesTable = ({
handlePageChange(1);
}}
options={types}
style={{ width: isMobile ? "100%" : "30%" }}
style={{ width: isMobile ? "100%" : "15%" }}
/>
</Box>
<Grid container mt="3%" spacing={2} sx={{ width: "90%" }}>
Expand Down
13 changes: 11 additions & 2 deletions holy-grail-frontend/src/components/Pagination/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,22 @@ import debounce from "lodash/debounce";
interface PaginationProps {
pageInfo: { page: number; size: number; total: number; pages: number };
handlePageChange: (newPage: number) => void;
styles?: { mt: string };
}

export const Pagination = ({ pageInfo, handlePageChange }: PaginationProps) => {
export const Pagination = ({
pageInfo,
handlePageChange,
styles,
}: PaginationProps) => {
const debouncedHandlePageChange = debounce(handlePageChange, 100);

return (
<HStack spacing={4} justifyContent="center" mt="10%">
<HStack
spacing={4}
justifyContent="center"
mt={styles?.mt ? styles.mt : "10%"}
>
<Button
onClick={() => debouncedHandlePageChange(pageInfo.page - 1)}
isDisabled={pageInfo.page === 1}
Expand Down
Loading