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 }) => (
-
-);
+function Loader({ abrupt, hidden }) {
+ return (
+
+ );
+}
+
+export default Loader;
diff --git a/src/components/modal.jsx b/src/components/modal.jsx
index ded48c03..327cd404 100644
--- a/src/components/modal.jsx
+++ b/src/components/modal.jsx
@@ -4,7 +4,7 @@ import { createPortal } from 'preact/compat';
const $modalContainer = document.getElementById('modal-container');
-export default ({ children, onClick, class: className }) => {
+function Modal({ children, onClick, class: className }) {
if (!children) return null;
const Modal = (
@@ -16,4 +16,6 @@ export default ({ children, onClick, class: className }) => {
return createPortal(Modal, $modalContainer);
// return createPortal(children, $modalContainer);
-};
+}
+
+export default Modal;
diff --git a/src/components/name-text.jsx b/src/components/name-text.jsx
index 7891e96d..2fc62b3e 100644
--- a/src/components/name-text.jsx
+++ b/src/components/name-text.jsx
@@ -5,7 +5,7 @@ import states from '../utils/states';
import Avatar from './avatar';
-export default ({ account, showAvatar, showAcct, short, external }) => {
+function NameText({ account, showAvatar, showAcct, short, external }) {
const { acct, avatar, avatarStatic, id, url, displayName, username, emojis } =
account;
@@ -55,4 +55,6 @@ export default ({ account, showAvatar, showAcct, short, external }) => {
)}
);
-};
+}
+
+export default NameText;
diff --git a/src/pages/home.jsx b/src/pages/home.jsx
index 56b382cb..06278693 100644
--- a/src/pages/home.jsx
+++ b/src/pages/home.jsx
@@ -11,7 +11,7 @@ import store from '../utils/store';
const LIMIT = 20;
-export default ({ hidden }) => {
+function Home({ hidden }) {
const snapStates = useSnapshot(states);
const [uiState, setUIState] = useState('default');
const [showMore, setShowMore] = useState(false);
@@ -215,4 +215,6 @@ export default ({ hidden }) => {
);
-};
+}
+
+export default Home;
diff --git a/src/pages/login.jsx b/src/pages/login.jsx
index ef703c27..39975136 100644
--- a/src/pages/login.jsx
+++ b/src/pages/login.jsx
@@ -6,7 +6,7 @@ import { getAuthorizationURL, registerApplication } from '../utils/auth';
import store from '../utils/store';
import useTitle from '../utils/useTitle';
-export default () => {
+function Login() {
useTitle('Log in');
const instanceURLRef = useRef();
const cachedInstanceURL = store.local.get('instanceURL');
@@ -96,4 +96,6 @@ export default () => {
);
-};
+}
+
+export default Login;
diff --git a/src/pages/notifications.jsx b/src/pages/notifications.jsx
index 4a4c4720..b82cf2c5 100644
--- a/src/pages/notifications.jsx
+++ b/src/pages/notifications.jsx
@@ -187,7 +187,7 @@ function NotificationsList({ notifications, emptyCopy }) {
);
}
-export default () => {
+function Notifications() {
useTitle('Notifications');
const snapStates = useSnapshot(states);
const [uiState, setUIState] = useState('default');
@@ -271,7 +271,6 @@ export default () => {
{ today: [], yesterday: [], older: [] },
);
// console.log(groupedNotifications);
-
return (
@@ -371,4 +370,6 @@ export default () => {
);
-};
+}
+
+export default Notifications;
diff --git a/src/pages/settings.jsx b/src/pages/settings.jsx
index 0875c474..925d6a25 100644
--- a/src/pages/settings.jsx
+++ b/src/pages/settings.jsx
@@ -13,7 +13,7 @@ import store from '../utils/store';
- Dark/light/auto theme switch (done with adding/removing 'is-light' or 'is-dark' class on the body)
*/
-export default ({ onClose }) => {
+function Settings({ onClose }) {
// Accounts
const accounts = store.local.getJSON('accounts');
const currentAccount = store.session.get('currentAccount');
@@ -206,4 +206,6 @@ export default ({ onClose }) => {
)}
);
-};
+}
+
+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]);
-};
+}