-
Notifications
You must be signed in to change notification settings - Fork 0
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
teachmetw
committed
Sep 10, 2023
1 parent
60c3758
commit fd3d371
Showing
15 changed files
with
980 additions
and
445 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Environment variables declared in this file are automatically made available to Prisma. | ||
# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema | ||
|
||
# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB. | ||
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings | ||
|
||
DATABASE_URL="postgresql://johndoe:randompassword@localhost:5432/mydb?schema=public" |
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,76 @@ | ||
import React from 'react'; | ||
|
||
interface InputProps { | ||
id: string; | ||
onChange: any; | ||
value: string; | ||
label: string; | ||
type?: string; | ||
} | ||
|
||
|
||
|
||
const Input: React.FC<InputProps> = ({ | ||
id, | ||
onChange, | ||
value, | ||
label, | ||
type | ||
}) => { | ||
return ( | ||
<div className="relative"> | ||
<input | ||
value={value} | ||
type={type} | ||
onChange={onChange} | ||
id={id} | ||
className=" | ||
block | ||
rounded-md | ||
px-6 | ||
pt-6 | ||
pb-1 | ||
w-full | ||
text-md | ||
text-white | ||
bg-neutral-700 | ||
appearance-none | ||
focus:outline-none | ||
focus:ring-0 | ||
peer | ||
invalid:border-b-1 | ||
" | ||
placeholder=" " | ||
|
||
/> | ||
<label | ||
className=" | ||
absolute | ||
text-md | ||
text-zinc-400 | ||
duration-150 | ||
transform | ||
-translate-y-3 | ||
scale-75 | ||
top-4 | ||
z-10 | ||
origin-[0] | ||
left-6 | ||
peer-placeholder-shown:scale-100 | ||
peer-placeholder-shown:translate-y-0 | ||
peer-focus:scale-75 | ||
peer-focus:-translate-y-3 | ||
" | ||
htmlFor={id}> | ||
{label} | ||
|
||
</label> | ||
|
||
|
||
</div> | ||
|
||
) | ||
|
||
} | ||
|
||
export default Input; |
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,7 @@ | ||
import { PrismaClient } from '@prisma/client'; | ||
|
||
declare global { | ||
namespace globalThis { | ||
var prismadb: PrismaClient; | ||
} | ||
} |
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,6 @@ | ||
import { PrismaClient } from "@prisma/client"; | ||
|
||
const client = global.prismadb || new PrismaClient(); | ||
if (process.env.NODE_ENV === "production") global.prismadb = client; | ||
|
||
export default client; |
Oops, something went wrong.