init
This commit is contained in:
14
apps/sample-website/src/app/globals.css
Normal file
14
apps/sample-website/src/app/globals.css
Normal file
@@ -0,0 +1,14 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
:root {
|
||||
--background: #ffffff;
|
||||
--foreground: #171717;
|
||||
}
|
||||
|
||||
body {
|
||||
color: var(--foreground);
|
||||
background: var(--background);
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
}
|
||||
19
apps/sample-website/src/app/layout.tsx
Normal file
19
apps/sample-website/src/app/layout.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import type { Metadata } from "next";
|
||||
import "./globals.css";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Sample Website",
|
||||
description: "A sample website using @mintel shared packages",
|
||||
};
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
return (
|
||||
<html lang="en">
|
||||
<body>{children}</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
36
apps/sample-website/src/app/page.tsx
Normal file
36
apps/sample-website/src/app/page.tsx
Normal file
@@ -0,0 +1,36 @@
|
||||
"use client";
|
||||
|
||||
import { isValidLang, rateLimit } from "@mintel/next-utils";
|
||||
|
||||
export default function Home() {
|
||||
const testLang = "en";
|
||||
const isLangValid = isValidLang(testLang);
|
||||
|
||||
const handleTestRateLimit = async () => {
|
||||
try {
|
||||
await rateLimit("test-user");
|
||||
console.log("Rate limit check passed");
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<main className="flex min-h-screen flex-col items-center justify-between p-24">
|
||||
<div className="z-10 max-w-5xl w-full items-center justify-between font-mono text-sm lg:flex">
|
||||
<h1 className="text-4xl font-bold">Sample Website</h1>
|
||||
<p className="mt-4">
|
||||
Testing @mintel/next-utils:
|
||||
<br />
|
||||
Is {'"'}en{'"'} valid? {isLangValid ? "Yes" : "No"}
|
||||
</p>
|
||||
<button
|
||||
onClick={handleTestRateLimit}
|
||||
className="mt-4 px-4 py-2 bg-blue-500 text-white rounded"
|
||||
>
|
||||
Test Rate Limit
|
||||
</button>
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user