From 05c6edfe2f442aff439027828b5811ad06798bea Mon Sep 17 00:00:00 2001 From: Steven Date: Wed, 26 Jun 2024 22:11:18 +0800 Subject: [PATCH] chore: tweak auth pages --- .../Settings/AccessTokenSection.tsx | 2 +- web/src/pages/SignIn.tsx | 4 ++-- web/src/pages/SignUp.tsx | 21 +++++++++++-------- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/web/src/components/Settings/AccessTokenSection.tsx b/web/src/components/Settings/AccessTokenSection.tsx index 1ae31441..dff68b92 100644 --- a/web/src/components/Settings/AccessTokenSection.tsx +++ b/web/src/components/Settings/AccessTokenSection.tsx @@ -13,7 +13,7 @@ import LearnMore from "../LearnMore"; const listAccessTokens = async (name: string) => { const { accessTokens } = await userServiceClient.listUserAccessTokens({ name }); - return accessTokens; + return accessTokens.sort((a, b) => (b.issuedAt?.getTime() ?? 0) - (a.issuedAt?.getTime() ?? 0)); }; const AccessTokenSection = () => { diff --git a/web/src/pages/SignIn.tsx b/web/src/pages/SignIn.tsx index 4155dae7..83c20f75 100644 --- a/web/src/pages/SignIn.tsx +++ b/web/src/pages/SignIn.tsx @@ -118,7 +118,7 @@ const SignIn = () => {
-
+
{t("common.username")} { required />
-
+
{t("common.password")} {

{t("auth.create-your-account")}

-
+
{t("common.username")} { required />
-
+
{t("common.password")} {
- {!commonContext.profile.owner &&

{t("auth.host-tip")}

} -

- {t("auth.sign-in-tip")} - - {t("common.sign-in")} - -

+ {!commonContext.profile.owner ? ( +

{t("auth.host-tip")}

+ ) : ( +

+ {t("auth.sign-in-tip")} + + {t("common.sign-in")} + +

+ )}