Skip to content

⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.

feat(web): improved authentication UI

daniel31x132a3e54221bff
diff --git a/apps/web/components/CenteredForm.tsx b/apps/web/components/CenteredForm.tsx
index 3c45b7b0..1e4df932 100644
--- a/apps/web/components/CenteredForm.tsx
+++ b/apps/web/components/CenteredForm.tsx
@@ -1,64 +1,49 @@
+import { cn } from "@/lib/utils";
import Image from "next/image";
-import Link from "next/link";
import React, { ReactNode } from "react";
-import { Trans } from "next-i18next";
-import { useUser } from "@linkwarden/router/user";
interface Props {
+ header?: string;
text?: string;
+ className?: string;
children: ReactNode;
"data-testid"?: string;
}
export default function CenteredForm({
+ header,
text,
children,
+ className,
"data-testid": dataTestId,
}: Props) {
- const { data: user } = useUser();
-
return (
<div
- className="absolute top-0 bottom-0 left-0 right-0 flex justify-center items-center p-5"
+ className={cn(
+ "flex min-h-screen justify-center items-center p-5",
+ className
+ )}
data-testid={dataTestId}
>
- <div className="m-auto flex flex-col gap-2 w-full">
- {user?.theme === "light" ? (
- <Image
- src={"/linkwarden_light.png"}
- width={640}
- height={136}
- alt="Linkwarden"
- className="h-12 w-auto mx-auto"
- />
- ) : (
- <Image
- src={"/linkwarden_dark.png"}
- width={640}
- height={136}
- alt="Linkwarden"
- className="h-12 w-auto mx-auto"
- />
+ <div className="m-auto flex flex-col gap-3 w-full">
+ <Image
+ src={"/icon-small-150x150.png"}
+ width={150}
+ height={150}
+ alt="Linkwarden"
+ className="h-16 w-auto mx-auto"
+ />
+ {header && (
+ <p className="text-2xl text-black dark:text-white text-center font-semibold">
+ {header}
+ </p>
)}
{text && (
- <p className="text-lg max-w-[30rem] min-w-80 w-full mx-auto font-semibold px-2 text-center">
+ <p className="text-lg max-w-[30rem] min-w-80 w-full mx-auto px-2 font-light text-center">
{text}
</p>
)}
{children}
- <p className="text-center text-xs text-neutral mb-5">
- <Trans
- values={{ date: new Date().getFullYear() }}
- i18nKey="all_rights_reserved"
- components={[
- <Link
- href="https://linkwarden.app"
- className="font-semibold"
- key="linkwarden-website-key"
- />,
- ]}
- />
- </p>
</div>
</div>
);
diff --git a/apps/web/pages/auth/reset-password.tsx b/apps/web/pages/auth/reset-password.tsx
index 7b590ebc..baeb2a3d 100644
--- a/apps/web/pages/auth/reset-password.tsx
+++ b/apps/web/pages/auth/reset-password.tsx
@@ -7,7 +7,6 @@ import { FormEvent, useState } from "react";
import { toast } from "react-hot-toast";
import getServerSideProps from "@/lib/client/getServerSideProps";
import { useTranslation } from "next-i18next";
-import { Separator } from "@/components/ui/separator";
interface FormData {
password: string;
@@ -64,26 +63,19 @@ export default function ResetPassword() {
}
return (
- <CenteredForm>
+ <CenteredForm
+ header={requestSent ? t("password_updated") : t("reset_password")}
+ >
<form onSubmit={submit}>
- <div className="p-4 mx-auto flex flex-col gap-3 justify-between max-w-[30rem] min-w-80 w-full bg-base-200 rounded-xl shadow-md border border-neutral-content">
- <p className="text-3xl text-center font-extralight">
- {requestSent ? t("password_updated") : t("reset_password")}
- </p>
-
- <Separator />
-
+ <div className="mx-auto flex flex-col gap-3 justify-between max-w-[30rem] min-w-80 w-full">
{!requestSent ? (
<>
<p>{t("enter_email_for_new_password")}</p>
<div>
- <p className="text-sm w-fit font-semibold mb-1">
- {t("new_password")}
- </p>
<TextInput
autoFocus
type="password"
- placeholder="••••••••••••••"
+ placeholder={t("new_password")}
value={form.password}
className="bg-base-100"
onChange={(e) =>
@@ -94,7 +86,6 @@ export default function ResetPassword() {
<Button
type="submit"
variant="accent"
- className="mt-2"
size="full"
disabled={submitLoader}
>
diff --git a/apps/web/pages/confirmation.tsx b/apps/web/pages/confirmation.tsx
index 688786e4..942ac884 100644
--- a/apps/web/pages/confirmation.tsx
+++ b/apps/web/pages/confirmation.tsx
@@ -6,7 +6,6 @@ import toast from "react-hot-toast";
import { useTranslation } from "next-i18next";
import getServerSideProps from "@/lib/client/getServerSideProps";
import { Button } from "@/components/ui/button";
-import { Separator } from "@/components/ui/separator";
export default function EmailConfirmaion() {
const router = useRouter();
@@ -37,23 +36,17 @@ export default function EmailConfirmaion() {
};
return (
- <CenteredForm>
- <div className="p-4 max-w-[30rem] min-w-80 w-full rounded-xl shadow-md mx-auto border border-neutral-content bg-base-200">
- <p className="text-center text-xl sm:text-3xl font-extralight mb-2 ">
- {t("check_your_email")}
- </p>
-
- <Separator className="my-3" />
+ <CenteredForm header={t("check_your_email")}>
+ <div className="max-w-[30rem] min-w-80 w-full mx-auto flex flex-col gap-3">
+ <p>{t("verification_email_sent_desc")}</p>
{router.query.email && typeof router.query.email === "string" && (
- <p className="text-center font-bold mb-3 break-all">
+ <p className="text-center tracking-widest mb-3 break-all">
{decodeURIComponent(router.query.email)}
</p>
)}
- <p>{t("verification_email_sent_desc")}</p>
-
- <div className="mx-auto w-fit mt-3">
+ <div className="mx-auto w-fit">
<Button onClick={resend} variant="ghost" size="sm">
{t("resend_email")}
</Button>
diff --git a/apps/web/pages/forgot.tsx b/apps/web/pages/forgot.tsx
index 8be886f0..fbe2fa7f 100644
--- a/apps/web/pages/forgot.tsx
+++ b/apps/web/pages/forgot.tsx
@@ -6,7 +6,6 @@ import { FormEvent, useState } from "react";
import { toast } from "react-hot-toast";
import getServerSideProps from "@/lib/client/getServerSideProps";
import { useTranslation } from "next-i18next";
-import { Separator } from "@/components/ui/separator";
interface FormData {
email: string;
@@ -60,27 +59,20 @@ export default function Forgot() {
}
return (
- <CenteredForm>
+ <CenteredForm header={isEmailSent ? t("email_sent") : t("forgot_password")}>
<form onSubmit={sendConfirmation}>
- <div className="p-4 mx-auto flex flex-col gap-3 justify-between max-w-[30rem] min-w-80 w-full bg-base-200 rounded-xl shadow-md border border-neutral-content">
- <p className="text-3xl text-center font-extralight">
- {isEmailSent ? t("email_sent") : t("forgot_password")}
- </p>
-
- <Separator />
-
+ <div className="mx-auto flex flex-col gap-3 justify-between max-w-[30rem] min-w-80 w-full">
{!isEmailSent ? (
<>
<div>
<p>{t("password_email_prompt")}</p>
</div>
- <div>
- <p className="text-sm w-fit font-semibold mb-1">{t("email")}</p>
+ <div>
<TextInput
autoFocus
type="email"
- placeholder="[email protected]"
+ placeholder={t("email")}
value={form.email}
className="bg-base-100"
onChange={(e) => setForm({ ...form, email: e.target.value })}
@@ -90,7 +82,6 @@ export default function Forgot() {
<Button
type="submit"
variant="accent"
- className="mt-2"
size="full"
disabled={submitLoader}
>
@@ -101,7 +92,7 @@ export default function Forgot() {
<p>{t("reset_email_sent_desc")}</p>
)}
- <div className="mx-auto w-fit mt-2">
+ <div className="mx-auto w-fit">
<Link className="font-semibold" href="/login">
{t("back_to_login")}
</Link>
diff --git a/apps/web/pages/login.tsx b/apps/web/pages/login.tsx
index 27f02733..7b67af4b 100644
--- a/apps/web/pages/login.tsx
+++ b/apps/web/pages/login.tsx
@@ -7,7 +7,6 @@ import React, { useState, FormEvent } from "react";
import { toast } from "react-hot-toast";
import { getLogins } from "./api/v1/logins";
import { GetServerSideProps, InferGetServerSidePropsType } from "next";
-import InstallApp from "@/components/InstallApp";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
import { i18n } from "next-i18next.config";
import { getToken } from "next-auth/jwt";
@@ -78,7 +77,7 @@ export default function Login({
const load = toast.loading(t("authenticating"));
- const res = await signIn(method, {});
+ await signIn(method, {});
toast.dismiss(load);
@@ -89,12 +88,6 @@ export default function Login({
if (availableLogins.credentialsEnabled === "true") {
return (
<>
- <p className="text-3xl text-black dark:text-white text-center font-extralight">
- {t("enter_credentials")}
- </p>
-
- <Separator />
-
{process.env.NEXT_PUBLIC_DEMO === "true" &&
process.env.NEXT_PUBLIC_DEMO_USERNAME &&
process.env.NEXT_PUBLIC_DEMO_PASSWORD && (
@@ -156,16 +149,14 @@ export default function Login({
)}
<div>
- <p className="text-sm text-black dark:text-white w-fit font-semibold mb-1">
- {availableLogins.emailEnabled === "true"
- ? t("username_or_email")
- : t("username")}
- </p>
-
<TextInput
name="username"
autoFocus={true}
- placeholder="johnny"
+ placeholder={
+ availableLogins.emailEnabled === "true"
+ ? t("username_or_email")
+ : t("username")
+ }
value={form.username}
className="bg-base-100"
data-testid="username-input"
@@ -173,13 +164,9 @@ export default function Login({
/>
</div>
<div className="w-full">
- <p className="text-sm text-black dark:text-white w-fit font-semibold mb-1">
- {t("password")}
- </p>
-
<TextInput
type="password"
- placeholder="••••••••••••••"
+ placeholder={t("password")}
value={form.password}
className="bg-base-100"
data-testid="password-input"
@@ -210,7 +197,7 @@ export default function Login({
{availableLogins.buttonAuths.length > 0 && (
<div className="flex items-center gap-2">
<Separator className="my-1 flex-1 w-auto" />
- <p className="whitespace-nowrap">{t("or_continue_with")}</p>
+ <p className="whitespace-nowrap">{t("or")}</p>
<Separator className="my-1 flex-1 w-auto" />
</div>
)}
@@ -231,11 +218,19 @@ export default function Login({
variant="metal"
disabled={submitLoader}
>
- {value.name.toLowerCase() === "google" ||
- (value.name.toLowerCase() === "apple" && (
- <i className={"bi-" + value.name.toLowerCase()}></i>
- ))}
- {value.name}
+ {value.name.toLowerCase() === "google" ? (
+ <>
+ <i className={"bi-google"}></i>
+ {t("continue_with_google")}
+ </>
+ ) : value.name.toLowerCase() === "apple" ? (
+ <>
+ <i className={"bi-apple"}></i>
+ {t("continue_with_apple")}
+ </>
+ ) : (
+ value.name
+ )}
</Button>
</React.Fragment>
);
@@ -263,10 +258,10 @@ export default function Login({
}
return (
- <CenteredForm text={t("sign_in_to_your_account")}>
+ <CenteredForm header={t("sign_in_to_linkwarden")}>
<form onSubmit={loginUser}>
<div
- className="p-4 mx-auto flex flex-col gap-3 justify-between max-w-[30rem] min-w-80 w-full bg-slate-50 dark:bg-neutral-800 rounded-xl shadow-md border border-sky-100 dark:border-neutral-700"
+ className="mx-auto flex flex-col gap-3 justify-between max-w-md min-w-80 w-full"
data-testid="login-form"
>
{displayLoginCredential()}
@@ -274,7 +269,6 @@ export default function Login({
{displayRegistration()}
</div>
</form>
- <InstallApp />
</CenteredForm>
);
}
diff --git a/apps/web/pages/member-onboarding.tsx b/apps/web/pages/member-onboarding.tsx
index dad1f354..14fe9da4 100644
--- a/apps/web/pages/member-onboarding.tsx
+++ b/apps/web/pages/member-onboarding.tsx
@@ -6,9 +6,8 @@ import { useRouter } from "next/router";
import { FormEvent, useState } from "react";
import { toast } from "react-hot-toast";
import getServerSideProps from "@/lib/client/getServerSideProps";
-import { Trans, useTranslation } from "next-i18next";
+import { useTranslation } from "next-i18next";
import { useUpdateUser, useUser } from "@linkwarden/router/user";
-import { Separator } from "@/components/ui/separator";
interface FormData {
password: string;
@@ -64,15 +63,9 @@ export default function MemberOnboarding() {
}
return (
- <CenteredForm>
+ <CenteredForm header={t("invitation_accepted")}>
<form onSubmit={submit}>
- <div className="p-4 mx-auto flex flex-col gap-3 justify-between max-w-[30rem] min-w-80 w-full bg-base-200 rounded-xl shadow-md border border-neutral-content">
- <p className="text-3xl text-center font-extralight">
- {t("invitation_accepted")}
- </p>
-
- <Separator />
-
+ <div className="mx-auto flex flex-col gap-3 justify-between max-w-[30rem] min-w-80 w-full">
<p
style={{
whiteSpace: "pre-line",
@@ -84,12 +77,9 @@ export default function MemberOnboarding() {
</p>
<div>
- <p className="text-sm w-fit font-semibold mb-1">
- {t("display_name")}
- </p>
<TextInput
autoFocus
- placeholder="John Doe"
+ placeholder={t("display_name")}
value={form.name}
className="bg-base-100"
onChange={(e) => setForm({ ...form, name: e.target.value })}
@@ -97,12 +87,9 @@ export default function MemberOnboarding() {
</div>
<div>
- <p className="text-sm w-fit font-semibold mb-1">
- {t("new_password")}
- </p>
<TextInput
type="password"
- placeholder="••••••••••••••"
+ placeholder={t("new_password")}
value={form.password}
className="bg-base-100"
onChange={(e) => setForm({ ...form, password: e.target.value })}
@@ -110,25 +97,25 @@ export default function MemberOnboarding() {
</div>
{process.env.NEXT_PUBLIC_STRIPE && (
- <div className="text-xs text-neutral mb-3">
+ <div className="text-xs text-neutral text-center">
<p>
- <Trans
- i18nKey="sign_up_agreement"
- components={[
- <Link
- href="https://linkwarden.app/tos"
- className="font-semibold"
- data-testid="terms-of-service-link"
- key={0}
- />,
- <Link
- href="https://linkwarden.app/privacy-policy"
- className="font-semibold"
- data-testid="privacy-policy-link"
- key={1}
- />,
- ]}
- />
+ By continuing, you agree to our{" "}
+ <Link
+ href="https://linkwarden.app/tos"
+ className="underline"
+ data-testid="terms-of-service-link"
+ >
+ Terms of Service
+ </Link>{" "}
+ and{" "}
+ <Link
+ href="https://linkwarden.app/privacy-policy"
+ className="underline"
+ data-testid="privacy-policy-link"
+ >
+ Privacy Policy
+ </Link>
+ .
</p>
</div>
)}
@@ -136,7 +123,6 @@ export default function MemberOnboarding() {
<Button
type="submit"
variant="accent"
- className="mt-2"
size="full"
disabled={submitLoader}
>
diff --git a/apps/web/pages/register.tsx b/apps/web/pages/register.tsx
index f64c3228..85c298ae 100644
--- a/apps/web/pages/register.tsx
+++ b/apps/web/pages/register.tsx
@@ -12,7 +12,7 @@ import { getToken } from "next-auth/jwt";
import { prisma } from "@linkwarden/prisma";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
import { i18n } from "next-i18next.config";
-import { Trans, useTranslation } from "next-i18next";
+import { useTranslation } from "next-i18next";
import { useConfig } from "@linkwarden/router/config";
import { Separator } from "@/components/ui/separator";
import Checkbox from "@/components/Checkbox";
@@ -22,7 +22,6 @@ type FormData = {
username?: string;
email?: string;
password: string;
- passwordConfirmation: string;
acceptPromotionalEmails: boolean;
};
@@ -40,7 +39,6 @@ export default function Register({
username: config?.EMAIL_PROVIDER ? undefined : "",
email: config?.EMAIL_PROVIDER ? "" : undefined,
password: "",
- passwordConfirmation: "",
acceptPromotionalEmails: false,
});
@@ -50,28 +48,18 @@ export default function Register({
if (!submitLoader) {
const checkFields = () => {
if (config?.EMAIL_PROVIDER) {
- return (
- form.name !== "" &&
- form.email !== "" &&
- form.password !== "" &&
- form.passwordConfirmation !== ""
- );
+ return form.name !== "" && form.email !== "" && form.password !== "";
} else {
return (
- form.name !== "" &&
- form.username !== "" &&
- form.password !== "" &&
- form.passwordConfirmation !== ""
+ form.name !== "" && form.username !== "" && form.password !== ""
);
}
};
if (checkFields()) {
- if (form.password !== form.passwordConfirmation)
- return toast.error(t("passwords_mismatch"));
- else if (form.password.length < 8)
+ if (form.password.length < 8)
return toast.error(t("password_too_short"));
- const { passwordConfirmation, ...request } = form;
+ const { ...request } = form;
setSubmitLoader(true);
@@ -118,7 +106,7 @@ export default function Register({
const load = toast.loading(t("authenticating"));
- const res = await signIn(method, {});
+ await signIn(method, {});
toast.dismiss(load);
@@ -137,11 +125,19 @@ export default function Register({
variant="metal"
disabled={submitLoader}
>
- {value.name.toLowerCase() === "google" ||
- (value.name.toLowerCase() === "apple" && (
- <i className={"bi-" + value.name.toLowerCase()}></i>
- ))}
- {value.name}
+ {value.name.toLowerCase() === "google" ? (
+ <>
+ <i className={"bi-google"}></i>
+ {t("continue_with_google")}
+ </>
+ ) : value.name.toLowerCase() === "apple" ? (
+ <>
+ <i className={"bi-apple"}></i>
+ {t("continue_with_apple")}
+ </>
+ ) : (
+ value.name
+ )}
</Button>
</React.Fragment>
);
@@ -151,6 +147,7 @@ export default function Register({
return (
<CenteredForm
+ header={t("reimagine_how_you_save_links")}
text={
process.env.NEXT_PUBLIC_STRIPE
? t("trial_offer_desc", {
@@ -161,26 +158,16 @@ export default function Register({
data-testid="registration-form"
>
{config?.DISABLE_REGISTRATION ? (
- <div className="p-4 flex flex-col gap-3 justify-between max-w-[30rem] min-w-80 w-full bg-base-200 rounded-xl shadow-md border border-neutral-content">
+ <div className="flex flex-col gap-3 justify-between max-w-[30rem] min-w-80 w-full">
<p>{t("registration_disabled")}</p>
</div>
) : (
<form onSubmit={registerUser}>
- <div className="p-4 flex flex-col gap-3 justify-between max-w-[30rem] min-w-80 w-full mx-auto bg-base-200 rounded-xl shadow-md border border-neutral-content">
- <p className="text-3xl text-center font-extralight">
- {t("enter_details")}
- </p>
-
- <Separator />
-
+ <div className="flex flex-col gap-3 justify-between max-w-[30rem] min-w-80 w-full mx-auto">
<div>
- <p className="text-sm w-fit font-semibold mb-1">
- {t("display_name")}
- </p>
-
<TextInput
autoFocus={true}
- placeholder="Johnny"
+ placeholder={t("display_name")}
value={form.name}
className="bg-base-100"
data-testid="display-name-input"
@@ -190,12 +177,8 @@ export default function Register({
{config?.EMAIL_PROVIDER ? undefined : (
<div>
- <p className="text-sm w-fit font-semibold mb-1">
- {t("username")}
- </p>
-
<TextInput
- placeholder="john"
+ placeholder={t("username")}
value={form.username}
className="bg-base-100"
data-testid="username-input"
@@ -208,11 +191,9 @@ export default function Register({
{config?.EMAIL_PROVIDER && (
<div>
- <p className="text-sm w-fit font-semibold mb-1">{t("email")}</p>
-
<TextInput
type="email"
- placeholder="[email protected]"
+ placeholder={t("email")}
value={form.email}
className="bg-base-100"
data-testid="email-input"
@@ -222,13 +203,9 @@ export default function Register({
)}
<div className="w-full">
- <p className="text-sm w-fit font-semibold mb-1">
- {t("password")}
- </p>
-
<TextInput
type="password"
- placeholder="••••••••••••••"
+ placeholder={t("password")}
value={form.password}
className="bg-base-100"
data-testid="password-input"
@@ -236,23 +213,6 @@ export default function Register({
/>
</div>
- <div className="w-full">
- <p className="text-sm w-fit font-semibold mb-1">
- {t("confirm_password")}
- </p>
-
- <TextInput
- type="password"
- placeholder="••••••••••••••"
- value={form.passwordConfirmation}
- className="bg-base-100"
- data-testid="password-confirm-input"
- onChange={(e) =>
- setForm({ ...form, passwordConfirmation: e.target.value })
- }
- />
- </div>
-
{process.env.NEXT_PUBLIC_STRIPE && (
<>
<Checkbox
@@ -266,28 +226,6 @@ export default function Register({
})
}
/>
-
- <div className="text-xs text-neutral mb-3">
- <p>
- <Trans
- i18nKey="sign_up_agreement"
- components={[
- <Link
- href="https://linkwarden.app/tos"
- className="font-semibold"
- data-testid="terms-of-service-link"
- key={0}
- />,
- <Link
- href="https://linkwarden.app/privacy-policy"
- className="font-semibold"
- data-testid="privacy-policy-link"
- key={1}
- />,
- ]}
- />
- </p>
- </div>
</>
)}
@@ -304,12 +242,37 @@ export default function Register({
{availableLogins.buttonAuths.length > 0 && (
<div className="flex items-center gap-2">
<Separator className="my-1 flex-1 w-auto" />
- <p className="whitespace-nowrap">{t("or_continue_with")}</p>
+ <p className="whitespace-nowrap">{t("or")}</p>
<Separator className="my-1 flex-1 w-auto" />
</div>
)}
{displayLoginExternalButton()}
+
+ {process.env.NEXT_PUBLIC_STRIPE && (
+ <div className="text-xs text-neutral text-center">
+ <p>
+ By continuing, you agree to our{" "}
+ <Link
+ href="https://linkwarden.app/tos"
+ className="underline"
+ data-testid="terms-of-service-link"
+ >
+ Terms of Service
+ </Link>{" "}
+ and{" "}
+ <Link
+ href="https://linkwarden.app/privacy-policy"
+ className="underline"
+ data-testid="privacy-policy-link"
+ >
+ Privacy Policy
+ </Link>
+ .
+ </p>
+ </div>
+ )}
+
<div>
<div className="text-neutral text-center flex items-baseline gap-1 justify-center">
<p className="w-fit text-neutral">{t("already_registered")}</p>
diff --git a/apps/web/pages/settings/delete.tsx b/apps/web/pages/settings/delete.tsx
index 218dbba1..27403cfe 100644
--- a/apps/web/pages/settings/delete.tsx
+++ b/apps/web/pages/settings/delete.tsx
@@ -8,7 +8,6 @@ import { Button } from "@/components/ui/button";
import { useTranslation } from "next-i18next";
import getServerSideProps from "@/lib/client/getServerSideProps";
import { useUser } from "@linkwarden/router/user";
-import { Separator } from "@/components/ui/separator";
export default function Delete() {
const [password, setPassword] = useState("");
@@ -58,33 +57,30 @@ export default function Delete() {
return (
<CenteredForm>
- <div className="p-4 mx-auto relative flex flex-col gap-3 justify-between max-w-[30rem] min-w-80 bg-base-200 rounded-xl shadow-md border border-neutral-content">
- <Button
- asChild
- variant="ghost"
- size="icon"
- className="absolute top-4 left-4"
- >
- <Link href="/settings/account">
- <i className="bi-chevron-left text-neutral text-xl"></i>
- </Link>
- </Button>
- <div className="flex items-center gap-2 w-full rounded-md h-8">
- <p className="text-red-500 dark:text-red-500 truncate w-full text-3xl text-center">
+ <div className="mx-auto flex flex-col gap-3 justify-between max-w-[30rem] min-w-80">
+ <div className="flex items-center gap-2 w-full rounded-md h-8 relative">
+ <Button
+ asChild
+ variant="ghost"
+ size="icon"
+ className="absolute top-0 left-0"
+ >
+ <Link href="/settings/account">
+ <i className="bi-chevron-left text-neutral text-xl"></i>
+ </Link>
+ </Button>
+ <p className="text-red-500 dark:text-red-500 truncate w-full text-2xl text-center">
{t("delete_account")}
</p>
</div>
- <Separator />
-
<p>{t("delete_warning")}</p>
<div>
- <p className="mb-2">{t("confirm_password")}</p>
<TextInput
value={password}
onChange={(e) => setPassword(e.target.value)}
- placeholder="••••••••••••••"
+ placeholder={t("confirm_password")}
className="bg-base-100"
type="password"
/>
diff --git a/apps/web/pages/subscribe.tsx b/apps/web/pages/subscribe.tsx
index c0fbf024..45909d77 100644
--- a/apps/web/pages/subscribe.tsx
+++ b/apps/web/pages/subscribe.tsx
@@ -8,7 +8,6 @@ import { Button } from "@/components/ui/button";
import getServerSideProps from "@/lib/client/getServerSideProps";
import { Trans, useTranslation } from "next-i18next";
import { useUser } from "@linkwarden/router/user";
-import { Separator } from "@/components/ui/separator";
import { cn } from "@/lib/utils";
import {
DropdownMenu,
@@ -70,25 +69,21 @@ export default function Subscribe() {
return (
<CenteredForm
+ header={t("subscribe_title")}
+ className="bg-gradient-to-b from-[#289DF220] to-transparent"
text={
- REQUIRE_CC
+ REQUIRE_CC && user?.subscription?.provider === undefined
? `Start with a ${
process.env.NEXT_PUBLIC_TRIAL_PERIOD_DAYS || 14
}-day free trial, cancel anytime!`
- : daysLeft <= 0
- ? "Your free trial has ended, subscribe to continue."
- : `You have ${daysLeft} ${
+ : !REQUIRE_CC && daysLeft > 0
+ ? `You have ${daysLeft} ${
daysLeft === 1 ? "day" : "days"
} left in your free trial.`
+ : "Your free trial has ended, subscribe to continue."
}
>
- <div className="p-4 mx-auto flex flex-col gap-3 justify-between max-w-[30rem] min-w-80 w-full bg-base-200 rounded-xl shadow-md border border-neutral-content">
- <p className="sm:text-3xl text-xl text-center font-extralight">
- {t("subscribe_title")}
- </p>
-
- <Separator />
-
+ <div className="mx-auto flex flex-col gap-3 justify-between max-w-[30rem] min-w-80 w-full">
<div>
<p>
<Trans
@@ -104,7 +99,7 @@ export default function Subscribe() {
</p>
</div>
- <div className="flex gap-3 border border-solid border-neutral-content w-4/5 mx-auto p-1 rounded-xl relative">
+ <div className="flex gap-3 border border-solid border-neutral-content w-full mx-auto p-1 rounded-xl relative">
<button
onClick={() => setPlan(Plan.monthly)}
className={`w-full duration-100 text-sm rounded-lg p-1 ${
@@ -144,8 +139,8 @@ export default function Subscribe() {
</p>
{REQUIRE_CC || daysLeft > 0 ? (
- <fieldset className="w-full max-h-fit flex-col flex gap-2 px-4 pb-4 pt-2 rounded-md border border-neutral-content">
- <legend className="w-fit font-extralight px-2 border border-neutral-content rounded-md text-xl">
+ <fieldset className="w-full max-h-fit flex-col flex gap-2 px-4 pb-4 pt-2 rounded-xl border border-neutral-content">
+ <legend className="w-fit font-extralight px-2 border border-neutral-content rounded-xl text-xl">
{t("total")}
</legend>
@@ -186,13 +181,10 @@ export default function Subscribe() {
{REQUIRE_CC || daysLeft <= 0 ? (
<DropdownMenu>
<DropdownMenuTrigger asChild>
- <button
- type="button"
- className="w-fit mx-auto flex items-center gap-1 cursor-pointer text-neutral text-sm"
- >
+ <Button variant="ghost" size="sm" className="w-fit mx-auto">
{t("manage_your_account")}
<i className="bi-chevron-down text-sm" />
- </button>
+ </Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="center">
<DropdownMenuItem onClick={() => signOut()}>
diff --git a/apps/web/public/icon-small-150x150.png b/apps/web/public/icon-small-150x150.png
new file mode 100644
index 00000000..433f01d5
Binary files /dev/null and b/apps/web/public/icon-small-150x150.png differ
diff --git a/apps/web/public/locales/en/common.json b/apps/web/public/locales/en/common.json
index 1b2734af..69856019 100644
--- a/apps/web/public/locales/en/common.json
+++ b/apps/web/public/locales/en/common.json
@@ -547,5 +547,10 @@
"regenerate_broken_preserved_content_desc": "<0>Delete and re-preserve broken links with at least one missing preserved format.</0><0>This action will immediately delete any existing preserved format for {{count}} links.</0><0>Affected links will be scheduled to have their preserved formats rebuilt.</0>",
"delete_all_preserved_content_and_regenerate_desc": "<0>This action will immediately delete all your existing preserved formats.</0><0>Affected links will be scheduled to have their preserved formats rebuilt.</0>",
"note": "Note",
- "search_unindexed_links_in_bg_info": "Search may be less accurate because some links are still being processed."
+ "search_unindexed_links_in_bg_info": "Search may be less accurate because some links are still being processed.",
+ "reimagine_how_you_save_links": "Reimagine how you save links",
+ "sign_in_to_linkwarden": "Welcome back!",
+ "or": "Or",
+ "continue_with_apple": "Continue with Apple",
+ "continue_with_google": "Continue with Google"
}