diff --git a/quartz/components/ReplyByEmail.tsx b/quartz/components/ReplyByEmail.tsx index 91054faec..37a6baa6c 100644 --- a/quartz/components/ReplyByEmail.tsx +++ b/quartz/components/ReplyByEmail.tsx @@ -2,17 +2,13 @@ import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } fro import { classNames } from "../util/lang" interface ReplyByEmailOptions { - username?: string - domain?: string + email: string includeTitles?: string[] excludeTitles?: string[] buttonLabel?: string } -// Default options will be used if not provided in the layout file -const defaultOptions: ReplyByEmailOptions = { - username: "Y29udGFjdA==", // "contact" encoded in base64, as in contact@example.com - domain: "ZXhhbXBsZS5jb20=", // "example.com" encoded in base64, as in contact@example.com +const defaultOptions: Partial = { includeTitles: [], excludeTitles: [], buttonLabel: "Reply by email" @@ -21,17 +17,15 @@ const defaultOptions: ReplyByEmailOptions = { const ReplyByEmail: QuartzComponent = ({ fileData, displayClass, - username, - domain, + email, includeTitles, excludeTitles, buttonLabel }: QuartzComponentProps & ReplyByEmailOptions) => { const title = fileData.frontmatter?.title - // Use provided values or defaults - const encodedPart1 = username || defaultOptions.username - const encodedPart2 = domain || defaultOptions.domain + const encodedEmail = btoa(email) + const includeList = includeTitles || defaultOptions.includeTitles const excludeList = excludeTitles || defaultOptions.excludeTitles const label = buttonLabel || defaultOptions.buttonLabel @@ -47,15 +41,22 @@ const ReplyByEmail: QuartzComponent = ({ if (shouldDisplay) { return (
-