Skip to content
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

feat: 更新ts声明 #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
29 changes: 29 additions & 0 deletions .github/workflows/auto_merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: automerge
on:
pull_request:
types:
- labeled
- unlabeled
- synchronize
- opened
- edited
- ready_for_review
- reopened
- unlocked
pull_request_review:
types:
- submitted
check_suite:
types:
- completed
status: {}
jobs:
automerge:
runs-on: ubuntu-latest
steps:
- id: automerge
name: automerge
uses: "pascalgn/automerge-action@v0.15.5"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
MERGE_LABELS: ""
17 changes: 12 additions & 5 deletions app/product/@content/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ import dayjs from "dayjs";
import Link from "next/link";
import React from "react";

const PlatformContent = async ({ searchParams }: Props) => {
const data = await request("/platform", { searchParams });
console.log(searchParams);
const Content = async ({ searchParams }: Props) => {
const data = await request("/platform", { searchParams, cache: "no-cache" });
return (
<div className="grid grid-cols-3 gap-6 ">
<div className="w-4/5 ml-auto mr-auto grid grid-cols-3 gap-6 ">
{Array.isArray(data) &&
data.map((item) => (
<Link href={item.url} target="_blank" key={item.id}>
<Card className="relative">
<Card className="relative h-[400px]">
<CardHeader>
<CardTitle>{item.name}</CardTitle>
<CardDescription className="flex justify-between">
Expand Down Expand Up @@ -51,4 +50,12 @@ const PlatformContent = async ({ searchParams }: Props) => {
);
};

const PlatformContent = (props: Props) => {
return (
<React.Suspense>
<Content {...props} />
</React.Suspense>
);
};

export default PlatformContent;
14 changes: 11 additions & 3 deletions app/product/components/SearchInput.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"use client";

import { Input } from "@/components/ui/input";
import { Search } from "lucide-react";
import { Search as SearchIcon } from "lucide-react";
import { useSearchParams } from "next/navigation";
import QueryString from "qs";
import React from "react";

const SearchInput = () => {
const Search = () => {
const searchParams = useSearchParams();
const keyword = searchParams.get("keyword");
const [value, setValue] = React.useState(keyword == null ? "" : keyword);
Expand All @@ -29,7 +29,7 @@ const SearchInput = () => {

return (
<div className="relative w-[400px] flex gap-x-4">
<Search className="absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" />
<SearchIcon className="absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" />
<Input
type="search"
placeholder="Please enter product name"
Expand All @@ -42,4 +42,12 @@ const SearchInput = () => {
);
};

const SearchInput = () => {
return (
<React.Suspense>
<Search />
</React.Suspense>
);
};

export default SearchInput;
12 changes: 7 additions & 5 deletions app/product/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ import { ModeToggle } from "@/components/ModeToggle";
import { Input } from "@/components/ui/input";
import { useForm } from "react-hook-form";
import SearchInput from "./components/SearchInput";
import { useParams, useSearchParams } from "next/navigation";

function Dashboard({ content }: { content: React.ReactElement }) {
function Dashboard(props: { content: React.ReactElement }) {
const { content } = props;
return (
<div className="flex min-h-screen w-full flex-col">
<header className="sticky top-0 flex h-16 items-center justify-between gap-4 border-b bg-background px-4 z-50">
Expand All @@ -19,21 +21,21 @@ function Dashboard({ content }: { content: React.ReactElement }) {
</Link>
<Link
href="/product?type=database"
className="text-primary transition-colors hover:text-primary"
className="transition-colors hover:text-primary"
>
Database
</Link>
<Link
href="/product?type=ui"
href="/product?type=design"
className="text-muted-primary transition-colors hover:text-primary"
>
UI
Design
</Link>
</nav>
<div className="flex w-full items-center gap-4 justify-end">
<SearchInput />
<ModeToggle />
<CircleUser className="h-6 w-6" />
{/* <CircleUser className="h-6 w-6" /> */}
</div>
</header>
<main className="flex flex-1 flex-col gap-4 p-4 md:gap-8 md:p-8">
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev --turbo",
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
Expand Down