-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
137 changed files
with
2,590 additions
and
559 deletions.
There are no files selected for viewing
This file contains 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 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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,6 +1,33 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
output: "standalone", | ||
webpack(config) { | ||
// Grab the existing rule that handles SVG imports | ||
const fileLoaderRule = config.module.rules.find((rule) => | ||
rule.test?.test?.(".svg") | ||
); | ||
|
||
config.module.rules.push( | ||
// Reapply the existing rule, but only for svg imports ending in ?url | ||
{ | ||
...fileLoaderRule, | ||
test: /\.svg$/i, | ||
resourceQuery: /url/, // *.svg?url | ||
}, | ||
// Convert all other *.svg imports to React components | ||
{ | ||
test: /\.svg$/i, | ||
issuer: fileLoaderRule.issuer, | ||
resourceQuery: { not: [...fileLoaderRule.resourceQuery.not, /url/] }, // exclude if *.svg?url | ||
use: ["@svgr/webpack"], | ||
} | ||
); | ||
|
||
// Modify the file loader rule to ignore *.svg, since we have it handled now. | ||
fileLoaderRule.exclude = /\.svg$/i; | ||
|
||
return config; | ||
}, | ||
}; | ||
|
||
export default nextConfig; |
This file contains 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
26 changes: 26 additions & 0 deletions
26
apps/notes/prisma/migrations/20240722011911_072/migration.sql
This file contains 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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
-- CreateTable | ||
CREATE TABLE "User" ( | ||
"id" TEXT NOT NULL, | ||
"clerkId" TEXT NOT NULL, | ||
|
||
CONSTRAINT "User_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Note" ( | ||
"id" TEXT NOT NULL, | ||
"title" VARCHAR(255) NOT NULL, | ||
"content" TEXT, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3) NOT NULL, | ||
"authorId" TEXT NOT NULL, | ||
"color" TEXT NOT NULL, | ||
|
||
CONSTRAINT "Note_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "User_clerkId_key" ON "User"("clerkId"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Note" ADD CONSTRAINT "Note_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; |
This file contains 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Please do not edit this file manually | ||
# It should be added in your version-control system (i.e. Git) | ||
provider = "postgresql" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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 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 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 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 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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { NoteCardsRSC } from "@libs/components/card/rsc"; | ||
import { ImageNotFound } from "@libs/components/image/not-found"; | ||
import { InputSearch } from "@libs/components/input/search"; | ||
import { HeaderLayout } from "@libs/components/layout/header"; | ||
import { prisma } from "@libs/prisma/client"; | ||
import { Back } from "@libs/router/back"; | ||
import { IPageProps } from "@npc/shared/react-helpers"; | ||
import React from "react"; | ||
|
||
const SearchPage: React.FC<IPageProps<{}, { q: string }>> = async (props) => { | ||
const q = props.searchParams.q; | ||
const notes = q | ||
? await prisma.note.findMany({ | ||
where: { | ||
title: { | ||
contains: props.searchParams.q, | ||
mode: "insensitive", | ||
}, | ||
}, | ||
}) | ||
: []; | ||
|
||
return ( | ||
<div className="flex size-full flex-col"> | ||
<HeaderLayout | ||
left={<Back />} | ||
right={<InputSearch className="w-full" searchParamKey="q" />} | ||
rightClassName="flex-1 overflow-hidden" | ||
/> | ||
|
||
<NoteCardsRSC notes={notes} /> | ||
|
||
{notes.length === 0 && q && ( | ||
<div | ||
className="mt-[-10px] flex flex-1 flex-col justify-center" | ||
hidden={notes.length > 0} | ||
> | ||
<ImageNotFound className="mx-auto" height={286} width={350} /> | ||
<div className="text-center text-lg"> | ||
File not found. Try searching again. | ||
</div> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default SearchPage; |
Oops, something went wrong.