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

[SC-13] Make navbar and other buttons fully clickable #13

Merged
merged 3 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions webapp/src/components/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ const NavBar: React.FC = () => {
return (
<nav className="flex justify-around items-center bg-gray-800 text-white">
<div className="flex gap-4 py-2">
<Link href="/" className="hover:underline">Home</Link>
<Link href="/home" className="hover:underline">Home</Link>
</div>

<div className="flex gap-4 py-2">
<Link href="/Donate" className="hover:underline">Donate</Link>
<Link href="/donate" className="hover:underline">Donate</Link>
</div>

<div className="flex gap-4 py-2">
Expand All @@ -21,7 +21,7 @@ const NavBar: React.FC = () => {
</div>

<div className="flex gap-4 py-2">
<Link href="/AboutUs" className="hover:underline">About</Link>
<Link href="/about_us" className="hover:underline">About</Link>
</div>

<div className="flex gap-4 py-2">
Expand Down
25 changes: 22 additions & 3 deletions webapp/src/pages/charity-signup.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import React from "react";
import { useState } from "react";

const CharitySignUp: React.FC = () => {
const [isAgreed, setIsAgreed] = useState(false);

const toggleAgreement = () => {
setIsAgreed(!isAgreed);
};

return (
<div className="grid grid-cols-2 relative isolate bg-white px-6 py-24 sm:py-32 lg:px-8">
<div
Expand Down Expand Up @@ -143,18 +150,29 @@ const CharitySignUp: React.FC = () => {
></textarea>
</div>
</div>

{/* Privacy Agreement Section */}
<div className="flex items-center gap-x-4 sm:col-span-2">

{/* Small toggle button */}
<button
type="button"
className="relative flex w-8 h-4 cursor-pointer rounded-full bg-gray-200 transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-cyan-600 focus:ring-offset-2"
className={`relative flex w-8 h-4 cursor-pointer rounded-full ${
isAgreed ? "bg-cyan-600" : "bg-gray-200"
} transition-colors duration-200 ease-in-out`}
role="switch"
aria-checked="false"
aria-checked={isAgreed}
onClick={toggleAgreement}
>
<span
aria-hidden="true"
className="block h-4 w-4 transform rounded-full bg-white shadow ring-1 ring-gray-300 transition duration-200 ease-in-out"
className={`block h-4 w-4 transform rounded-full bg-white shadow ring-1 ring-gray-300 transition duration-200 ease-in-out ${
isAgreed ? "translate-x-4" : "translate-x-0"
}`}
></span>
</button>

{/* Agreement text */}
<label className="text-sm text-gray-600">
By selecting this, you agree to our{" "}
<a href="#" className="font-semibold text-cyan-600">
Expand All @@ -163,6 +181,7 @@ const CharitySignUp: React.FC = () => {
.
</label>
</div>

</div>
<div className="mt-10">
<button
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/pages/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Button } from "@/components/ui/button";

export default function HomePage() {
return (
<div className="min-h-screen flex flex-col items-center justify-center bg-gray-100 p-4">
<div className="min-h-screen flex flex-col items-center justify-center bg-gray-700 p-4">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for this change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The darker background colour reduces eyestrain I guess

<div className="grid grid-cols-1 md:grid-cols-2 gap-8 w-full max-w-5xl">
{/* Left Section - What we do */}
<Card className="bg-gray-200 flex items-center justify-center">
Expand Down