-
Notifications
You must be signed in to change notification settings - Fork 2
Profile card #4
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
Merged
Merged
Profile card #4
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6e72ae7
Add notebook-card
Khalidnoori568 4cefeb5
new update
Khalidnoori568 18d4642
profile card added
Khalidnoori568 5248cb3
changes
Khalidnoori568 1c52702
new changes
Khalidnoori568 5fe4912
resolved merge conflicts
Khalidnoori568 6b93839
fix: update ESLint flat config and disable warnings for unused vars/any
Khalidnoori568 d4ea19d
Fix GitHub Actions workflow: install pnpm before running lint
Khalidnoori568 32c3231
Update lint script to ignore warnings
Khalidnoori568 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,78 @@ | ||
| import { Suspense } from "react"; | ||
| "use client"; | ||
| import { MainHomeLayout } from "@repo/web-ui/layout"; | ||
| import React, { useCallback, Suspense } from "react"; | ||
| import { useSearchParams, useRouter } from "next/navigation"; | ||
| import "./page.module.css"; | ||
| import TabContents from "./tabs"; | ||
| import QuizMarkdownEditor from "../components/markdown-editor"; | ||
| import ChatgptEditor from "../components/chatgpt-editor"; | ||
| import XEditor from "../components/x-editor"; | ||
| import NotebookEditor from "../components/notebook-editor"; | ||
| import GradientEditor from "../components/gradient-editor"; | ||
| import ProfileEditor from "../components/profile-editor"; | ||
|
|
||
| import { CardSizeProvider } from "@repo/ui/context/CardSizeContext"; | ||
|
|
||
| const tabs = [ | ||
| { | ||
| key: "markdown", | ||
| label: "Markdown Card", | ||
| }, | ||
| { | ||
| key: "chatgpt", | ||
| label: "ChatGPT Card", | ||
| }, | ||
| { | ||
| key: "gradient", | ||
| label: "Gradient Card", | ||
| }, | ||
| { | ||
| key: "x", | ||
| label: "X Card", | ||
| }, | ||
| { | ||
| key: "notebook", | ||
| label: "Notebook Card", | ||
| }, | ||
| { | ||
| key: "profile", | ||
| label: "Profile Card", | ||
| }, | ||
|
|
||
|
|
||
| ]; | ||
|
|
||
| function HomeContent() { | ||
| const searchParams = useSearchParams(); | ||
| const router = useRouter(); | ||
|
|
||
| const currentTab = searchParams.get("t") || "markdown"; | ||
|
|
||
| const setTab = useCallback((newTab: string) => { | ||
| const params = new URLSearchParams(searchParams.toString()); | ||
| params.set("t", newTab); | ||
| router.push(`?${params.toString()}`); | ||
| }, [searchParams, router]); | ||
|
|
||
| return ( | ||
| <MainHomeLayout tab={currentTab} tabs={tabs} setTab={setTab}> | ||
| <CardSizeProvider> | ||
| {currentTab === "markdown" ? <QuizMarkdownEditor /> : null} | ||
| {currentTab === "chatgpt" ? <ChatgptEditor /> : null} | ||
| {currentTab === "gradient" ? <GradientEditor /> : null} | ||
| {currentTab === "x" ? <XEditor /> : null} | ||
| {currentTab === "notebook" ? <NotebookEditor /> : null} | ||
| {currentTab === "profile" ? <ProfileEditor /> : null} | ||
|
|
||
| </CardSizeProvider> | ||
| </MainHomeLayout> | ||
| ); | ||
| } | ||
|
|
||
| export default function Home() { | ||
| return ( | ||
| <Suspense fallback={<div>Loading...</div>}> | ||
| <TabContents /> | ||
| <HomeContent /> | ||
| </Suspense> | ||
| ); | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the coding guidelines, new components should have tabs added to
apps/web/app/page.tsx. While tabs were added, the structure doesn't clearly follow the required pattern of having separate tabs for each new component (Profile card, Notebook card, and X card).