aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/pages
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2023-09-21 23:49:12 +0800
committercrupest <crupest@outlook.com>2023-09-21 23:49:12 +0800
commitd477c7270c90b190ed82b13f48f39a05d83503d2 (patch)
tree572f74b2adc75247b9d1c9a8965e3de2559d4160 /FrontEnd/src/pages
parenta8a8385cd959e4d9d57b8a35381d2851049c07ff (diff)
downloadtimeline-d477c7270c90b190ed82b13f48f39a05d83503d2.tar.gz
timeline-d477c7270c90b190ed82b13f48f39a05d83503d2.tar.bz2
timeline-d477c7270c90b190ed82b13f48f39a05d83503d2.zip
Fix #1394.
Diffstat (limited to 'FrontEnd/src/pages')
-rw-r--r--FrontEnd/src/pages/about/index.tsx2
-rw-r--r--FrontEnd/src/pages/setting/ChangeAvatarDialog.tsx5
-rw-r--r--FrontEnd/src/pages/setting/index.tsx15
-rw-r--r--FrontEnd/src/pages/timeline/Timeline.tsx2
-rw-r--r--FrontEnd/src/pages/timeline/TimelineMember.tsx3
-rw-r--r--FrontEnd/src/pages/timeline/edit/TimelinePostCreateView.tsx4
-rw-r--r--FrontEnd/src/pages/timeline/index.tsx2
7 files changed, 15 insertions, 18 deletions
diff --git a/FrontEnd/src/pages/about/index.tsx b/FrontEnd/src/pages/about/index.tsx
index bce64322..f95557c2 100644
--- a/FrontEnd/src/pages/about/index.tsx
+++ b/FrontEnd/src/pages/about/index.tsx
@@ -1,6 +1,6 @@
import "./index.css";
-import { useC } from "~src/common";
+import { useC } from "~src/components/common";
import Page from "~src/components/Page";
interface Credit {
diff --git a/FrontEnd/src/pages/setting/ChangeAvatarDialog.tsx b/FrontEnd/src/pages/setting/ChangeAvatarDialog.tsx
index 4cdecbbb..9ede593e 100644
--- a/FrontEnd/src/pages/setting/ChangeAvatarDialog.tsx
+++ b/FrontEnd/src/pages/setting/ChangeAvatarDialog.tsx
@@ -1,11 +1,10 @@
import { useState, ChangeEvent, ComponentPropsWithoutRef } from "react";
-import { useC, Text, UiLogicError } from "~src/common";
-
import { useUser } from "~src/services/user";
import { getHttpUserClient } from "~src/http/user";
+import { useC, I18nText, UiLogicError } from "~src/components/common";
import { ImageCropper, useImageCrop } from "~src/components/ImageCropper";
import BlobImage from "~src/components/BlobImage";
import { ButtonRowV2 } from "~src/components/button";
@@ -43,7 +42,7 @@ export default function ChangeAvatarDialog({
});
const [resultBlob, setResultBlob] = useState<Blob | null>(null);
- const [message, setMessage] = useState<Text>(
+ const [message, setMessage] = useState<I18nText>(
"settings.dialogChangeAvatar.prompt.select",
);
diff --git a/FrontEnd/src/pages/setting/index.tsx b/FrontEnd/src/pages/setting/index.tsx
index 3fb18e24..70df1b32 100644
--- a/FrontEnd/src/pages/setting/index.tsx
+++ b/FrontEnd/src/pages/setting/index.tsx
@@ -11,8 +11,7 @@ import classNames from "classnames";
import { useUser, userService } from "~src/services/user";
import { getHttpUserClient } from "~src/http/user";
-import { useC, Text } from "~src/common";
-
+import { useC, I18nText } from "~src/components/common";
import { pushAlert } from "~src/components/alert";
import { useDialog, ConfirmDialog } from "~src/components/dialog";
import Card from "~src/components/Card";
@@ -27,7 +26,7 @@ import "./index.css";
interface SettingSectionProps
extends Omit<ComponentPropsWithoutRef<typeof Card>, "title"> {
- title: Text;
+ title: I18nText;
children?: ReactNode;
}
@@ -49,8 +48,8 @@ function SettingSection({
interface SettingItemContainerProps
extends Omit<ComponentPropsWithoutRef<"div">, "title"> {
- title: Text;
- description?: Text;
+ title: I18nText;
+ description?: I18nText;
danger?: boolean;
extraClassName?: string;
}
@@ -78,7 +77,9 @@ function SettingItemContainer({
>
<div className="setting-item-label-area">
<div className="setting-item-label-title">{c(title)}</div>
- <small className="setting-item-label-sub">{c(description)}</small>
+ {description && (
+ <small className="setting-item-label-sub">{c(description)}</small>
+ )}
</div>
<div className="setting-item-value-area">{children}</div>
</div>
@@ -97,7 +98,7 @@ interface SelectSettingItemProps
extends Omit<SettingItemContainerProps, "onSelect" | "extraClassName"> {
options: {
value: string;
- label: Text;
+ label: I18nText;
}[];
value?: string | null;
onSelect: (value: string) => void;
diff --git a/FrontEnd/src/pages/timeline/Timeline.tsx b/FrontEnd/src/pages/timeline/Timeline.tsx
index e2ab5c71..69dfecea 100644
--- a/FrontEnd/src/pages/timeline/Timeline.tsx
+++ b/FrontEnd/src/pages/timeline/Timeline.tsx
@@ -115,7 +115,7 @@ export function Timeline(props: TimelineProps) {
return () => {
subscription.unsubscribe();
};
- }, [timelineOwner, timelineName]);
+ }, [timelineOwner, timelineName, reloadPosts]);
useScrollToBottom(() => {
console.log(`Load page ${currentPage + 1}.`);
diff --git a/FrontEnd/src/pages/timeline/TimelineMember.tsx b/FrontEnd/src/pages/timeline/TimelineMember.tsx
index 0812016f..4fa9cf72 100644
--- a/FrontEnd/src/pages/timeline/TimelineMember.tsx
+++ b/FrontEnd/src/pages/timeline/TimelineMember.tsx
@@ -1,12 +1,11 @@
import { useState } from "react";
import { useTranslation } from "react-i18next";
-import { convertI18nText, I18nText } from "~src/common";
-
import { HttpUser } from "~src/http/user";
import { getHttpSearchClient } from "~src/http/search";
import { getHttpTimelineClient, HttpTimelineInfo } from "~src/http/timeline";
+import { convertI18nText, I18nText } from "~src/components/common";
import SearchInput from "~src/components/SearchInput";
import UserAvatar from "~src/components/user/UserAvatar";
import { IconButton } from "~src/components/button";
diff --git a/FrontEnd/src/pages/timeline/edit/TimelinePostCreateView.tsx b/FrontEnd/src/pages/timeline/edit/TimelinePostCreateView.tsx
index c0a80ad0..fe04bfa2 100644
--- a/FrontEnd/src/pages/timeline/edit/TimelinePostCreateView.tsx
+++ b/FrontEnd/src/pages/timeline/edit/TimelinePostCreateView.tsx
@@ -1,8 +1,6 @@
import { useState } from "react";
import classNames from "classnames";
-import { UiLogicError } from "~src/common";
-
import {
getHttpTimelineClient,
HttpTimelineInfo,
@@ -12,7 +10,7 @@ import {
import base64 from "~src/utilities/base64";
-import { useC } from "~/src/components/common";
+import { UiLogicError, useC } from "~/src/components/common";
import { pushAlert } from "~src/components/alert";
import { IconButton, LoadingButton } from "~src/components/button";
import PopupMenu from "~src/components/menu/PopupMenu";
diff --git a/FrontEnd/src/pages/timeline/index.tsx b/FrontEnd/src/pages/timeline/index.tsx
index 6cd1ded0..ee792d93 100644
--- a/FrontEnd/src/pages/timeline/index.tsx
+++ b/FrontEnd/src/pages/timeline/index.tsx
@@ -1,6 +1,6 @@
import { useParams } from "react-router-dom";
-import { UiLogicError } from "~src/common";
+import { UiLogicError } from "~src/components/common";
import Timeline from "./Timeline";