Skip to content

Commit 5fe4912

Browse files
resolved merge conflicts
2 parents 1c52702 + 8871ffb commit 5fe4912

16 files changed

Lines changed: 262 additions & 4 deletions

.github/copilot-instructions.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Copilot PR Instructions for New Component Creation
2+
3+
When submitting a PR for a **new component**, please follow these rules:
4+
5+
## 1. Tab in `apps/web/app/page.tsx`
6+
- Add a new tab for your component in `apps/web/app/page.tsx`.
7+
- The tab should allow users to navigate to your new editor.
8+
9+
## 2. Editor in `apps/web/components`
10+
- Implement the main editor logic and UI in a new file under `apps/web/components`.
11+
- Name the file appropriately (e.g., `my-component-editor.tsx`).
12+
13+
### Important:
14+
- Do **not** use other brand names in your editor component.
15+
- All states, props, and logic should be relevant to postmaker.dev (see `x-editor.tsx` for example).
16+
17+
## 3. Preview in `packages/ui/src`
18+
- Add a preview component for your new editor in `packages/ui/src`.
19+
- Name the file appropriately (e.g., `my-component-preview.tsx`).
20+
21+
## Example Structure
22+
```
23+
apps/web/app/page.tsx # Add a new tab for your component
24+
apps/web/components/ # Add your editor here
25+
packages/ui/src/ # Add your preview here
26+
```
27+
28+
## Checklist for PR Review
29+
- [ ] Tab added in `apps/web/app/page.tsx`
30+
- [ ] Editor created in `apps/web/components`
31+
- [ ] Preview created in `packages/ui/src`
32+
33+
- [ ] No other brand names used in editor component; states are relevant to postmaker.dev
34+
35+
---
36+
**PRs that do not follow this structure may be rejected or require changes.**

.github/workflows/review.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: PR Review Bot
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
lint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Setup Node.js
13+
uses: actions/setup-node@v4
14+
with:
15+
node-version: 18
16+
- run: pnpm install
17+
- run: pnpm run lint
18+
- uses: reviewdog/action-eslint@v1
19+
with:
20+
github_token: ${{ secrets.GITHUB_TOKEN }}
21+
reporter: github-pr-review
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: PR Test on Comment
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
jobs:
8+
test:
9+
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, 'test again')
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Setup Node.js
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: 22
18+
19+
- run: pnpm install
20+
- run: pnpm test

apps/web/app/layout.tsx

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,54 @@ const keyworsSeo = [
3232
];
3333

3434
export const metadata: Metadata = {
35-
title: "Postmaker.dev",
36-
description: "iClasser PosterMaker",
37-
keywords: keyworsSeo,
35+
title: "Postmaker.dev - Create Stunning Posters Online",
36+
description:
37+
"Postmaker.dev is an interactive poster maker app that allows you to design your own posters easily with our web-based tool.",
38+
generator: "Turborepo",
39+
icons: [
40+
{ url: "/favicon.ico", sizes: "any", rel: "icon" },
41+
{ url: "/favicon-32x32.png", type: "image/png", sizes: "32x32" },
42+
{ url: "/favicon-16x16.png", type: "image/png", sizes: "16x16" },
43+
],
44+
manifest: "/site.webmanifest",
45+
themeColor: [
46+
{ media: "(prefers-color-scheme: light)", color: "#ffffff" },
47+
{ media: "(prefers-color-scheme: dark)", color: "#0b0b0b" },
48+
],
49+
keywords: [
50+
"Postmaker.dev",
51+
"interactive",
52+
"posters",
53+
"poster maker",
54+
"web-based tool",
55+
"design posters",
56+
"create posters online",
57+
],
58+
authors: [{ name: "Postmaker.dev" }],
59+
openGraph: {
60+
title: "Postmaker.dev - Create Stunning Posters Online",
61+
description:
62+
"Postmaker.dev is an interactive poster maker app that allows you to design your own posters easily with our web-based tool.",
63+
url: "https://postmaker.dev",
64+
siteName: "Postmaker.dev",
65+
locale: "en_US",
66+
type: "website",
67+
images: [
68+
{
69+
url: "https://postmaker.dev/og-image.png",
70+
width: 1200,
71+
height: 630,
72+
alt: "Postmaker.dev - Create Stunning Posters Online",
73+
},
74+
],
75+
},
76+
twitter: {
77+
card: "summary_large_image",
78+
title: "Postmaker.dev - Create Stunning Posters Online",
79+
images: "https://postmaker.dev/og-image.png",
80+
description:
81+
"Postmaker.dev is an interactive poster maker app that allows you to design your own posters easily with our web-based tool.",
82+
},
3883
};
3984

4085
export default function RootLayout({

apps/web/app/page.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
"use client";
23
import { MainHomeLayout } from "@repo/web-ui/layout";
34
import React, { useCallback, Suspense } from "react";
@@ -74,4 +75,17 @@ export default function Home() {
7475
<HomeContent />
7576
</Suspense>
7677
);
77-
}
78+
}
79+
80+
import { Suspense } from "react";
81+
import "./page.module.css";
82+
import TabContents from "./tabs";
83+
84+
export default function Home() {
85+
return (
86+
<Suspense fallback={<div>Loading...</div>}>
87+
<TabContents />
88+
</Suspense>
89+
);
90+
}
91+

apps/web/app/robots.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import type { MetadataRoute } from "next"
2+
3+
export default function robots(): MetadataRoute.Robots {
4+
return {
5+
rules: [
6+
{
7+
userAgent: "*",
8+
allow: "/",
9+
disallow: ["/private/", "/admin/"],
10+
},
11+
],
12+
sitemap: "https://postamaker.dev/sitemap.xml",
13+
host: "https://postamaker.dev",
14+
}
15+
}

apps/web/app/sitemap.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import type { MetadataRoute } from "next"
2+
3+
export default function sitemap(): MetadataRoute.Sitemap {
4+
const baseUrl = "https://postmaker.dev"
5+
6+
return [
7+
{
8+
url: baseUrl,
9+
lastModified: new Date(),
10+
changeFrequency: "monthly",
11+
priority: 1,
12+
},
13+
{
14+
url: `${baseUrl}/?t=chatgpt`,
15+
lastModified: new Date(),
16+
changeFrequency: "monthly",
17+
priority: 0.8,
18+
},
19+
{
20+
url: `${baseUrl}/?t=gradient`,
21+
lastModified: new Date(),
22+
changeFrequency: "yearly",
23+
priority: 0.7,
24+
},
25+
{
26+
url: `${baseUrl}/?t=x`,
27+
lastModified: new Date(),
28+
changeFrequency: "monthly",
29+
priority: 0.9,
30+
}
31+
]
32+
}

apps/web/app/tabs.tsx

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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";
5+
import "./page.module.css";
6+
import QuizMarkdownEditor from "../components/markdown-editor";
7+
import ChatgptEditor from "../components/chatgpt-editor";
8+
import XEditor from "../components/x-editor";
9+
10+
import GradientEditor from "../components/gradient-editor";
11+
import { CardSizeProvider } from "@repo/ui/context/CardSizeContext";
12+
13+
const tabs = [
14+
{
15+
key: "markdown",
16+
label: "Markdown Card",
17+
},
18+
{
19+
key: "chatgpt",
20+
label: "ChatGPT Card",
21+
},
22+
{
23+
key: "gradient",
24+
label: "Gradient Card",
25+
},
26+
{
27+
key: "x",
28+
label: "X Card",
29+
},
30+
31+
];
32+
33+
export default function TabContents() {
34+
const searchParams = useSearchParams();
35+
const router = useRouter();
36+
37+
const currentTab = searchParams.get("t") || "markdown";
38+
39+
const setTab = useCallback((newTab: string) => {
40+
const params = new URLSearchParams(searchParams.toString());
41+
params.set("t", newTab);
42+
router.push(`?${params.toString()}`);
43+
}, [searchParams, router]);
44+
45+
return (
46+
<MainHomeLayout tab={currentTab} tabs={tabs} setTab={setTab}>
47+
<CardSizeProvider>
48+
{currentTab === "markdown" ? <QuizMarkdownEditor /> : null}
49+
{currentTab === "chatgpt" ? <ChatgptEditor /> : null}
50+
{currentTab === "gradient" ? <GradientEditor /> : null}
51+
{currentTab === "x" ? <XEditor /> : null}
52+
</CardSizeProvider>
53+
</MainHomeLayout>
54+
);
55+
}
56+
25 KB
Loading
117 KB
Loading

0 commit comments

Comments
 (0)