diff --git a/src/app.css b/src/app.css index 4066f341..3cdd82e4 100644 --- a/src/app.css +++ b/src/app.css @@ -24,9 +24,9 @@ a.mention span { text-decoration-line: underline; text-decoration-color: inherit; } -a.mention:has(span).hashtag { +/* a.mention:has(span).hashtag { color: var(--link-light-color); -} +} */ a.mention span { color: var(--text-color); } diff --git a/src/components/account.jsx b/src/components/account.jsx index 199846bd..b5310217 100644 --- a/src/components/account.jsx +++ b/src/components/account.jsx @@ -9,7 +9,7 @@ import store from '../utils/store'; import Avatar from './avatar'; import NameText from './name-text'; -export default ({ account }) => { +function Account({ account }) { const [uiState, setUIState] = useState('default'); const isString = typeof account === 'string'; const [info, setInfo] = useState(isString ? null : account); @@ -181,4 +181,6 @@ export default ({ account }) => { )} ); -}; +} + +export default Account; diff --git a/src/components/avatar.jsx b/src/components/avatar.jsx index 1f6d98b8..3059b1e2 100644 --- a/src/components/avatar.jsx +++ b/src/components/avatar.jsx @@ -8,7 +8,7 @@ const SIZES = { xxl: 50, }; -export default ({ url, size, alt = '' }) => { +function Avatar({ url, size, alt = '' }) { size = SIZES[size] || size || SIZES.m; return ( { )} ); -}; +} + +export default Avatar; diff --git a/src/components/icon.jsx b/src/components/icon.jsx index 2fec0714..b16af646 100644 --- a/src/components/icon.jsx +++ b/src/components/icon.jsx @@ -43,7 +43,7 @@ const ICONS = { plus: 'mingcute:add-circle-line', }; -export default ({ icon, size = 'm', alt, title, class: className = '' }) => { +function Icon({ icon, size = 'm', alt, title, class: className = '' }) { if (!icon) return null; const iconSize = SIZES[size]; @@ -74,4 +74,6 @@ export default ({ icon, size = 'm', alt, title, class: className = '' }) => { ); -}; +} + +export default Icon; diff --git a/src/components/loader.jsx b/src/components/loader.jsx index 84dcf683..9ef93583 100644 --- a/src/components/loader.jsx +++ b/src/components/loader.jsx @@ -1,11 +1,15 @@ import './loader.css'; -export default ({ abrupt, hidden }) => ( - ); -}; +} + +export default Settings; diff --git a/src/pages/status.jsx b/src/pages/status.jsx index 1f2b8d7f..8b27f7b6 100644 --- a/src/pages/status.jsx +++ b/src/pages/status.jsx @@ -14,7 +14,7 @@ import Status from '../components/status'; import states from '../utils/states'; import useTitle from '../utils/useTitle'; -export default ({ id }) => { +function StatusPage({ id }) { const snapStates = useSnapshot(states); const [statuses, setStatuses] = useState([{ id }]); const [uiState, setUIState] = useState('default'); @@ -215,4 +215,6 @@ export default ({ id }) => { ); -}; +} + +export default StatusPage; diff --git a/src/pages/welcome.jsx b/src/pages/welcome.jsx index 27657f28..f9940a98 100644 --- a/src/pages/welcome.jsx +++ b/src/pages/welcome.jsx @@ -3,7 +3,7 @@ import './welcome.css'; import logo from '../assets/logo.svg'; import useTitle from '../utils/useTitle'; -export default () => { +function Welcome() { useTitle(); return (
@@ -44,4 +44,6 @@ export default () => {

); -}; +} + +export default Welcome; diff --git a/src/utils/enhance-content.js b/src/utils/enhance-content.js index 1034cfc5..783bcffe 100644 --- a/src/utils/enhance-content.js +++ b/src/utils/enhance-content.js @@ -2,7 +2,7 @@ import emojifyText from './emojify-text'; const fauxDiv = document.createElement('div'); -export default (content, opts = {}) => { +function enhanceContent(content, opts = {}) { const { emojis, postEnhanceDOM = () => {} } = opts; let enhancedContent = content; const dom = document.createElement('div'); @@ -64,7 +64,7 @@ export default (content, opts = {}) => { enhancedContent = dom.innerHTML; return enhancedContent; -}; +} function extractTextNodes(dom) { const textNodes = []; @@ -80,3 +80,5 @@ function extractTextNodes(dom) { } return textNodes; } + +export default enhanceContent; diff --git a/src/utils/html-content-length.js b/src/utils/html-content-length.js index 039edef2..d01cb130 100644 --- a/src/utils/html-content-length.js +++ b/src/utils/html-content-length.js @@ -1,5 +1,5 @@ const div = document.createElement('div'); -export default (html) => { +export default function htmlContentLength(html) { div.innerHTML = html; return div.innerText.length; -}; +} diff --git a/src/utils/open-compose.js b/src/utils/open-compose.js index daa026af..48579c4e 100644 --- a/src/utils/open-compose.js +++ b/src/utils/open-compose.js @@ -1,4 +1,4 @@ -export default (opts) => { +export default function openCompose(opts) { const url = new URL('/compose/', window.location); const { width: screenWidth, height: screenHeight } = window.screen; const left = Math.max(0, (screenWidth - 600) / 2); @@ -20,4 +20,4 @@ export default (opts) => { } return newWin; -}; +} diff --git a/src/utils/useTitle.js b/src/utils/useTitle.js index 70e297cf..e0f61ece 100644 --- a/src/utils/useTitle.js +++ b/src/utils/useTitle.js @@ -2,8 +2,8 @@ import { useEffect } from 'preact/hooks'; const { VITE_CLIENT_NAME: CLIENT_NAME } = import.meta.env; -export default (title) => { +export default function useTitle(title) { useEffect(() => { document.title = title ? `${title} / ${CLIENT_NAME}` : CLIENT_NAME; }, [title]); -}; +}