diff --git a/web/src/components/Settings/MemberSection.tsx b/web/src/components/Settings/MemberSection.tsx
index 645010f4..7ac73a36 100644
--- a/web/src/components/Settings/MemberSection.tsx
+++ b/web/src/components/Settings/MemberSection.tsx
@@ -156,7 +156,10 @@ const PreferencesSection = () => {
{userList.map((user) => (
{user.id} |
- {user.username} |
+
+ {user.username}
+ {user.rowStatus === "ARCHIVED" && "(Archived)"}
+ |
{user.nickname} |
{user.email} |
diff --git a/web/src/components/UserAvatar.tsx b/web/src/components/UserAvatar.tsx
index 281a7dd3..4832d24e 100644
--- a/web/src/components/UserAvatar.tsx
+++ b/web/src/components/UserAvatar.tsx
@@ -8,7 +8,7 @@ interface Props {
const UserAvatar = (props: Props) => {
const { avatarUrl, className } = props;
return (
-
+
);
diff --git a/web/src/helpers/datetime.ts b/web/src/helpers/datetime.ts
index 8904ea4e..8b06a2aa 100644
--- a/web/src/helpers/datetime.ts
+++ b/web/src/helpers/datetime.ts
@@ -130,29 +130,22 @@ export const getRelativeTimeString = (time: number, locale = i18n.language, form
// numeric: "auto" provides "yesterday" for 1 day ago, "always" provides "1 day ago"
const formatOpts = { style: formatStyle, numeric: "auto" } as Intl.RelativeTimeFormatOptions;
-
const relTime = new Intl.RelativeTimeFormat(locale, formatOpts);
-
if (pastTimeMillis < minMillis) {
return relTime.format(-Math.round(pastTimeMillis / secMillis), "second");
}
-
if (pastTimeMillis < hourMillis) {
return relTime.format(-Math.round(pastTimeMillis / minMillis), "minute");
}
-
if (pastTimeMillis < dayMillis) {
return relTime.format(-Math.round(pastTimeMillis / hourMillis), "hour");
}
-
if (pastTimeMillis < dayMillis * 7) {
return relTime.format(-Math.round(pastTimeMillis / dayMillis), "day");
}
-
if (pastTimeMillis < dayMillis * 30) {
return relTime.format(-Math.round(pastTimeMillis / (dayMillis * 7)), "week");
}
-
if (pastTimeMillis < dayMillis * 365) {
return relTime.format(-Math.round(pastTimeMillis / (dayMillis * 30)), "month");
}
diff --git a/web/src/less/memo-content.less b/web/src/less/memo-content.less
index e8253cfa..20cdbb30 100644
--- a/web/src/less/memo-content.less
+++ b/web/src/less/memo-content.less
@@ -1,5 +1,5 @@
.memo-content-wrapper {
- @apply w-full flex flex-col justify-start items-start text-gray-800 dark:text-gray-200;
+ @apply w-full flex flex-col justify-start items-start text-gray-800 dark:text-gray-300;
> .memo-content-text {
@apply w-full max-w-full word-break text-base leading-6;
diff --git a/web/src/less/memo.less b/web/src/less/memo.less
index 6d855c67..1cd5185b 100644
--- a/web/src/less/memo.less
+++ b/web/src/less/memo.less
@@ -8,30 +8,6 @@
> .memo-top-wrapper {
@apply flex flex-row justify-between items-center w-full h-6 mb-1;
- > .status-text-container {
- @apply flex flex-row justify-start items-center;
-
- > .time-text {
- @apply text-sm text-gray-400;
- }
-
- > .name-text {
- @apply ml-1 text-sm text-gray-400 cursor-pointer hover:opacity-80;
- }
-
- > .status-text {
- @apply text-xs cursor-pointer ml-2 rounded border px-1;
-
- &.public {
- @apply border-green-600 text-green-600;
- }
-
- &.protected {
- @apply border-gray-400 text-gray-400;
- }
- }
- }
-
> .btns-container {
@apply flex flex-row justify-end items-center relative shrink-0;
@@ -56,7 +32,7 @@
@apply flex flex-row justify-center items-center leading-6 text-sm rounded hover:bg-gray-200 dark:hover:bg-zinc-600;
&.more-action-btn {
- @apply w-auto opacity-60 cursor-default hover:bg-transparent;
+ @apply w-auto opacity-50 cursor-default hover:bg-transparent;
> .icon-img {
@apply w-4 h-auto dark:text-gray-300;
diff --git a/web/src/pages/Explore.tsx b/web/src/pages/Explore.tsx
index 79520495..c65842d5 100644
--- a/web/src/pages/Explore.tsx
+++ b/web/src/pages/Explore.tsx
@@ -93,7 +93,7 @@ const Explore = () => {
{sortedMemos.map((memo) => {
- return ;
+ return ;
})}
{isComplete ? (
memos.length === 0 && (
diff --git a/web/src/pages/MemoDetail.tsx b/web/src/pages/MemoDetail.tsx
index 9ccd32b1..359b323a 100644
--- a/web/src/pages/MemoDetail.tsx
+++ b/web/src/pages/MemoDetail.tsx
@@ -33,7 +33,7 @@ const MemoDetail = () => {
}, [location]);
return (
-
+
@@ -45,7 +45,7 @@ const MemoDetail = () => {
(memo ? (
<>
-
+
{
+ const t = useTranslate();
+ const globalStore = useGlobalStore();
+ const userStore = useUserStore();
+ const loadingState = useLoading();
+ const user = userStore.state.user;
+
+ useEffect(() => {
+ const currentUsername = userStore.getCurrentUsername();
+ userStore
+ .getUserByUsername(currentUsername)
+ .then(() => {
+ loadingState.setFinish();
+ })
+ .catch((error) => {
+ console.error(error);
+ toast.error(t("message.user-not-found"));
+ });
+ }, [userStore.getCurrentUsername()]);
+
+ useEffect(() => {
+ if (user?.setting.locale) {
+ globalStore.setLocale(user.setting.locale);
+ }
+ }, [user?.setting.locale]);
+
+ return (
+ <>
+
+
+ {!loadingState.isLoading &&
+ (user ? (
+ <>
+
+
+
+ >
+ ) : (
+ <>
+ Not found
+ >
+ ))}
+
+
+
+
+ >
+ );
+};
+
+export default UserProfile;
diff --git a/web/src/router/index.tsx b/web/src/router/index.tsx
index 55ce4695..bd04d464 100644
--- a/web/src/router/index.tsx
+++ b/web/src/router/index.tsx
@@ -13,6 +13,7 @@ const Auth = lazy(() => import("@/pages/Auth"));
const AuthCallback = lazy(() => import("@/pages/AuthCallback"));
const Explore = lazy(() => import("@/pages/Explore"));
const Home = lazy(() => import("@/pages/Home"));
+const UserProfile = lazy(() => import("@/pages/UserProfile"));
const MemoDetail = lazy(() => import("@/pages/MemoDetail"));
const EmbedMemo = lazy(() => import("@/pages/EmbedMemo"));
const NotFound = lazy(() => import("@/pages/NotFound"));
@@ -78,28 +79,6 @@ const router = createBrowserRouter([
return redirect("/explore");
},
},
- {
- path: "u/:username",
- element: ,
- loader: async () => {
- await initialGlobalStateLoader();
-
- try {
- await initialUserState();
- } catch (error) {
- // do nth
- }
-
- const { user } = store.getState().user;
- const { systemStatus } = store.getState().global;
-
- if (isNullorUndefined(user) && systemStatus.disablePublicMemos) {
- return redirect("/auth");
- }
-
- return null;
- },
- },
{
path: "explore",
element: ,
@@ -238,6 +217,20 @@ const router = createBrowserRouter([
return null;
},
},
+ {
+ path: "u/:username",
+ element: ,
+ loader: async () => {
+ await initialGlobalStateLoader();
+
+ try {
+ await initialUserState();
+ } catch (error) {
+ // do nth
+ }
+ return null;
+ },
+ },
{
path: "*",
element: ,
|