diff --git a/.github/workflows/prodtag.yml b/.github/workflows/prodtag.yml index 0fe0483d..6b9f2cdd 100644 --- a/.github/workflows/prodtag.yml +++ b/.github/workflows/prodtag.yml @@ -12,5 +12,5 @@ jobs: - uses: actions/checkout@v4 with: ref: production - - run: git tag -a "'{date +%Y.%m.%d}.{git rev-parse --short HEAD}'" $(git rev-parse HEAD) + - run: git tag "`date +%Y.%m.%d`.`git rev-parse --short HEAD`" $(git rev-parse HEAD) - run: git push 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/README.md b/README.md index 95cd5f95..7922bee8 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,7 @@ Try search for "how to self-host static sites" as there are many ways to do it. - [React Router](https://reactrouter.com/) - Routing - [masto.js](https://github.com/neet/masto.js/) - Mastodon API client - [Iconify](https://iconify.design/) - Icon library + - [MingCute icons](https://www.mingcute.com/) - Vanilla CSS - *Yes, I'm old school.* Some of these may change in the future. The front-end world is ever-changing. 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/account-info.jsx b/src/components/account-info.jsx index 6c719583..e24101b8 100644 --- a/src/components/account-info.jsx +++ b/src/components/account-info.jsx @@ -401,6 +401,7 @@ function AccountInfo({ ))}
{' '} 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 + {' '} + ·{' '} { + if (ref.current) { + const { scrollHeight } = ref.current; + let truncated = scrollHeight > height; + if (truncated) { + const { height: _height, maxHeight } = getComputedStyle(ref.current); + const computedHeight = parseInt(maxHeight || _height, 10); + truncated = scrollHeight > computedHeight; + } + ref.current.classList.toggle(className, truncated); + } + }, + 300, + { + maxWait: 2000, + }, + ); useResizeObserver({ ref, box: 'border-box', - onResize: ({ height }) => { - if (ref.current) { - const { scrollHeight } = ref.current; - ref.current.classList.toggle(className, scrollHeight > height); - } - }, + onResize, }); return ref; }