Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/unkeyed/unkey
Browse files Browse the repository at this point in the history
  • Loading branch information
chronark committed Dec 10, 2024
2 parents 84a93d5 + ab96ba8 commit b395e0f
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export const CreateKey = ({ apiId, keyAuthId, defaultBytes, defaultPrefix }: Pro
form.resetField("limit", undefined);
};

// biome-ignore lint: only run once
// biome-ignore lint/correctness/useExhaustiveDependencies: reset is only required on mount
useEffect(() => {
// React hook form + zod doesn't play nice with nested objects, so we need to reset them on load.
resetRateLimit();
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/app/(app)/settings/root-keys/new/client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const Client: React.FC<Props> = ({ apis }) => {
}));
};

// biome-ignore lint: should only run once
// biome-ignore lint/correctness/useExhaustiveDependencies: effect must be called once to set initial cards state
useEffect(() => {
const initialSelectedApiSet = new Set<string>();
selectedPermissions.forEach((permission) => {
Expand Down
5 changes: 3 additions & 2 deletions apps/dashboard/app/auth/sign-in/email-signin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ export function EmailSignIn(props: {
const router = useRouter();
const [lastUsed, setLastUsed] = useLastUsed();

// biome-ignore lint: this works
// biome-ignore lint/correctness/useExhaustiveDependencies: effect must be called once if sign-in is loaded
React.useEffect(() => {
const signUpOrgUser = async () => {
const ticket = new URL(window.location.href).searchParams.get(param);
if (!signInLoaded) {
return;
}

const ticket = new URL(window.location.href).searchParams.get(param);
if (!ticket) {
return;
}
Expand Down
8 changes: 7 additions & 1 deletion apps/dashboard/app/auth/sign-up/email-signup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@ export const EmailSignUp: React.FC<Props> = ({ setError, setVerification }) => {
const [isLoading, setIsLoading] = React.useState(false);
const [_transferLoading, setTransferLoading] = React.useState(true);
const router = useRouter();
// biome-ignore lint: works fine as is

// biome-ignore lint/correctness/useExhaustiveDependencies: effect must be called once if sign-up is loaded
React.useEffect(() => {
const signUpFromParams = async () => {
if (!signUpLoaded) {
return;
}

const ticket = new URL(window.location.href).searchParams.get("__clerk_ticket");
const emailParam = new URL(window.location.href).searchParams.get("email");
if (!ticket && !emailParam) {
Expand Down Expand Up @@ -69,6 +74,7 @@ export const EmailSignUp: React.FC<Props> = ({ setError, setVerification }) => {
});
}
};

signUpFromParams();
setTransferLoading(false);
}, [signUpLoaded]);
Expand Down
5 changes: 3 additions & 2 deletions apps/dashboard/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { TooltipProvider } from "@/components/ui/tooltip";
import { PHProvider, PostHogPageview } from "@/providers/PostHogProvider";
import "@/styles/tailwind/tailwind.css";
import { ClerkProvider } from "@clerk/nextjs";
import "@unkey/ui/css";
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import localFont from "next/font/local";
Expand All @@ -29,8 +30,8 @@ export const metadata = {
openGraph: {
title: "Open Source API Authentication",
description: "Build better APIs faster ",
url: "https://unkey.dev",
siteName: "unkey.dev",
url: "https://app.unkey.com",
siteName: "app.unkey.com",
images: ["https://www.unkey.com/og.png"],
},
twitter: {
Expand Down
2 changes: 2 additions & 0 deletions apps/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@
"@unkey/error": "workspace:^",
"@unkey/events": "workspace:^",
"@unkey/hash": "workspace:^",
"@unkey/icons": "workspace:^",
"@unkey/id": "workspace:^",
"@unkey/keys": "workspace:^",
"@unkey/ratelimit": "workspace:^",
"@unkey/rbac": "workspace:^",
"@unkey/resend": "workspace:^",
"@unkey/schema": "workspace:^",
"@unkey/ui": "workspace:^",
"@unkey/validation": "workspace:^",
"@unkey/vault": "workspace:^",
"@unkey/vercel": "workspace:^",
Expand Down
25 changes: 23 additions & 2 deletions apps/dashboard/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/** @type {import('tailwindcss').Config} */
const defaultTheme = require("tailwindcss/defaultTheme");
import unkeyUiTailwindConfig from "@unkey/ui/tailwind.config";

const _plugin = require("tailwindcss/plugin");

module.exports = {
Expand All @@ -9,8 +11,10 @@ module.exports = {
"./components/**/*.{ts,tsx}",
"./app/**/*.{ts,tsx}",
"./src/**/*.{ts,tsx}",
"../../internal/ui/src/**/*.tsx",
"../../internal/icons/src/**/*.tsx",
],
theme: {
theme: mergeObjects(unkeyUiTailwindConfig, {
fontSize: {
xxs: ["10px", "16px"],
xs: ["0.75rem", { lineHeight: "1rem" }],
Expand Down Expand Up @@ -134,11 +138,28 @@ module.exports = {
],
},
},
},
}),
plugins: [
require("tailwindcss-animate"),
require("@tailwindcss/typography"),
require("@tailwindcss/aspect-ratio"),
require("@tailwindcss/container-queries"),
],
};

function mergeObjects(obj1, obj2) {
for (const key in obj2) {
// biome-ignore lint/suspicious/noPrototypeBuiltins: don't tell me what to do
if (obj2.hasOwnProperty(key)) {
if (typeof obj2[key] === "object" && !Array.isArray(obj2[key])) {
if (!obj1[key]) {
obj1[key] = {};
}
obj1[key] = mergeObjects(obj1[key], obj2[key]);
} else {
obj1[key] = obj2[key];
}
}
}
return obj1;
}
5 changes: 5 additions & 0 deletions apps/www/components/footer/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ const navigation = [
title: "Glossary",
href: "/glossary",
},
{
title: "Status Page",
href: "https://status.unkey.com",
external: true,
},
],
},
{
Expand Down
2 changes: 1 addition & 1 deletion apps/www/components/shiny-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const ShinyCardGroup: React.FC<ShinyCardGroupProps> = ({
});
}
}
}, [mousePosition.x, mousePosition.y]);
}, [boxes, mousePosition.x, mousePosition.y]);

useEffect(() => {
onMouseMove();
Expand Down
6 changes: 6 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b395e0f

Please sign in to comment.