diff --git a/README.md b/README.md index 83b49814..978abe15 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,7 @@ Download or `git clone` this repository. Use `production` branch for *stable* re Customization can be done by passing environment variables to the build command. Examples: ```bash -PHANPY_APP_TITLE="Phanpy Dev" \ +PHANPY_CLIENT_NAME="Phanpy Dev" \ PHANPY_WEBSITE="https://dev.phanpy.social" \ npm run build ``` @@ -179,6 +179,10 @@ Available variables: - May specify a self-hosted Lingva instance, powered by either [lingva-translate](https://github.com/thedaviddelta/lingva-translate) or [lingva-api](https://github.com/cheeaun/lingva-api) - List of fallback instances hard-coded in `/.env` - [↗️ List of lingva-translate instances](https://github.com/thedaviddelta/lingva-translate?tab=readme-ov-file#instances) +- `PHANPY_GIPHY_API_KEY` (optional, no defaults): + - API key for [GIPHY](https://developers.giphy.com/). See [API docs](https://developers.giphy.com/docs/api/). + - If provided, a setting will appear for users to enable the GIF picker in the composer. Disabled by default. + - This is not self-hosted. ### Static site hosting diff --git a/package-lock.json b/package-lock.json index 109818cd..f413d674 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,6 +30,7 @@ "p-retry": "~6.2.0", "p-throttle": "~6.1.0", "preact": "~10.20.1", + "punycode": "~2.3.1", "react-hotkeys-hook": "~4.5.0", "react-intersection-observer": "~9.8.1", "react-quick-pinch-zoom": "~5.1.0", @@ -7154,11 +7155,9 @@ "integrity": "sha512-8xuCeM3l8yqdmbPoYeLbrAXCBWu19XEYc5/F28f5qOaoAIMyfmBUkl5axiK+x9olUvRlcekvnm98AP9RDngOIw==" }, "node_modules/punycode": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", - "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", - "dev": true, - "license": "MIT", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "engines": { "node": ">=6" } diff --git a/package.json b/package.json index 665c6228..35091075 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "p-retry": "~6.2.0", "p-throttle": "~6.1.0", "preact": "~10.20.1", + "punycode": "~2.3.1", "react-hotkeys-hook": "~4.5.0", "react-intersection-observer": "~9.8.1", "react-quick-pinch-zoom": "~5.1.0", diff --git a/src/app.css b/src/app.css index f2443d98..01e0a0dc 100644 --- a/src/app.css +++ b/src/app.css @@ -295,7 +295,7 @@ a[href^='http'][rel*='nofollow']:visited:not(:has(div)) { video, img, audio { - min-height: var(--pointer-min-dimension); /* for extreme dimensions */ + min-height: var(--min-dimension); /* for extreme dimensions */ } } } diff --git a/src/app.jsx b/src/app.jsx index c9b7c36a..1b18093f 100644 --- a/src/app.jsx +++ b/src/app.jsx @@ -1,7 +1,6 @@ import './app.css'; import debounce from 'just-debounce-it'; -import { lazy, Suspense } from 'preact/compat'; import { useEffect, useLayoutEffect, @@ -18,14 +17,14 @@ import ComposeButton from './components/compose-button'; import { ICONS } from './components/ICONS'; import KeyboardShortcutsHelp from './components/keyboard-shortcuts-help'; import Loader from './components/loader'; -// import Modals from './components/modals'; +import Modals from './components/modals'; import NotificationService from './components/notification-service'; import SearchCommand from './components/search-command'; import Shortcuts from './components/shortcuts'; import NotFound from './pages/404'; import AccountStatuses from './pages/account-statuses'; import Bookmarks from './pages/bookmarks'; -// import Catchup from './pages/catchup'; +import Catchup from './pages/catchup'; import Favourites from './pages/favourites'; import Filters from './pages/filters'; import FollowedHashtags from './pages/followed-hashtags'; @@ -57,9 +56,6 @@ import store from './utils/store'; import { getCurrentAccount } from './utils/store-utils'; import './utils/toast-alert'; -const Catchup = lazy(() => import('./pages/catchup')); -const Modals = lazy(() => import('./components/modals')); - window.__STATES__ = states; window.__STATES_STATS__ = () => { const keys = [ @@ -387,9 +383,7 @@ function App() { )} {isLoggedIn && } {isLoggedIn && } - - - + {isLoggedIn && } {uiState !== 'loading' && } @@ -466,14 +460,7 @@ function SecondaryRoutes({ isLoggedIn }) { } /> } /> - - - - } - /> + } /> )} } /> diff --git a/src/assets/powered-by-giphy.svg b/src/assets/powered-by-giphy.svg new file mode 100644 index 00000000..b7b77c54 --- /dev/null +++ b/src/assets/powered-by-giphy.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/ICONS.jsx b/src/components/ICONS.jsx index dfbb164c..4ab8b8d3 100644 --- a/src/components/ICONS.jsx +++ b/src/components/ICONS.jsx @@ -107,4 +107,5 @@ export const ICONS = { quote: () => import('@iconify-icons/mingcute/quote-left-line'), settings: () => import('@iconify-icons/mingcute/settings-6-line'), 'heart-break': () => import('@iconify-icons/mingcute/heart-crack-line'), + 'user-x': () => import('@iconify-icons/mingcute/user-x-line'), }; diff --git a/src/components/account-info.jsx b/src/components/account-info.jsx index 198a5a1b..fd911f41 100644 --- a/src/components/account-info.jsx +++ b/src/components/account-info.jsx @@ -1,6 +1,6 @@ import './account-info.css'; -import { Menu, MenuDivider, MenuItem, SubMenu } from '@szhsin/react-menu'; +import { MenuDivider, MenuItem } from '@szhsin/react-menu'; import { useCallback, useEffect, @@ -9,6 +9,7 @@ import { useRef, useState, } from 'preact/hooks'; +import punycode from 'punycode'; import { api } from '../utils/api'; import enhanceContent from '../utils/enhance-content'; @@ -32,7 +33,9 @@ import ListAddEdit from './list-add-edit'; import Loader from './loader'; import Menu2 from './menu2'; import MenuConfirm from './menu-confirm'; +import MenuLink from './menu-link'; import Modal from './modal'; +import SubMenu2 from './submenu2'; import TranslationBlock from './translation-block'; const MUTE_DURATIONS = [ @@ -228,7 +231,7 @@ function AccountInfo({ const accountInstance = useMemo(() => { if (!url) return null; - const domain = new URL(url).hostname; + const domain = punycode.toUnicode(new URL(url).hostname); return domain; }, [url]); @@ -581,6 +584,15 @@ function AccountInfo({ Go to original profile page + + + + View profile image + + + + View profile header + ) : ( { states.showGenericAccounts = { + id: 'followers', heading: 'Followers', fetchAccounts: fetchFollowers, instance, @@ -809,38 +822,40 @@ function AccountInfo({ )} - - + )}