Skip to content

Commit

Permalink
Merge pull request #110 from cs3216-a3-group-4/seeleng/add-bookmarks
Browse files Browse the repository at this point in the history
fix(frontend): random things
  • Loading branch information
seelengxd authored Sep 27, 2024
2 parents 384356b + 52a9d76 commit 795b87f
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions backend/src/events/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def get_events(
if limit is not None:
event_query = event_query.limit(limit)
if offset is not None:
offset = max(0, offset)
event_query = event_query.offset(offset)

event_query = event_query.order_by(Event.rating.desc(), Event.date.desc())
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/(authenticated)/bookmarks/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const Page = ({ params }: { params: { id: string } }) => {

const pageStr = searchParams.get("page");

const page = isNumeric(pageStr) ? parseInt(pageStr!) : 1;
const page = isNumeric(pageStr) && pageStr !== "0" ? parseInt(pageStr!) : 1;

const [categoryName, setCategoryName] = useState<string>(""); // eslint-disable-line

Expand Down
2 changes: 1 addition & 1 deletion frontend/app/(unauthenticated)/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function LoginPage() {
</Box>
</CardContent>
</Card>
<div className="flex gap-x-2 w-full justify-center">
<div className="flex gap-x-2 w-full justify-center items-baseline">
<p className="text-sm text-muted-foreground">Not registered yet?</p>
<Link href="/register" size="sm">
Create an account
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/(unauthenticated)/register/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function RegisterPage() {
</Box>

{/* Login button */}
<div className="flex gap-x-2 w-full justify-center">
<div className="flex gap-x-2 w-full justify-center items-baseline">
<p className="text-sm text-muted-foreground">
Already have an account?
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export default function ResetPasswordCreateRequestForm() {
</Box>
</CardContent>
</Card>
<div className="flex gap-x-2 w-full justify-center">
<div className="flex gap-x-2 w-full justify-center items-baseline">
<p className="text-sm text-muted-foreground">Not registered yet?</p>
<Link href="/register" size="sm">
Create an account
Expand Down
5 changes: 3 additions & 2 deletions frontend/components/layout/content-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { ReactNode } from "react";
import { usePathname } from "next/navigation";

import { LoadingSpinner } from "@/components/ui/loading-spinner";
import useBreakpointMediaQuery from "@/hooks/use-breakpoint-media-query";
import { useUserStore } from "@/store/user/user-store-provider";
import { MediaBreakpoint } from "@/utils/media";
Expand Down Expand Up @@ -42,8 +43,8 @@ const ContentLayout = ({ isLoading, children }: ContentLayoutProps) => {
// TODO: fix all loading elements
if (isLoading)
return (
<div className="flex flex-1 w-full h-full max-h-full !overflow-y-auto">
loading
<div className="flex flex-1 w-full h-full max-h-full !overflow-y-auto justify-center items-center">
<LoadingSpinner className="w-24 h-24" />
</div>
);

Expand Down

0 comments on commit 795b87f

Please sign in to comment.