-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Revamping landingpage #74
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -20,6 +20,8 @@ jobs: | |||||
steps: | ||||||
- name: Checkout | ||||||
uses: actions/checkout@v4 | ||||||
with: | ||||||
ref: ${{ github.head_ref }} # Checkout the PR branch | ||||||
|
||||||
- uses: pnpm/action-setup@v4 | ||||||
name: Install pnpm | ||||||
|
@@ -41,27 +43,20 @@ jobs: | |||||
restore-keys: | | ||||||
${{ runner.os }}-pnpm- | ||||||
|
||||||
- name: Install dependencies | ||||||
run: pnpm install | ||||||
- name: Install dependencies & turbo | ||||||
run: pnpm install && pnpm i -g turbo | ||||||
|
||||||
- name: Check formatting with Prettier | ||||||
id: format_check | ||||||
run: | | ||||||
if pnpm format:check; then | ||||||
echo "Formatting is correct" | ||||||
else | ||||||
echo "Formatting required" | ||||||
echo "formatting_required=true" >> $GITHUB_ENV | ||||||
fi | ||||||
- name: Format code with Prettier | ||||||
run: turbo format:write | ||||||
|
||||||
- name: Check for changes and push if needed | ||||||
run: | | ||||||
if [ -n "$(git status --porcelain)" ]; then | ||||||
git config --global user.name "github-actions[bot]" | ||||||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||||||
git add . | ||||||
git commit -m "chore: format code with Prettier" | ||||||
git push | ||||||
git commit -m "format: make the code prettier" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Use conventional commit message format The current commit message "format: make the code prettier" is less descriptive and doesn't follow the conventional commits specification properly. Apply this diff to improve the commit message: - git commit -m "format: make the code prettier"
+ git commit -m "style: format code with prettier" This follows the Conventional Commits specification better by:
📝 Committable suggestion
Suggested change
|
||||||
git push origin ${{ github.head_ref }} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Secure the git push command Similar to the checkout step, using Apply this diff to improve security: - git push origin ${{ github.head_ref }}
+ git push origin "$SAFE_BRANCH_NAME" Add this before the push command: SAFE_BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
if [[ ! $SAFE_BRANCH_NAME =~ ^(feat|bugfix)/.+ || $SAFE_BRANCH_NAME == "main" ]]; then
echo "Invalid branch name for push: $SAFE_BRANCH_NAME"
exit 1
fi |
||||||
else | ||||||
echo "No formatting changes to push." | ||||||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
import { Hono } from "hono"; | ||
import { prisma } from "@repo/db"; | ||
import {auth} from "@repo/auth" | ||
|
||
import { auth } from "@repo/auth"; | ||
|
||
const app = new Hono() | ||
.get("/self", async (c) => { | ||
|
@@ -10,10 +9,13 @@ const app = new Hono() | |
}); | ||
|
||
if (!currentUser) { | ||
return c.json({ | ||
message: "Not logged in", | ||
status: 400, | ||
},400); | ||
return c.json( | ||
{ | ||
message: "Not logged in", | ||
status: 400, | ||
}, | ||
400, | ||
); | ||
} | ||
|
||
const user = await prisma.user.findUnique({ | ||
|
@@ -25,32 +27,34 @@ const app = new Hono() | |
{ | ||
user, | ||
}, | ||
200 | ||
200, | ||
); | ||
}) | ||
.get("/all", async (c) => { | ||
const cursor = c.req.query("cursor"); | ||
const take = c.req.query("take"); | ||
if (!c.req.url.includes("?cursor=")) { | ||
return c.redirect("?cursor="); | ||
return c.redirect("?cursor="); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Pagination implementation needs revision for better reliability and standards compliance The code inspection confirms the concerns raised in the review comment. The current implementation has several issues:
The suggested improvements in the review comment are valid and would make the implementation more robust and standards-compliant. 🔗 Analysis chainReview and revise the pagination implementation Several concerns with the current implementation:
Consider this improved implementation: - if (!c.req.url.includes("?cursor=")) {
- return c.redirect("?cursor=");
- }
+ const take = parseInt(take!) || 10;
+ if (isNaN(take) || take < 1 || take > 100) {
+ return c.json(
+ { message: "Invalid take parameter. Must be between 1 and 100", status: 400 },
+ 400
+ );
+ }
const users = await prisma.user.findMany({
- take: parseInt(take!) || 10,
- skip: 1,
+ take: take,
cursor: cursor
? {
id: cursor,
}
: undefined,
}); Let's verify the usage of this endpoint: Also applies to: 43-47 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Search for calls to this endpoint to understand pagination usage
rg -l "\/api\/.*\/user\/all" --type ts
Length of output: 127 Script: #!/bin/bash
# Search for API calls to user/all endpoint with proper escaping
rg -l "/api/.*/user/all" --type ts
# Search for any references to this endpoint pattern
rg -l "user/all" --type ts
# Look for fetch/axios calls that might be using this endpoint
ast-grep --pattern 'fetch($$$"/user/all"$$$)'
ast-grep --pattern 'axios.$_($$$"/user/all"$$$)'
Length of output: 162 Script: #!/bin/bash
# Let's examine the route handler file content to understand the full context
cat "apps/api/app/api/[[...route]]/user.ts"
# Look for any pagination-related patterns in the codebase
rg "findMany.*take.*skip" --type ts -A 2
# Check for other similar route handlers that might use pagination
fd "route" -e ts -x cat {}
Length of output: 2550 |
||
} | ||
|
||
const users = await prisma.user.findMany({ | ||
take: parseInt(take!) || 10, | ||
skip: 1, | ||
cursor: cursor ? { | ||
id: cursor, | ||
} :undefined | ||
cursor: cursor | ||
? { | ||
id: cursor, | ||
} | ||
: undefined, | ||
}); | ||
|
||
const nextCursor = users.length > 0 ? users[users.length - 1].id : null; | ||
|
||
return c.json( | ||
{ | ||
nextCursor, | ||
users | ||
users, | ||
}, | ||
200 | ||
200, | ||
); | ||
}) | ||
.get("/:id", async (c) => { | ||
|
@@ -70,9 +74,8 @@ const app = new Hono() | |
{ | ||
user, | ||
}, | ||
200 | ||
200, | ||
); | ||
}); | ||
|
||
|
||
export default app; | ||
export default app; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,12 +18,12 @@ | |
"@hono/zod-validator": "^0.4.1", | ||
"@prisma/client": "^5.22.0", | ||
"@repo/auth": "workspace:*", | ||
"@repo/cache": "workspace:*", | ||
"@repo/db": "workspace:*", | ||
"@repo/mail": "workspace:*", | ||
"@repo/types": "workspace:*", | ||
"@repo/cache": "workspace:*", | ||
"hono": "^4.6.9", | ||
"next": "15.0.2", | ||
"next": "15.0.3", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Next.js version inconsistency detected in root package.json The root
🔗 Analysis chainVerify Next.js update compatibility The Next.js update from 15.0.2 to 15.0.3 is part of a coordinated update across multiple applications. Let's verify the version consistency across the monorepo: 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Check Next.js versions across all package.json files
fd package.json | xargs rg '"next":' -A 1
Length of output: 519 |
||
"prisma": "^5.22.0", | ||
"react": "19.0.0-rc-02c0e824-20241028", | ||
"react-dom": "19.0.0-rc-02c0e824-20241028", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,8 @@ | |
"lint:fix": "next lint --fix", | ||
"typecheck": "tsc --noEmit", | ||
"format:write": "prettier --write \"**/*.{ts,tsx,mdx}\" --cache", | ||
"format:check": "prettier --check \"**/*.{ts,tsx,mdx}\" --cache" | ||
"format:check": "prettier --check \"**/*.{ts,tsx,mdx}\" --cache", | ||
"react-scan": "pnpm dlx react-scan@latest http://localhost:3002" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Consider pinning the react-scan version for stability Using - "react-scan": "pnpm dlx react-scan@latest http://localhost:3002"
+ "react-scan": "pnpm dlx react-scan@1.0.0 http://localhost:3002"
|
||
}, | ||
"dependencies": { | ||
"@better-fetch/fetch": "^1.1.12", | ||
|
@@ -43,7 +44,7 @@ | |
"geist": "^1.3.1", | ||
"input-otp": "^1.4.1", | ||
"lucide-react": "^0.454.0", | ||
"next": "15.0.2", | ||
"next": "15.0.3", | ||
"next-themes": "^0.4.3", | ||
"react": "19.0.0-rc-02c0e824-20241028", | ||
"react-beautiful-dnd": "^13.1.1", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,83 @@ | ||
import { SectionHeader, SectionHeaderDescription, SectionHeaderHeading } from "@/components/custom/text-wrappers"; | ||
import { | ||
SectionHeader, | ||
SectionHeaderDescription, | ||
SectionHeaderHeading, | ||
} from "@/components/custom/text-wrappers"; | ||
import { | ||
Card, | ||
CardContent, | ||
CardFooter, | ||
CardHeader, | ||
CardTitle, | ||
} from "@/components/ui/card" | ||
} from "@/components/ui/card"; | ||
|
||
import React from "react"; | ||
|
||
export default function Contact() { | ||
return ( | ||
<section className="flex flex-col h-full w-full"> | ||
<section className="flex flex-col h-full w-full"> | ||
<div className="absolute inset-0 mx-auto h-full w-full bg-[radial-gradient(circle,rgba(211,211,211,0.1),rgba(18,20,22,0.05),rgba(18,20,22,0))] opacity-60" /> | ||
<div className="px-8 md:px-12"> | ||
<div className="flex md:flex-row"> | ||
<SectionHeader className="flex flex-col max-w-2xl"> | ||
<SectionHeaderHeading> | ||
Contact support | ||
</SectionHeaderHeading> | ||
<SectionHeaderDescription> | ||
We are here to help. Ask product questions, report problems, or leave feedback. | ||
</SectionHeaderDescription> | ||
</SectionHeader> | ||
|
||
<Card className="w-3/6 m-10"> | ||
Ok beb | ||
</Card> | ||
|
||
</div> | ||
<section className="w-full border-t-2 border-dashed py-20"> | ||
<div className="grid grid-cols-1 md:grid-cols-3 px-8 md:px-20"> | ||
|
||
<Card className="border-none"> | ||
<CardHeader> | ||
<CardTitle className="text-xl">Join the community</CardTitle> | ||
</CardHeader> | ||
<CardContent className="text-sm text-muted-foreground"> | ||
<p>More than 10,000 Linear users share questions and best practices in our Slack community.</p> | ||
</CardContent> | ||
<CardFooter> | ||
<p>Card Footer</p> | ||
</CardFooter> | ||
</Card> | ||
<div className="px-8 md:px-12"> | ||
<div className="flex md:flex-row"> | ||
<SectionHeader className="flex flex-col max-w-2xl"> | ||
<SectionHeaderHeading>Contact support</SectionHeaderHeading> | ||
<SectionHeaderDescription> | ||
We are here to help. Ask product questions, report problems, or | ||
leave feedback. | ||
</SectionHeaderDescription> | ||
</SectionHeader> | ||
|
||
<Card className="border-none"> | ||
<CardHeader> | ||
<CardTitle className="text-xl">Join the community</CardTitle> | ||
</CardHeader> | ||
<CardContent className="text-sm text-muted-foreground"> | ||
<p>More than 10,000 Linear users share questions and best practices in our Slack community.</p> | ||
</CardContent> | ||
<CardFooter> | ||
<p>Card Footer</p> | ||
</CardFooter> | ||
</Card> | ||
<Card className="w-3/6 m-10">Ok beb</Card> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replace placeholder card content The card contains placeholder text "Ok beb" which should be replaced with meaningful content appropriate for a contact page. Consider adding a contact form or relevant contact information. Example structure: -<Card className="w-3/6 m-10">Ok beb</Card>
+<Card className="w-3/6 m-10">
+ <CardHeader>
+ <CardTitle>Get in Touch</CardTitle>
+ </CardHeader>
+ <CardContent>
+ {/* Add contact form or contact information here */}
+ </CardContent>
+</Card>
|
||
</div> | ||
<section className="w-full border-t-2 border-dashed py-20"> | ||
<div className="grid grid-cols-1 md:grid-cols-3 px-8 md:px-20"> | ||
<Card className="border-none"> | ||
<CardHeader> | ||
<CardTitle className="text-xl">Join the community</CardTitle> | ||
</CardHeader> | ||
<CardContent className="text-sm text-muted-foreground"> | ||
<p> | ||
More than 10,000 Linear users share questions and best | ||
practices in our Slack community. | ||
Comment on lines
+40
to
+41
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update card content to match your product The cards reference "Linear users", which appears to be copied content from another product. Update the content to be relevant to your product and users. Also applies to: 55-56, 70-71 |
||
</p> | ||
</CardContent> | ||
<CardFooter> | ||
<p>Card Footer</p> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replace footer placeholder text All cards contain placeholder text "Card Footer". Replace with meaningful content such as action buttons, links, or relevant information. Also applies to: 60-60, 75-75 |
||
</CardFooter> | ||
</Card> | ||
|
||
<Card className="border-none"> | ||
<CardHeader> | ||
<CardTitle className="text-xl">Join the community</CardTitle> | ||
</CardHeader> | ||
<CardContent className="text-sm text-muted-foreground"> | ||
<p>More than 10,000 Linear users share questions and best practices in our Slack community.</p> | ||
</CardContent> | ||
<CardFooter> | ||
<p>Card Footer</p> | ||
</CardFooter> | ||
</Card> | ||
<Card className="border-none"> | ||
<CardHeader> | ||
<CardTitle className="text-xl">Join the community</CardTitle> | ||
</CardHeader> | ||
<CardContent className="text-sm text-muted-foreground"> | ||
<p> | ||
More than 10,000 Linear users share questions and best | ||
practices in our Slack community. | ||
</p> | ||
</CardContent> | ||
<CardFooter> | ||
<p>Card Footer</p> | ||
</CardFooter> | ||
</Card> | ||
|
||
<Card className="border-none"> | ||
<CardHeader> | ||
<CardTitle className="text-xl">Join the community</CardTitle> | ||
</CardHeader> | ||
<CardContent className="text-sm text-muted-foreground"> | ||
<p> | ||
More than 10,000 Linear users share questions and best | ||
practices in our Slack community. | ||
</p> | ||
</CardContent> | ||
<CardFooter> | ||
<p>Card Footer</p> | ||
</CardFooter> | ||
</Card> | ||
</div> | ||
Comment on lines
+33
to
+78
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Refactor duplicate card components The three cards are identical in structure and content, which violates the DRY principle. Consider creating a reusable component and mapping over an array of data. Here's a suggested refactor: type ContactCardProps = {
title: string;
description: string;
footer: string;
};
const ContactCard = ({ title, description, footer }: ContactCardProps) => (
<Card className="border-none">
<CardHeader>
<CardTitle className="text-xl">{title}</CardTitle>
</CardHeader>
<CardContent className="text-sm text-muted-foreground">
<p>{description}</p>
</CardContent>
<CardFooter>
<p>{footer}</p>
</CardFooter>
</Card>
);
// Usage:
const cardData = [
{
title: "Join the community",
description: "More than 10,000 Linear users share questions and best practices in our Slack community.",
footer: "Card Footer"
},
// ... add data for other cards
];
<div className="grid grid-cols-1 md:grid-cols-3 px-8 md:px-20">
{cardData.map((data, index) => (
<ContactCard key={index} {...data} />
))}
</div> |
||
</section> | ||
</div> | ||
</section> | ||
</div> | ||
</section> | ||
); | ||
); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
import React from 'react' | ||
import React from "react"; | ||
|
||
export default function Features() { | ||
return ( | ||
<div> | ||
Fuck | ||
</div> | ||
) | ||
return <div>Fuck</div>; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,3 @@ import React from "react"; | |
export default function Integrations() { | ||
return <div>integrations</div>; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
import React from 'react' | ||
import React from "react"; | ||
|
||
export default function Methods() { | ||
return ( | ||
<div> | ||
Fuck | ||
</div> | ||
) | ||
return <div>Fuck</div>; | ||
} |
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.
Enhance security by using environment variable for branch reference
The direct use of
github.head_ref
in scripts can be a security risk. It's recommended to pass it through an environment variable.Apply this diff to improve security:
Also, add input sanitization: