-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
1 parent
c765310
commit b906840
Showing
7 changed files
with
250 additions
and
64 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 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,91 @@ | ||
import Modal from "./Modal"; | ||
import cn from "../lib/classNames"; | ||
import { Button } from "@prisma/lens"; | ||
import { useState } from "react"; | ||
|
||
type PricingModalProps = { | ||
onClose: (price?: number) => void; | ||
open: boolean; | ||
}; | ||
|
||
const PRICES = [5, 10, 15]; | ||
|
||
const PricingModal = ({ onClose, open }: PricingModalProps) => { | ||
const [price, setPrice] = useState<number>(); | ||
|
||
return ( | ||
<Modal | ||
open={open} | ||
onClose={() => { | ||
onClose(price); | ||
}} | ||
> | ||
<div className="flex flex-col gap-4 antialiased"> | ||
<div className="flex flex-col items-center text-center rounded-lg bg-gradient-to-br from-gray-50 to-gray-100 pt-10 px-10 pb-5 shadow-inner"> | ||
<div className="flex flex-col items-center gap-3.5"> | ||
<h1 className="text-3xl font-semibold text-transparent bg-clip-text bg-gradient-to-r from-black to-yellow-700"> | ||
Prismabuilder<span className="text-yellow-500">++</span> | ||
</h1> | ||
|
||
<i>An extended version of Prisma Schema Builder is in the works</i> | ||
</div> | ||
|
||
<hr className="mt-8 max-w-sm border-gray-300 w-full" /> | ||
|
||
<ul className="flex flex-col gap-3.5 text-xl text-left mt-9"> | ||
<li>💾 Save your schemas in the cloud</li> | ||
<li>🖥️ Access to a desktop version of the app</li> | ||
<li>📣 Priority on GitHub issues and features</li> | ||
<li>🌚 Exclusive dark mode color theme</li> | ||
</ul> | ||
|
||
<hr className="mt-8 max-w-sm border-gray-300 w-full" /> | ||
|
||
<p | ||
className="mt-9 text-xl leading-tight font-semibold" | ||
style={{ lineHeight: 1.6 }} | ||
> | ||
How much would you be willing to pay for Prismabuilder++ on a | ||
monthly basis? | ||
</p> | ||
|
||
<div className="flex gap-3.5 mt-8"> | ||
{PRICES.map((PRICE) => ( | ||
<button | ||
key={PRICE} | ||
type="button" | ||
className={cn( | ||
"rounded-lg border p-5 flex flex-col items-center transition", | ||
PRICE === price | ||
? "border-indigo-500 bg-indigo-500 text-white" | ||
: "border-gray-500 hover:bg-gray-200 hover:border-gray-600" | ||
)} | ||
onClick={() => { | ||
setPrice(PRICE === price ? undefined : PRICE); | ||
}} | ||
> | ||
<p className="text-3xl font-medium tracking-wide"> | ||
${PRICE} <span className="text-xs font-medium">/month</span> | ||
</p> | ||
</button> | ||
))} | ||
</div> | ||
|
||
<div className="flex w-full mt-10"> | ||
<Button | ||
fillParent | ||
variant="secondary" | ||
onClick={() => { | ||
onClose(price); | ||
}} | ||
> | ||
Close | ||
</Button> | ||
</div> | ||
</div> | ||
</div> | ||
</Modal> | ||
); | ||
}; | ||
|
||
export default PricingModal; |
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,4 @@ | ||
const cn = (...classes: Array<string | false | undefined>) => | ||
classes.filter(Boolean).join(" "); | ||
|
||
export default cn; |
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,29 @@ | ||
import axios, { AxiosError } from "axios"; | ||
import { NextApiRequest, NextApiResponse } from "next"; | ||
|
||
export default async function handler( | ||
req: NextApiRequest, | ||
res: NextApiResponse | ||
) { | ||
try { | ||
const response = await axios.post( | ||
"https://api.logsnag.com/v1/log", | ||
{ | ||
project: "prisma-schema-builder", | ||
channel: req.body.channel, | ||
event: req.body.event, | ||
icon: req.body.icon, | ||
}, | ||
{ | ||
headers: { | ||
Authorization: `Bearer ${process.env.LOGSNAG_API_TOKEN}`, | ||
}, | ||
} | ||
); | ||
|
||
res.send(response?.data); | ||
} catch (e) { | ||
console.log((e as AxiosError).response?.data.validation); | ||
res.status(500).send("Failed to send log"); | ||
} | ||
} |
b906840
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.
Successfully deployed to the following URLs:
prismabuilder-io – ./
prismabuilder-io-albingroen1.vercel.app
www.prismabuilder.io
prismabuilder-io.vercel.app
prismabuilder.io
prismabuilder-io-git-main-albingroen1.vercel.app