Skip to content

Commit

Permalink
Convert a to nextjs link (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsun969 authored Jan 20, 2024
1 parent 26a51f5 commit 43aeae1
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 21 deletions.
5 changes: 3 additions & 2 deletions src/app/(account)/join-us/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import FancyRectangle from '@/components/FancyRectangle';
import { SignedIn, SignedOut, useUser } from '@clerk/nextjs';
import Link from 'next/link';
import { useEffect } from 'react';
import ProgressBar from './ProgressBar';
import StepFour from './steps/StepFour';
Expand Down Expand Up @@ -41,9 +42,9 @@ export default function JoinUsPage() {
<span className="text-yellow">Membership costs $10</span> for the full
year. You can pay for membership online here at our website.
Alternatively, you can pay at a club event or contact one of the{' '}
<a href="/about" className="underline">
<Link href="/about" className="underline">
committee members
</a>
</Link>
.
</p>
<p className="mt-4">
Expand Down
5 changes: 3 additions & 2 deletions src/app/(account)/join-us/steps/StepOne.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Button from '@/components/Button';
import ControlledField from '@/components/ControlledField';
import { useSignUp } from '@clerk/nextjs';
import { zodResolver } from '@hookform/resolvers/zod';
import Link from 'next/link';
import { useState } from 'react';
import { useForm } from 'react-hook-form';
import { FcGoogle } from 'react-icons/fc';
Expand Down Expand Up @@ -161,9 +162,9 @@ export default function StepOne() {
<div className="flex mt-10">
<p className="text-grey text-lg md:text-base">
Already have an account?{' '}
<a href="/sign-in" className="text-orange">
<Link href="/sign-in" className="text-orange">
Sign in
</a>
</Link>
</p>
</div>
</div>
Expand Down
9 changes: 5 additions & 4 deletions src/app/(account)/sign-in/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import ControlledField from '@/components/ControlledField';
import FancyRectangle from '@/components/FancyRectangle';
import { useSignIn } from '@clerk/clerk-react';
import { zodResolver } from '@hookform/resolvers/zod';
import Link from 'next/link';
import { useForm } from 'react-hook-form';
import { FcGoogle } from 'react-icons/fc';
import { z } from 'zod';
Expand Down Expand Up @@ -102,12 +103,12 @@ export default function SignInForm() {
name="password"
type="password"
/>
<a
<Link
href="/forgot-password"
className="text-orange flex mb-8 text-lg md:text-base"
>
Forgot password?
</a>
</Link>
<Button type="submit" colour="orange" width="w-[19rem] md:w-[25.5rem]">
Sign In
</Button>
Expand All @@ -117,9 +118,9 @@ export default function SignInForm() {
<div className="flex mt-10">
<p className="text-grey text-lg md:text-base">
Don&apos;t have an account yet?{' '}
<a href="/join-us" className="text-orange">
<Link href="/join-us" className="text-orange">
Join Us
</a>
</Link>
</p>
</div>
</div>
Expand Down
23 changes: 12 additions & 11 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import FancyRectangle from '@/components/FancyRectangle';
import { useUser } from '@clerk/nextjs';
import Image from 'next/image';
import { useState, useEffect, useRef } from 'react';
import Link from 'next/link';
import { useEffect, useRef, useState } from 'react';
import { IoMdClose, IoMdMenu } from 'react-icons/io';
import Button from './Button';
import UserButton from './UserButton';
Expand Down Expand Up @@ -50,7 +51,7 @@ export default function Header() {
>
<div className={`flex flex-col w-full ${isMenuOpen ? 'px-8 py-8' : ''}`}>
<div className="flex flex-row items-center">
<a href="/" className="flex flex-row items-center">
<Link href="/" className="flex flex-row items-center">
<Image
src="/logo/logo.svg"
alt="Computer Science Club Logo"
Expand All @@ -65,7 +66,7 @@ export default function Header() {
>
CS CLUB
</h1>
</a>
</Link>

<div
className={`md:hidden absolute ${
Expand Down Expand Up @@ -107,18 +108,18 @@ export default function Header() {
isMenuOpen ? 'mt-12 space-y-8' : 'hidden'
} md:flex md:flex-row md:space-x-4 lg:space-x-8 md:space-y-0 mb-4 md:mb-0 text-4xl md:text-base`}
>
<a href="/about" className="hover:underline">
<Link href="/about" className="hover:underline">
About
</a>
<a href="/events" className="hover:underline">
</Link>
<Link href="/events" className="hover:underline">
Events
</a>
<a href="/sponsors" className="hover:underline">
</Link>
<Link href="/sponsors" className="hover:underline">
Sponsors
</a>
<a href="/contact" className="hover:underline">
</Link>
<Link href="/contact" className="hover:underline">
Contact
</a>
</Link>
<div
className={`flex flex-col md:flex-row items-center ${
isMenuOpen ? '' : 'hidden'
Expand Down
5 changes: 3 additions & 2 deletions src/components/UserButton.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Button from '@/components/Button';
import { useClerk, useUser } from '@clerk/clerk-react';
import Image from 'next/image';
import Link from 'next/link';
import { useRef, useState } from 'react';
import FancyRectangle from './FancyRectangle';

Expand Down Expand Up @@ -44,9 +45,9 @@ export default function UserButton() {
CS Club Drive
</a>
{/* Link to Manage Account Page */}
<a href="/manage-account" className="hover:underline">
<Link href="/manage-account" className="hover:underline">
Manage Account
</a>
</Link>
{/* Sign Out */}
<Button onClick={handleSignOut} colour="orange" width="w-40 md:w-32">
Sign Out
Expand Down

0 comments on commit 43aeae1

Please sign in to comment.