aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/views
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2023-07-11 01:01:48 +0800
committercrupest <crupest@outlook.com>2023-07-11 01:01:48 +0800
commitd46b1aed549938c9f5e3e658b4098e71b5e2acf7 (patch)
tree0deae7f40692345c8e4b1473cdddbd13e0e5586d /FrontEnd/src/views
parentd9b83e4e8215168dda03b04168d7e30ce5fe779f (diff)
downloadtimeline-d46b1aed549938c9f5e3e658b4098e71b5e2acf7.tar.gz
timeline-d46b1aed549938c9f5e3e658b4098e71b5e2acf7.tar.bz2
timeline-d46b1aed549938c9f5e3e658b4098e71b5e2acf7.zip
Lint error, get away!
Diffstat (limited to 'FrontEnd/src/views')
-rw-r--r--FrontEnd/src/views/about/index.tsx7
-rw-r--r--FrontEnd/src/views/admin/Admin.tsx1
-rw-r--r--FrontEnd/src/views/admin/AdminNav.tsx5
-rw-r--r--FrontEnd/src/views/common/AppBar.tsx2
-rw-r--r--FrontEnd/src/views/common/button/IconButton.tsx6
-rw-r--r--FrontEnd/src/views/common/button/LoadingButton.tsx16
-rw-r--r--FrontEnd/src/views/login/index.tsx2
-rw-r--r--FrontEnd/src/views/settings/index.tsx6
-rw-r--r--FrontEnd/src/views/timeline/TimelinePostEdit.tsx6
9 files changed, 23 insertions, 28 deletions
diff --git a/FrontEnd/src/views/about/index.tsx b/FrontEnd/src/views/about/index.tsx
index 513b5003..093da894 100644
--- a/FrontEnd/src/views/about/index.tsx
+++ b/FrontEnd/src/views/about/index.tsx
@@ -1,4 +1,3 @@
-import * as React from "react";
import { useTranslation, Trans } from "react-i18next";
import authorAvatarUrl from "./author-avatar.png";
@@ -57,7 +56,7 @@ const backendCredits: {
},
];
-const AboutPage: React.FC = () => {
+export default function AboutPage() {
const { t } = useTranslation();
return (
@@ -141,6 +140,4 @@ const AboutPage: React.FC = () => {
</Card>
</div>
);
-};
-
-export default AboutPage;
+}
diff --git a/FrontEnd/src/views/admin/Admin.tsx b/FrontEnd/src/views/admin/Admin.tsx
index dc8b0aa6..986c36b4 100644
--- a/FrontEnd/src/views/admin/Admin.tsx
+++ b/FrontEnd/src/views/admin/Admin.tsx
@@ -1,4 +1,3 @@
-import * as React from "react";
import { Route, Routes } from "react-router-dom";
import { useTranslation } from "react-i18next";
diff --git a/FrontEnd/src/views/admin/AdminNav.tsx b/FrontEnd/src/views/admin/AdminNav.tsx
index 4081cf96..b7385e5c 100644
--- a/FrontEnd/src/views/admin/AdminNav.tsx
+++ b/FrontEnd/src/views/admin/AdminNav.tsx
@@ -1,9 +1,8 @@
-import * as React from "react";
import { useLocation } from "react-router-dom";
import Tabs from "../common/tab/Tabs";
-const AdminNav: React.FC<{ className?: string }> = ({ className }) => {
+export function AdminNav({ className }: { className?: string }) {
const location = useLocation();
const name = location.pathname.split("/")[2] ?? "user";
@@ -25,6 +24,6 @@ const AdminNav: React.FC<{ className?: string }> = ({ className }) => {
]}
/>
);
-};
+}
export default AdminNav;
diff --git a/FrontEnd/src/views/common/AppBar.tsx b/FrontEnd/src/views/common/AppBar.tsx
index 43d727c9..278c70fd 100644
--- a/FrontEnd/src/views/common/AppBar.tsx
+++ b/FrontEnd/src/views/common/AppBar.tsx
@@ -11,7 +11,7 @@ import UserAvatar from "./user/UserAvatar";
import "./AppBar.css";
-const AppBar: React.FC = (_) => {
+const AppBar: React.FC = () => {
const { t } = useTranslation();
const user = useUser();
diff --git a/FrontEnd/src/views/common/button/IconButton.tsx b/FrontEnd/src/views/common/button/IconButton.tsx
index d9d828e7..3ba56277 100644
--- a/FrontEnd/src/views/common/button/IconButton.tsx
+++ b/FrontEnd/src/views/common/button/IconButton.tsx
@@ -5,11 +5,11 @@ import { PaletteColorType } from "@/palette";
import "./IconButton.css";
-export type IconButtonProps = {
+export interface IconButtonProps extends React.ComponentPropsWithRef<"i"> {
icon: string;
color?: PaletteColorType;
large?: boolean;
-} & React.ComponentPropsWithRef<"i">;
+}
export default function IconButton(props: IconButtonProps): JSX.Element {
const { icon, color, className, large, ...otherProps } = props;
@@ -21,7 +21,7 @@ export default function IconButton(props: IconButtonProps): JSX.Element {
large && "large",
"bi-" + icon,
color ? "cru-" + color : "cru-primary",
- className
+ className,
)}
{...otherProps}
/>
diff --git a/FrontEnd/src/views/common/button/LoadingButton.tsx b/FrontEnd/src/views/common/button/LoadingButton.tsx
index 0804e40d..fceaec27 100644
--- a/FrontEnd/src/views/common/button/LoadingButton.tsx
+++ b/FrontEnd/src/views/common/button/LoadingButton.tsx
@@ -7,13 +7,13 @@ import { PaletteColorType } from "@/palette";
import Spinner from "../Spinner";
-function LoadingButton(
- props: {
- color?: PaletteColorType;
- text?: I18nText;
- loading?: boolean;
- } & React.ComponentPropsWithoutRef<"button">
-): JSX.Element {
+interface LoadingButtonProps extends React.ComponentPropsWithoutRef<"button"> {
+ color?: PaletteColorType;
+ text?: I18nText;
+ loading?: boolean;
+}
+
+function LoadingButton(props: LoadingButtonProps): JSX.Element {
const { t } = useTranslation();
const { color, text, loading, className, children, ...otherProps } = props;
@@ -27,7 +27,7 @@ function LoadingButton(
className={classNames(
"cru-" + (color ?? "primary"),
"cru-button outline",
- className
+ className,
)}
{...otherProps}
>
diff --git a/FrontEnd/src/views/login/index.tsx b/FrontEnd/src/views/login/index.tsx
index c083edeb..cc1d9865 100644
--- a/FrontEnd/src/views/login/index.tsx
+++ b/FrontEnd/src/views/login/index.tsx
@@ -9,7 +9,7 @@ import LoadingButton from "../common/button/LoadingButton";
import "./index.css";
-const LoginPage: React.FC = (_) => {
+const LoginPage: React.FC = () => {
const { t } = useTranslation();
const navigate = useNavigate();
diff --git a/FrontEnd/src/views/settings/index.tsx b/FrontEnd/src/views/settings/index.tsx
index 79c816a0..ccaf86d2 100644
--- a/FrontEnd/src/views/settings/index.tsx
+++ b/FrontEnd/src/views/settings/index.tsx
@@ -71,7 +71,7 @@ function SettingItemContainer({
"row settings-item mx-0",
first && "first",
onClick && "clickable",
- className
+ className,
)}
onClick={onClick}
>
@@ -134,7 +134,7 @@ const SelectSettingsItem: React.FC<SelectSettingItemProps> = ({
);
};
-const SettingsPage: React.FC = (_) => {
+const SettingsPage: React.FC = () => {
const { i18n } = useTranslation();
const user = useUser();
const navigate = useNavigate();
@@ -149,7 +149,7 @@ const SettingsPage: React.FC = (_) => {
>(null);
const [registerCode, setRegisterCode] = useState<undefined | null | string>(
- undefined
+ undefined,
);
const [bookmarkVisibility, setBookmarkVisibility] =
diff --git a/FrontEnd/src/views/timeline/TimelinePostEdit.tsx b/FrontEnd/src/views/timeline/TimelinePostEdit.tsx
index 88fa11a0..38e72264 100644
--- a/FrontEnd/src/views/timeline/TimelinePostEdit.tsx
+++ b/FrontEnd/src/views/timeline/TimelinePostEdit.tsx
@@ -161,7 +161,7 @@ const TimelinePostEdit: React.FC<TimelinePostEditProps> = (props) => {
case "image":
if (image == null) {
throw new UiLogicError(
- "Content type is image but image blob is null."
+ "Content type is image but image blob is null.",
);
}
requestData = {
@@ -187,10 +187,10 @@ const TimelinePostEdit: React.FC<TimelinePostEditProps> = (props) => {
setKind("text");
onPosted(data);
},
- (_) => {
+ () => {
setProcess(false);
onPostError();
- }
+ },
);
};