Skip to content

Commit

Permalink
still biome
Browse files Browse the repository at this point in the history
  • Loading branch information
RiskyMH committed Nov 22, 2024
1 parent ad4c9e2 commit 24c8756
Show file tree
Hide file tree
Showing 25 changed files with 125 additions and 152 deletions.
14 changes: 6 additions & 8 deletions app/(auth)/login/reset/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ import Link from "next/link";
import { notFound } from "next/navigation";
import { UserAuthForm } from "./form.client";

export const dynamic = 'force-static'
export const dynamic = "force-static";

export default async function LoginPage(
props: {
searchParams: Promise<{
token: string;
}>;
}
) {
export default async function LoginPage(props: {
searchParams: Promise<{
token: string;
}>;
}) {
const searchParams = await props.searchParams;
if (!searchParams.token) return notFound();

Expand Down
2 changes: 1 addition & 1 deletion app/(auth)/register/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { UserAuthForm } from "./form.client";

// todo: maybe re-enable edge
// export const runtime = "edge";
export const dynamic = 'force-static'
export const dynamic = "force-static";

export default async function LoginPage() {
return (
Expand Down
20 changes: 9 additions & 11 deletions app/(email)/mail/[mailbox]/(email-list)/drafts/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@ export const metadata = {
title: "Drafts",
} as Metadata;

export default async function Mailbox(
props: {
params: Promise<{
mailbox: string;
}>;
searchParams: Promise<{
take?: string;
q?: string;
}>;
}
) {
export default async function Mailbox(props: {
params: Promise<{
mailbox: string;
}>;
searchParams: Promise<{
take?: string;
q?: string;
}>;
}) {
const searchParams = await props.searchParams;
const params = await props.params;
await pageMailboxAccess(params.mailbox);
Expand Down
2 changes: 1 addition & 1 deletion app/(email)/mail/[mailbox]/(email-list)/email-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import { formatTimeAgo } from "@/utils/tools";
import { cn } from "@/utils/tw";
import { eq } from "drizzle-orm";
import Link from "next/link";
import type { JSX } from "react";
import { RefreshButton } from "../components.client";
import { mailboxCategories, userMailboxAccess } from "../tools";
import { EmailItem } from "./email-item";
import { CreateTempEmailForm } from "./temp/modal";
import { getDraftEmailList, getDraftJustEmailsList, getEmailList, getJustEmailsList, getTempAliases } from "./tools";
import type { JSX } from "react";

interface EmailListProps {
mailboxId: string;
Expand Down
22 changes: 10 additions & 12 deletions app/(email)/mail/[mailbox]/(email-list)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@ export const metadata = {
title: "Inbox",
} as Metadata;

export default async function Mailbox(
props: {
params: Promise<{
mailbox: string;
}>;
searchParams?: Promise<{
category?: string;
take?: string;
q?: string;
}>;
}
) {
export default async function Mailbox(props: {
params: Promise<{
mailbox: string;
}>;
searchParams?: Promise<{
category?: string;
take?: string;
q?: string;
}>;
}) {
const searchParams = await props.searchParams;
const params = await props.params;
return (
Expand Down
22 changes: 10 additions & 12 deletions app/(email)/mail/[mailbox]/(email-list)/sent/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,16 @@ export const metadata = {
title: "Sent",
} as Metadata;

export default async function Mailbox(
props: {
params: Promise<{
mailbox: string;
}>;
searchParams?: Promise<{
category?: string;
take?: string;
q?: string;
}>;
}
) {
export default async function Mailbox(props: {
params: Promise<{
mailbox: string;
}>;
searchParams?: Promise<{
category?: string;
take?: string;
q?: string;
}>;
}) {
const searchParams = await props.searchParams;
const params = await props.params;
await pageMailboxAccess(params.mailbox);
Expand Down
22 changes: 10 additions & 12 deletions app/(email)/mail/[mailbox]/(email-list)/starred/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,16 @@ export const metadata = {
title: "Starred",
} as Metadata;

export default async function Mailbox(
props: {
params: Promise<{
mailbox: string;
}>;
searchParams?: Promise<{
category?: string;
take?: string;
q?: string;
}>;
}
) {
export default async function Mailbox(props: {
params: Promise<{
mailbox: string;
}>;
searchParams?: Promise<{
category?: string;
take?: string;
q?: string;
}>;
}) {
const searchParams = await props.searchParams;
const params = await props.params;
await pageMailboxAccess(params.mailbox);
Expand Down
22 changes: 10 additions & 12 deletions app/(email)/mail/[mailbox]/(email-list)/temp/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,16 @@ export const metadata = {
title: "Temporary Email",
} as Metadata;

export default async function Mailbox(
props: {
params: Promise<{
mailbox: string;
}>;
searchParams?: Promise<{
category?: string;
take?: string;
q?: string;
}>;
}
) {
export default async function Mailbox(props: {
params: Promise<{
mailbox: string;
}>;
searchParams?: Promise<{
category?: string;
take?: string;
q?: string;
}>;
}) {
const searchParams = await props.searchParams;
const params = await props.params;
await pageMailboxAccess(params.mailbox);
Expand Down
22 changes: 10 additions & 12 deletions app/(email)/mail/[mailbox]/(email-list)/trash/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,16 @@ export const metadata = {
title: "Trash",
} as Metadata;

export default async function Mailbox(
props: {
params: Promise<{
mailbox: string;
}>;
searchParams?: Promise<{
category?: string;
take?: string;
q?: string;
}>;
}
) {
export default async function Mailbox(props: {
params: Promise<{
mailbox: string;
}>;
searchParams?: Promise<{
category?: string;
take?: string;
q?: string;
}>;
}) {
const searchParams = await props.searchParams;
const params = await props.params;
await pageMailboxAccess(params.mailbox);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export async function GET(
email: string;
attachment: string;
}>;
}
},
) {
const params = await props.params;
const userId = await getCurrentUser();
Expand Down
2 changes: 1 addition & 1 deletion app/(email)/mail/[mailbox]/[email]/email.eml/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export async function GET(
mailbox: string;
email: string;
}>;
}
},
) {
const params = await props.params;
const userId = await getCurrentUser();
Expand Down
2 changes: 1 addition & 1 deletion app/(email)/mail/[mailbox]/[email]/email.html/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export async function GET(
mailbox: string;
email: string;
}>;
}
},
) {
const params = await props.params;
const userId = await getCurrentUser();
Expand Down
2 changes: 1 addition & 1 deletion app/(email)/mail/[mailbox]/[email]/email.txt/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export async function GET(
mailbox: string;
email: string;
}>;
}
},
) {
const params = await props.params;
const userId = await getCurrentUser();
Expand Down
20 changes: 9 additions & 11 deletions app/(email)/mail/[mailbox]/[email]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,15 @@ export async function generateMetadata(props: {
};
}

export default async function EmailPage(
props: {
params: Promise<{
mailbox: string;
email: string;
}>;
searchParams: Promise<{
view?: "text" | "markdown" | "html";
}>;
}
) {
export default async function EmailPage(props: {
params: Promise<{
mailbox: string;
email: string;
}>;
searchParams: Promise<{
view?: "text" | "markdown" | "html";
}>;
}) {
const searchParams = await props.searchParams;
const params = await props.params;
await pageMailboxAccess(params.mailbox, false);
Expand Down
2 changes: 1 addition & 1 deletion app/(email)/mail/[mailbox]/[email]/parse-html.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function isElement(node: Node): node is Element {
}

DOMPurify.addHook("afterSanitizeAttributes", (node) => {
if (!isElement(node)) return
if (!isElement(node)) return;

// set all elements owning target to target=_blank
if ("target" in node) {
Expand Down
14 changes: 6 additions & 8 deletions app/(email)/mail/[mailbox]/config/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,12 @@ export const metadata: Metadata = {
title: "Config",
};

export default async function EmailConfig(
props: {
params: Promise<{
mailbox: string;
email: string;
}>;
}
) {
export default async function EmailConfig(props: {
params: Promise<{
mailbox: string;
email: string;
}>;
}) {
const params = await props.params;
const userId = await pageMailboxAccess(params.mailbox);
if (!userId) return notFound();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export async function GET(
mailbox: string;
draft: string;
}>;
}
},
) {
const params = await props.params;
const userId = await getCurrentUser();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export async function GET(
mailbox: string;
draft: string;
}>;
}
},
) {
const params = await props.params;
const userId = await getCurrentUser();
Expand Down
14 changes: 6 additions & 8 deletions app/(email)/mail/[mailbox]/draft/[draft]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,12 @@ const fetchDraft = cache(async (mailboxId: string, draftId: string) => {
});
});

export default async function DraftPage(
props: {
params: Promise<{
mailbox: string;
draft: string;
}>;
}
) {
export default async function DraftPage(props: {
params: Promise<{
mailbox: string;
draft: string;
}>;
}) {
const params = await props.params;
await pageMailboxAccess(params.mailbox);

Expand Down
22 changes: 10 additions & 12 deletions app/(email)/mail/[mailbox]/draft/new/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,16 @@ import { parseHTML } from "../../[email]/parse-html";
import { mailboxAliases, pageMailboxAccess } from "../../tools";
import type { Recipient } from "../[draft]/tools";

export default async function Page(
props: {
params: Promise<{
mailbox: string;
}>;
searchParams: Promise<{
reply?: string;
replyAll?: string;
forward?: string;
}>;
}
) {
export default async function Page(props: {
params: Promise<{
mailbox: string;
}>;
searchParams: Promise<{
reply?: string;
replyAll?: string;
forward?: string;
}>;
}) {
const searchParams = await props.searchParams;
const params = await props.params;
// make new draft
Expand Down
Loading

0 comments on commit 24c8756

Please sign in to comment.