Skip to content

Commit

Permalink
Merge pull request #163 from Kashyap1ankit/imp/san-22
Browse files Browse the repository at this point in the history
Imp/san 22
  • Loading branch information
dinxsh authored Dec 24, 2024
2 parents 8aa67ca + 4fb9301 commit c9658e0
Show file tree
Hide file tree
Showing 34 changed files with 176 additions and 85 deletions.
6 changes: 5 additions & 1 deletion app/(auth)/sign-in/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { Button } from "../../../@/components/ui/button";
import { Input } from "../../../@/components/ui/input";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { useToast } from "../../../@/components/ui/use-toast";
import { useToast } from "../../../@/hooks/use-toast";
import { signInSchema } from "../../../model/Schema/signInSchema";
import React, { useState } from "react";
import {
Expand Down Expand Up @@ -156,6 +156,7 @@ export default function SignInForm() {
className="w-full font-bold"
type="submit"
disabled={isLoading}
arial-label="signin-btn"
>
{isLoading ? (
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
Expand All @@ -174,6 +175,7 @@ export default function SignInForm() {
variant="default"
className="w-full flex gap-4"
onClick={handleGoogleSignIn}
arial-label="google-signin-btn"
>
<FaGoogle className="h-4 w-4" />
</Button>
Expand All @@ -182,6 +184,7 @@ export default function SignInForm() {
variant="default"
className="w-full flex gap-4"
onClick={handleDiscordSignIn}
arial-label="discord-signin-btn"
>
<FaDiscord className="h-4 w-4" />
</Button>
Expand All @@ -191,6 +194,7 @@ export default function SignInForm() {
<Link
href="/sign-up"
className="hover:text-blue-800 underline transition-all "
aria-label="signup-btn"
>
Sign up
</Link>
Expand Down
2 changes: 2 additions & 0 deletions app/(auth)/sign-up/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ const Page = () => {
type="submit"
className="w-full font-bold"
disabled={isSubmitting}
arial-label="signup-btn"
>
{isSubmitting ? (
<>
Expand All @@ -218,6 +219,7 @@ const Page = () => {
<Link
href="/sign-in"
className="hover:text-blue-800 underline transition-all "
aria-label="signin-btn"
>
Sign in
</Link>
Expand Down
6 changes: 5 additions & 1 deletion app/(auth)/verify/[username]/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ const VerifyAccount = () => {
/>
</CardContent>
<CardFooter>
<Button className="font-bold" type="submit">
<Button
className="font-bold"
type="submit"
arial-label="submit-btn"
>
Submit
</Button>
</CardFooter>
Expand Down
6 changes: 5 additions & 1 deletion app/blogs/[slug]/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ const page = async ({ params }) => {
return (
<div className="flex flex-col items-center gap-7">
<h1 className="relative flex flex-row items-center">
<Link href="/blog" className="absolute mt-2 left-[-128px]">
<Link
href="/blog"
className="absolute mt-2 left-[-128px]"
aria-label="blog-redirect"
>
<ArrowLeft />
</Link>
<span className="block mt-2 text-3xl font-bold leading-8 tracking-tight text-center sm:text-4xl">
Expand Down
8 changes: 7 additions & 1 deletion app/blogs/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,14 @@ const page = async () => {
<Button
asChild
className="bg-blue-600 hover:bg-blue-700 text-white font-semibold py-2 px-4 rounded"
arial-label="read-more-btn"
>
<Link href={`/blogs/${item.currentSlug}`}>Read More</Link>
<Link
href={`/blogs/${item.currentSlug}`}
aria-label="read-more"
>
Read More
</Link>
</Button>
</CardContent>
</Card>
Expand Down
1 change: 1 addition & 0 deletions app/bracket/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const BracketPage = () => {
<Link
href="/bracket/create"
className={`ml-auto ${buttonVariants({ variant: "default" })}`}
aria-label="bracket-create-redirect"
>
Create a bracket
</Link>
Expand Down
4 changes: 3 additions & 1 deletion app/create/team/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,9 @@ export default function CreateTeamForm() {
/>
</div>
<div className="flex justify-center">
<Button type="submit">Create</Button>
<Button type="submit" arial-label="team-create-btn">
Create
</Button>
</div>
</form>
</Form>
Expand Down
25 changes: 20 additions & 5 deletions app/create/tournament/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,9 @@ export default function Page() {
Prize Configuration{" "}
<span className="text-foreground/50 text-sm"></span>
</h3>
<Button className="px-4 py-2 rounded">Add Prize</Button>
<Button arial-label="add-prize-btn" className="px-4 py-2 rounded">
Add Prize
</Button>
</div>

{/* Rules */}
Expand All @@ -351,13 +353,20 @@ export default function Page() {
className="w-fit bg-foreground/5 p-2 rounded mb-2 text-sm"
placeholder="Enter Rule"
/>
<Button className="px-4 py-2 rounded w-fit">Add Rule</Button>
<Button
arial-label="add-rule-btn"
className="px-4 py-2 rounded w-fit"
>
Add Rule
</Button>
</div>

{/* Sponsors */}
<div className="mt-8">
<h3 className="text-xl font-semibold mb-4">Sponsors</h3>
<Button className=" px-4 py-2 rounded">Add Sponsor</Button>
<Button arial-label="add-sponsor-btn" className=" px-4 py-2 rounded">
Add Sponsor
</Button>
</div>

{/* Game Configuration */}
Expand Down Expand Up @@ -389,7 +398,9 @@ export default function Page() {
/>
</div>
</div>
<Button className="mt-4 px-4 py-2">Add Game Config</Button>
<Button arial-label="add-game-config-btn" className="mt-4 px-4 py-2">
Add Game Config
</Button>
</div>

{/* Tournament Configuration */}
Expand Down Expand Up @@ -466,7 +477,10 @@ export default function Page() {
/>
</div>
</div>
<Button className="mt-4 px-4 py-2 rounded">
<Button
arial-label="add-tournament-config-btn"
className="mt-4 px-4 py-2 rounded"
>
Add Tournament Config
</Button>
</div>
Expand All @@ -477,6 +491,7 @@ export default function Page() {
type="submit"
className={`mt-10 px-6 py-2 rounded-md font-semibold text-white ${isSubmitting ? "bg-blue-500" : "bg-blue-600 hover:bg-blue-700"} transition-colors duration-300`}
disabled={isSubmitting}
arial-label="team-create-btn"
>
{isSubmitting ? "Creating..." : "Create Tournament"}
</button>
Expand Down
3 changes: 3 additions & 0 deletions app/create/tournament/tournament/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export default function Page() {
: "bg-slate-500 hover:bg-slate-600"
}`}
onClick={() => setSelectedPlatform(platform)}
arial-label="platform-btn"
>
{platform}
</button>
Expand Down Expand Up @@ -216,13 +217,15 @@ export default function Page() {
type="submit"
className={`px-6 py-2 rounded-md ${isSubmitting ? "bg-blue-300" : "bg-blue-600 hover:bg-blue-700"} transition-colors duration-300`}
disabled={isSubmitting}
arial-label="create-tournament-btn"
>
{isSubmitting ? "Creating..." : "Create Tournament"}
</button>
<button
type="button"
className="px-6 py-2 rounded-md text-white bg-red-600 hover:bg-red-700 transition-colors duration-300"
onClick={handleReset}
arial-label="reset-btn"
>
Reset
</button>
Expand Down
8 changes: 7 additions & 1 deletion app/games/[id]/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export default function GamePage({ params }) {
<Button
className="flex items-center gap-2 px-2 py-1 md:px-4 md:py-2 font-medium text- text-white bg-indigo-500 hover:bg-indigo-600 rounded-md active:scale-90 transition-all"
onClick={handleClick}
arial-label="fav-btn"
>
Favourite
{isFavourite ? (
Expand All @@ -93,7 +94,11 @@ export default function GamePage({ params }) {
<div className="relative">
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="outline" className="flex gap-2">
<Button
variant="outline"
className="flex gap-2"
arial-label="filter-btn"
>
Filter
<ListFilter className="w-4 h-4 mb-0.5" />
</Button>
Expand Down Expand Up @@ -152,6 +157,7 @@ export default function GamePage({ params }) {
variant="ghost"
onClick={clearFilters}
className="w-full rounded transition-colors"
arial-label="clear-filter-btn"
>
Clear Filters
</Button>
Expand Down
1 change: 1 addition & 0 deletions app/games/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export default async function page({ searchParams }) {
<Link
href={`/games/${game._id}`}
className="relative h-64 w-full rounded-xl hover:scale-105 transition-all"
aria-label="game-id-page"
>
<Image
src={game.gameBannerPhoto}
Expand Down
5 changes: 1 addition & 4 deletions app/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import Footer from "../components/Footer";
import AuthProvider from "../context/AuthProvider";
import NextTopLoader from "nextjs-toploader";
import dotenv from "dotenv";
// import { Toaster } from "react-hot-toast";
import { Toaster } from "../@/components/ui/toaster";

dotenv.config();
Expand Down Expand Up @@ -59,7 +58,7 @@ export const metadata = {
export default function RootLayout({ children }) {
return (
<AuthProvider>
<html lang="en">
<html lang="en" suppressHydrationWarning>
<body className={helvetica.className}>
<ThemeProvider
attribute="class"
Expand All @@ -71,8 +70,6 @@ export default function RootLayout({ children }) {
<Navbar />
<main className="mx-auto mt-10">{children}</main>
<Footer />

{/* <Toaster position="bottom-right" reverseOrder={true} /> */}
<Toaster />
</ThemeProvider>
</body>
Expand Down
3 changes: 3 additions & 0 deletions app/manage/tournament/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ export default function Page() {
className="p-3 bg-green-400 rounded-md text-white"
onClick={addParticipant}
disabled={loading}
arial-label="add-participant-btn"
>
{loading ? "Adding..." : "+Add Participant"}
</button>
Expand Down Expand Up @@ -221,6 +222,7 @@ export default function Page() {
className="p-3 bg-green-400 rounded-md text-white"
onClick={handleCreateStage}
disabled={loading}
arial-label="create-new-stage-btn"
>
{loading ? "Creating..." : "+Create new stage"}
</button>
Expand All @@ -238,6 +240,7 @@ export default function Page() {
className="p-3 bg-blue-400 rounded-md text-white"
onClick={handleEnableRegistration}
disabled={loading}
arial-label="enable-registration-btn"
>
{loading ? "Enabling..." : "Enable Registration"}
</button>
Expand Down
7 changes: 6 additions & 1 deletion app/onboarding/completeprofile/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export default function CompleteProfilePage() {
<button
key={idx}
type="button"
arial-label="complete-profile-btn"
className={`px-2 py-2 text-sm md:px-4 md:text-base rounded-xl transition-all
${
selectedExpLevel === button
Expand Down Expand Up @@ -149,7 +150,11 @@ export default function CompleteProfilePage() {
</div>

<div className="flex justify-end items-end">
<Button type="submit" className="px-4 py-2">
<Button
type="submit"
className="px-4 py-2"
arial-label="create-profile-submit-btn"
>
Submit
</Button>
</div>
Expand Down
1 change: 1 addition & 0 deletions app/onboarding/selectgame/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export default function SelectGamesPage() {
type="submit"
variant="outline"
className="w-full px-4 py-2 rounded"
arial-label="onboarding-selectgame-btn"
>
Submit
</Button>
Expand Down
35 changes: 1 addition & 34 deletions app/teams/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ const TeamFinder = () => {
<Button
onClick={() => router.push("/create/team")}
className="w-1/5 flex gap-2 items-center"
arial-label="create-team-btn"
>
<PlusCircle className="size-4" />
<p>Create Team</p>
Expand Down Expand Up @@ -135,37 +136,3 @@ const TeamFinder = () => {
};

export default TeamFinder;
{
/* <div className="max-w-7xl mx-auto">
<div className="flex gap-4 mb-4 ">
<input
className=" outline-none py-2 px-4 rounded-md bg-[#222124] text-sm w-4/5 "
onChange={(e) => handleTeamSearch(e.target.value)}
placeholder="Search team "
/>
<Button onClick={() => router.push("/create/team")} className="w-1/5">
Create Team
</Button>
</div>
<div className="flex flex-col md:flex-row mx-auto ">
<div className="max-h-[100vh] pt-5 transition-all overflow-y-scroll flex flex-col gap-12 no-scrollbar transition-all border-0 w-3/4">
{filteredTeams.length > 0 ? (
filteredTeams.map((team, index) => (
<TeamCard key={index} team={team} />
))
) : (
<p>No teams found. Try creating one!</p>
)}
</div>
<div className=" mx-auto border-2 w-1/4">
<FiltersSidebar
filters={filters}
setFilters={setFilters}
onReset={handleResetFilters}
/>
</div>
</div>
</div> */
}
Loading

0 comments on commit c9658e0

Please sign in to comment.