Skip to content

Commit 3f30e35

Browse files
Profile card (#4)
* Add notebook-card * new update * profile card added * changes * new changes * fix: update ESLint flat config and disable warnings for unused vars/any * Fix GitHub Actions workflow: install pnpm before running lint * Update lint script to ignore warnings
1 parent 8871ffb commit 3f30e35

File tree

13 files changed

+4002
-2226
lines changed

13 files changed

+4002
-2226
lines changed

.github/workflows/review.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,23 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v4
12+
1213
- name: Setup Node.js
1314
uses: actions/setup-node@v4
1415
with:
1516
node-version: 18
16-
- run: pnpm install
17-
- run: pnpm run lint
18-
- uses: reviewdog/action-eslint@v1
17+
18+
- name: Install pnpm
19+
run: npm install -g pnpm
20+
21+
- name: Install dependencies
22+
run: pnpm install
23+
24+
- name: Run lint
25+
run: pnpm --filter @repo/ui run lint
26+
27+
- name: Run reviewdog for ESLint
28+
uses: reviewdog/action-eslint@v1
1929
with:
2030
github_token: ${{ secrets.GITHUB_TOKEN }}
2131
reporter: github-pr-review

apps/web/app/page.tsx

Lines changed: 70 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,78 @@
1-
import { Suspense } from "react";
1+
"use client";
2+
import { MainHomeLayout } from "@repo/web-ui/layout";
3+
import React, { useCallback, Suspense } from "react";
4+
import { useSearchParams, useRouter } from "next/navigation";
25
import "./page.module.css";
3-
import TabContents from "./tabs";
6+
import QuizMarkdownEditor from "../components/markdown-editor";
7+
import ChatgptEditor from "../components/chatgpt-editor";
8+
import XEditor from "../components/x-editor";
9+
import NotebookEditor from "../components/notebook-editor";
10+
import GradientEditor from "../components/gradient-editor";
11+
import ProfileEditor from "../components/profile-editor";
12+
13+
import { CardSizeProvider } from "@repo/ui/context/CardSizeContext";
14+
15+
const tabs = [
16+
{
17+
key: "markdown",
18+
label: "Markdown Card",
19+
},
20+
{
21+
key: "chatgpt",
22+
label: "ChatGPT Card",
23+
},
24+
{
25+
key: "gradient",
26+
label: "Gradient Card",
27+
},
28+
{
29+
key: "x",
30+
label: "X Card",
31+
},
32+
{
33+
key: "notebook",
34+
label: "Notebook Card",
35+
},
36+
{
37+
key: "profile",
38+
label: "Profile Card",
39+
},
40+
41+
42+
];
43+
44+
function HomeContent() {
45+
const searchParams = useSearchParams();
46+
const router = useRouter();
47+
48+
const currentTab = searchParams.get("t") || "markdown";
49+
50+
const setTab = useCallback((newTab: string) => {
51+
const params = new URLSearchParams(searchParams.toString());
52+
params.set("t", newTab);
53+
router.push(`?${params.toString()}`);
54+
}, [searchParams, router]);
55+
56+
return (
57+
<MainHomeLayout tab={currentTab} tabs={tabs} setTab={setTab}>
58+
<CardSizeProvider>
59+
{currentTab === "markdown" ? <QuizMarkdownEditor /> : null}
60+
{currentTab === "chatgpt" ? <ChatgptEditor /> : null}
61+
{currentTab === "gradient" ? <GradientEditor /> : null}
62+
{currentTab === "x" ? <XEditor /> : null}
63+
{currentTab === "notebook" ? <NotebookEditor /> : null}
64+
{currentTab === "profile" ? <ProfileEditor /> : null}
65+
66+
</CardSizeProvider>
67+
</MainHomeLayout>
68+
);
69+
}
470

571
export default function Home() {
672
return (
773
<Suspense fallback={<div>Loading...</div>}>
8-
<TabContents />
74+
<HomeContent />
975
</Suspense>
1076
);
1177
}
78+

apps/web/components/gradient-editor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { SliderBox, DrawInput, CheckBox } from "./common";
1111

1212
const STORAGE_KEY = "gradient-editor-v1";
1313

14-
const cardBgColor = "bg-white";
14+
const cardBgColor = "bg-yellow-200";
1515
const textColor = "text-gray-900";
1616
const borderColor = "border-gray-300";
1717

0 commit comments

Comments
 (0)