From 4436c337dd092f0110c3a111f0f4803c21024118 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Tue, 3 Oct 2023 15:07:47 +0800 Subject: [PATCH] Cleanup --- .prettierrc | 1 + src/components/account-block.jsx | 1 - src/components/nav-menu.jsx | 7 +------ src/components/shortcuts-settings.jsx | 1 + src/components/timeline.jsx | 1 - src/pages/account-statuses.jsx | 2 +- src/pages/hashtag.jsx | 1 - src/pages/home.jsx | 19 ------------------- src/pages/settings.jsx | 17 +++++++++++++++++ src/pages/status.jsx | 2 +- src/pages/trending.jsx | 2 +- src/pages/welcome.jsx | 1 + src/utils/api.js | 2 +- 13 files changed, 25 insertions(+), 32 deletions(-) diff --git a/.prettierrc b/.prettierrc index 4e525c56..b2f59f51 100644 --- a/.prettierrc +++ b/.prettierrc @@ -8,6 +8,7 @@ "index.css$", ".css$", "", + "/assets/", "^../", "^[./]" ], diff --git a/src/components/account-block.jsx b/src/components/account-block.jsx index e17edc63..0b7e9cea 100644 --- a/src/components/account-block.jsx +++ b/src/components/account-block.jsx @@ -3,7 +3,6 @@ import './account-block.css'; // import { useNavigate } from 'react-router-dom'; import enhanceContent from '../utils/enhance-content'; import niceDateTime from '../utils/nice-date-time'; -import shortenNumber from '../utils/shorten-number'; import states from '../utils/states'; import Avatar from './avatar'; diff --git a/src/components/nav-menu.jsx b/src/components/nav-menu.jsx index 53b4cc48..5591609d 100644 --- a/src/components/nav-menu.jsx +++ b/src/components/nav-menu.jsx @@ -1,11 +1,6 @@ import './nav-menu.css'; -import { - ControlledMenu, - Menu, - MenuDivider, - MenuItem, -} from '@szhsin/react-menu'; +import { ControlledMenu, MenuDivider, MenuItem } from '@szhsin/react-menu'; import { useEffect, useRef, useState } from 'preact/hooks'; import { useLongPress } from 'use-long-press'; import { useSnapshot } from 'valtio'; diff --git a/src/components/shortcuts-settings.jsx b/src/components/shortcuts-settings.jsx index efa06e38..55c8b399 100644 --- a/src/components/shortcuts-settings.jsx +++ b/src/components/shortcuts-settings.jsx @@ -11,6 +11,7 @@ import { useSnapshot } from 'valtio'; import floatingButtonUrl from '../assets/floating-button.svg'; import multiColumnUrl from '../assets/multi-column.svg'; import tabMenuBarUrl from '../assets/tab-menu-bar.svg'; + import { api } from '../utils/api'; import showToast from '../utils/show-toast'; import states from '../utils/states'; diff --git a/src/components/timeline.jsx b/src/components/timeline.jsx index b35c26ab..e4083c6a 100644 --- a/src/components/timeline.jsx +++ b/src/components/timeline.jsx @@ -14,7 +14,6 @@ import useScroll from '../utils/useScroll'; import Icon from './icon'; import Link from './link'; -import Loader from './loader'; import NavMenu from './nav-menu'; import Status from './status'; diff --git a/src/pages/account-statuses.jsx b/src/pages/account-statuses.jsx index d40cfe23..b8212948 100644 --- a/src/pages/account-statuses.jsx +++ b/src/pages/account-statuses.jsx @@ -1,4 +1,4 @@ -import { Menu, MenuItem } from '@szhsin/react-menu'; +import { MenuItem } from '@szhsin/react-menu'; import { useEffect, useMemo, useRef, useState } from 'preact/hooks'; import { useParams, useSearchParams } from 'react-router-dom'; import { useSnapshot } from 'valtio'; diff --git a/src/pages/hashtag.jsx b/src/pages/hashtag.jsx index a34cf475..7834ff71 100644 --- a/src/pages/hashtag.jsx +++ b/src/pages/hashtag.jsx @@ -1,6 +1,5 @@ import { FocusableItem, - Menu, MenuDivider, MenuGroup, MenuItem, diff --git a/src/pages/home.jsx b/src/pages/home.jsx index 5ab7458d..8acfcc96 100644 --- a/src/pages/home.jsx +++ b/src/pages/home.jsx @@ -13,7 +13,6 @@ import Notification from '../components/notification'; import { api } from '../utils/api'; import db from '../utils/db'; import groupNotifications from '../utils/group-notifications'; -import openCompose from '../utils/open-compose'; import states, { saveStatus } from '../utils/states'; import { getCurrentAccountNS } from '../utils/store-utils'; @@ -49,24 +48,6 @@ function Home() { headerEnd={} /> )} - {/* */} ); } diff --git a/src/pages/settings.jsx b/src/pages/settings.jsx index 0c6635ce..abbb99c9 100644 --- a/src/pages/settings.jsx +++ b/src/pages/settings.jsx @@ -4,6 +4,7 @@ import { useEffect, useRef, useState } from 'preact/hooks'; import { useSnapshot } from 'valtio'; import logo from '../assets/logo.svg'; + import Icon from '../components/icon'; import Link from '../components/link'; import RelativeTime from '../components/relative-time'; @@ -481,6 +482,22 @@ function Settings({ onClose }) {

+ + Sponsor + {' '} + ·{' '} + + Donate + {' '} + ·{' '}