Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

react query and friends #67

Merged
merged 7 commits into from
Feb 18, 2023
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
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": ["next/core-web-vitals", "kentcdodds"],
"rules": {
"no-negated-condition": "off"
"no-negated-condition": "off",
"import/consistent-type-specifier-style": "off"
}
}
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"typescript.tsdk": "node_modules\\.pnpm\\typescript@4.9.4\\node_modules\\typescript\\lib",
"typescript.tsdk": "node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true
}
8 changes: 0 additions & 8 deletions app/(auth)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@ import { Suspense } from "react";
import "~/styles/globals.css";
import Loading from "~/app/(web)/loading";

type SeoDataManager = {
title: string;
};

const seoData: SeoDataManager = {
title: "Login Page",
};

export default function RootLayout(props: PropsWithChildren<{}>) {
return (
<div className="flex justify-between flex-col">
Expand Down
11 changes: 3 additions & 8 deletions app/(auth)/#/email/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
"use client";
import { TermsSection, AuthLoginForm } from "~/parts/Authentication";
import { FormHeader, AuthOption } from "~/components/Form";

import React from "react";
import TermsSection from "~/parts/Authentication/Terms-Section";
import FormHeader from "~/components/Form/FormHeader";
import AuthOption from "~/components/Form/AuthOption";
import AuthLoginForm from "~/parts/Authentication/AuthLoginForm";

export default function Login() {
export default function EmailLoginPage() {
return (
<div className="w-full h-fit lg:h-screen py-4 px-2 flex flex-col gap-4 justify-center items-center">
<FormHeader title={"Login to"} backTo={"/#"} />
Expand Down
11 changes: 3 additions & 8 deletions app/(auth)/#/head.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// import next script
import Script from "next/script";
import Seo from "~/components/Seo";
import { Seo } from "~/components/Seo";

type SeoDataManager = {
title: string;
Expand All @@ -9,10 +7,7 @@ type SeoDataManager = {
const seoData: SeoDataManager = {
title: "Login to Existing Account",
};

export default function Head() {
return (
<>
<Seo seoData={seoData} />
</>
);
return <Seo seoData={seoData} />;
}
13 changes: 4 additions & 9 deletions app/(auth)/#/page.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
"use client";

import AuthForm from "~/parts/Authentication/AuthForm";
import React from "react";
import { AuthForm } from "~/parts/Authentication";

export default function LoginPage() {
return (
<>
<section className={"h-screen flex justify-center items-center"}>
<AuthForm name={"Login"} />
</section>
</>
<section className={"h-screen flex justify-center items-center"}>
<AuthForm name="Login" />
</section>
);
}
21 changes: 8 additions & 13 deletions app/(auth)/register/email/page.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
"use client";
import { TermsSection, AuthRegisterForm } from "~/parts/Authentication";
import { AuthOption, FormHeader } from "~/components/Form";

import React from "react";
import TermsSection from "~/parts/Authentication/Terms-Section";
import AuthOption from "~/components/Form/AuthOption";
import FormHeader from "~/components/Form/FormHeader";
import AuthRegisterForm from "~/parts/Authentication/AuthRegisterForm";

export default function RegisterPage() {
export default function EmailRegisterPage() {
return (
<div className={"w-full h-fit lg:h-screen py-4 px-2 flex flex-col gap-4 justify-center items-center"}>
<FormHeader title={"Welcome to"} backTo={"/register"}/>
<AuthRegisterForm/>
<AuthOption ask={"Registered"}/>
<TermsSection title={"Register"}/>
<div className="w-full h-fit lg:h-screen py-4 px-2 flex flex-col gap-4 justify-center items-center">
<FormHeader title="Welcome to" backTo="/register" />
<AuthRegisterForm />
<AuthOption ask="Registered" />
<TermsSection title="Register" />
</div>
);
}
9 changes: 3 additions & 6 deletions app/(auth)/register/head.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Seo from "~/components/Seo";
import { Seo } from "~/components/Seo";

type SeoDataManager = {
title: string;
Expand All @@ -7,10 +7,7 @@ type SeoDataManager = {
const seoData: SeoDataManager = {
title: "Register New Account",
};

export default function Head() {
return (
<>
<Seo seoData={seoData} />
</>
);
return <Seo seoData={seoData} />;
}
14 changes: 5 additions & 9 deletions app/(auth)/register/page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
/* eslint-disable react/display-name */
import React from "react";
import AuthForm from "~/parts/Authentication/AuthForm";
import { AuthForm } from "~/parts/Authentication";

const RegisterPage: React.FC = React.memo(() => {
export default function RegisterPage() {
return (
<section className={"h-screen flex justify-center items-center"}>
<AuthForm name={"Register"} />
<section className="h-screen flex justify-center items-center">
<AuthForm name="Register" />
</section>
);
});

export default RegisterPage;
}
8 changes: 2 additions & 6 deletions app/(web)/competition/head.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import Seo from "~/components/Seo";
import { Seo } from "~/components/Seo";

export default function Head() {
return (
<>
<Seo seoData={{ title: "Competition" }} />
</>
);
return <Seo seoData={{ title: "Competition" }} />;
}
8 changes: 2 additions & 6 deletions app/(web)/head.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Seo from "~/components/Seo";
import { Seo } from "~/components/Seo";

type SeoDataManager = {
title: string;
Expand All @@ -9,9 +9,5 @@ const seoData: SeoDataManager = {
};

export default function Head() {
return (
<>
<Seo seoData={seoData} />
</>
);
return <Seo seoData={seoData} />;
}
21 changes: 7 additions & 14 deletions app/(web)/idea/[id]/head.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
import Seo from "~/components/Seo";
import React from "react";
import { IDEAS } from '~/data/Idea/Index/ideas';
import type { Idea } from '~/types/Idea/Index/Idea';
import { Seo } from "~/components/Seo";
import { IDEAS } from "~/data/Idea/Index/ideas";
import type { Idea } from "~/types/Idea/Index/Idea";

type ideaMeta = {
type IdeaMeta = {
params: {
id: number;
};
};

const head: React.FC<ideaMeta> = ({ params }) => {
export default function Head({ params }: IdeaMeta) {
const props: Idea = IDEAS.filter((value) => value.id == params.id)[0];
return (
<>
<Seo seoData={{ title: props.title }} />
</>
);
};

export default head;
return <Seo seoData={{ title: props.title }} />;
}
32 changes: 15 additions & 17 deletions app/(web)/idea/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
import React from "react";
import { IDEAS } from "~/data/Idea/Index/ideas";
import Content from "~/parts/Idea/Details/IdeaContent";
import type { ideaSlug } from "~/types/Idea/Details/IdeaSlug";
import type { Idea } from "~/types/Idea/Index/Idea";
import Sidebar from "~/parts/Idea/Details/IdeaSidebar";
import { IdeaContent, IdeaSidebar } from "~/parts/Idea/Details";

type IdeaPageProps = {
params: {
id: number;
};
};

export default function IdeaPage({ params }: IdeaPageProps) {
const props = IDEAS.find((value) => value.id == params.id);
if (props === undefined) return null;

const Page: React.FC<ideaSlug> = ({ params }) => {
const props: Idea = IDEAS.filter((value) => value.id == params.id)[0];
return (
<div
className={
"w-full justify-center items-center xl:px-56 text-gray-200 flex flex-col lg:flex-row"
}
>
<Content key={props.id} {...props} />
<Sidebar {...props} />
<div className="w-full justify-center items-center xl:px-56 text-gray-200 flex flex-col lg:flex-row">
<IdeaContent key={props.id} {...props} />
<IdeaSidebar {...props} />
</div>
);
};

export default Page;
}
8 changes: 2 additions & 6 deletions app/(web)/idea/create/head.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import Seo from "~/components/Seo";
import { Seo } from "~/components/Seo";

export default function Head() {
return (
<>
<Seo seoData={{ title: "Create Idea" }} />
</>
);
return <Seo seoData={{ title: "Create Idea" }} />;
}
1 change: 0 additions & 1 deletion app/(web)/idea/create/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"use client";

import React from "react";
import IdeaForm from "~/parts/Idea/Create/IdeaForm";

export default function CreateIdeaPage() {
Expand Down
8 changes: 2 additions & 6 deletions app/(web)/idea/head.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import Seo from "~/components/Seo";
import { Seo } from "~/components/Seo";

export default function Head() {
return (
<>
<Seo seoData={{ title: "Ideas" }} />
</>
);
return <Seo seoData={{ title: "Ideas" }} />;
}
23 changes: 12 additions & 11 deletions app/(web)/idea/page.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
"use client";
import { Header } from "~/parts/Idea/Index/Header";
import { SearchInput } from "~/parts/Idea/Index/SearchInput";
import { TagList } from "~/parts/Idea/Index/TagList";
import { TAGS } from "~/data/Idea/Index/tags";
import { IdeasList } from "~/parts/Idea/Index/IdeasList";
import { IDEAS } from "~/data/Idea/Index/ideas";
import { useSupabase } from "~/components/Supabase/SupabaseProvider";
import Link from 'next/link';
import Link from "next/link";
import { Header, SearchInput, TagList, IdeasList } from "~/parts/Idea/Index";
import { TAGS, IDEAS } from "~/data/Idea/Index";
import { useSupabase } from "~/components/Supabase";

export default function IdeaPage() {
export default function IdeaHomePage() {
const { session } = useSupabase();

return (
<section className="w-full h-full pt-1 md:pt-8 relative">
<Header />
Expand All @@ -21,7 +17,12 @@ export default function IdeaPage() {
</>
) : (
<div className="flex flex-col items-center justify-center pt-24">
<Link href="/#" className="text-base font-bold text-gray-200 btn bg-purple-500 hover:bg-purple-600">Please #</Link>
<Link
href="/#"
className="text-base font-bold text-gray-200 btn bg-purple-500 hover:bg-purple-600"
>
Please #
</Link>
</div>
)}
</section>
Expand Down
5 changes: 2 additions & 3 deletions app/(web)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
"use client";
import type { PropsWithChildren } from "react";
import { Suspense } from "react";
import Footer from "~/components/Footer";
import { Footer } from "~/components/Footer";
import { Navbar } from "~/components/Navigation/Navbar";
import "~/styles/globals.css";
import Loading from "~/app/(auth)/loading";

export default function RootLayout(props: PropsWithChildren<{}>) {
return (
<div className="flex justify-between flex-col h-full">
<div className={"z-20"}>
<div className="z-20">
<Navbar />
</div>
<div className="flex-1">
Expand Down
19 changes: 10 additions & 9 deletions app/(web)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import React from "react";
import Hero from "~/parts/Index/Hero";
import ContributorSection from "~/parts/Index/ContributorSection";
import BenefitSection from "~/parts/Index/BenefitSection";
import Step from "~/parts/Index/StepByStepSection/Step";
import Forms from "~/parts/Index/Forms";
import {
Hero,
ContributorSection,
BenefitSection,
StepsSection,
ContactForm,
} from "~/parts/Index";
import { contributors } from "~/data/contributor/contributors";

export default function HomePage() {
return (
<div>
<div className="max-w-7xl mx-auto">
<Hero />
<BenefitSection />
<Step />
<Forms />
<StepsSection />
<ContactForm />
<ContributorSection contributors={contributors} />
</div>
);
Expand Down
11 changes: 3 additions & 8 deletions app/(web)/user/logout/head.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// import next script
import Script from "next/script";
import Seo from "~/components/Seo";
import { Seo } from "~/components/Seo";

type SeoDataManager = {
title: string;
Expand All @@ -9,10 +7,7 @@ type SeoDataManager = {
const seoData: SeoDataManager = {
title: "Logging Out...",
};

export default function Head() {
return (
<>
<Seo seoData={seoData} />
</>
);
return <Seo seoData={seoData} />;
}
Loading