refactor: clean up imports and move inline component definitions after imports

This commit is contained in:
plebeius
2026-01-03 16:17:48 +01:00
parent a7614db743
commit 9fe31c873b
2 changed files with 7 additions and 8 deletions
+7 -7
View File
@@ -14,6 +14,13 @@ import { useResolvedSubplebbitAddress } from '../../hooks/use-resolved-subplebbi
import useFetchGifFirstFrame from '../../hooks/use-fetch-gif-first-frame';
import useIsSubplebbitOffline from '../../hooks/use-is-subplebbit-offline';
import usePublishPost from '../../hooks/use-publish-post';
import usePublishReply from '../../hooks/use-publish-reply';
import FileUploader from '../../plugins/file-uploader';
import styles from './post-form.module.css';
import { Capacitor } from '@capacitor/core';
import _ from 'lodash';
const isAndroid = Capacitor.getPlatform() === 'android';
// Separate component for offline alert to isolate rerenders from updatingState
// Only this component will rerender when updatingState changes, not the whole PostForm
@@ -27,13 +34,6 @@ const OfflineAlert = ({ subplebbitAddress }: { subplebbitAddress: string | undef
return <div className={styles.offlineBoard}>{offlineTitle}</div>;
};
import usePublishReply from '../../hooks/use-publish-reply';
import FileUploader from '../../plugins/file-uploader';
import styles from './post-form.module.css';
import { Capacitor } from '@capacitor/core';
import _ from 'lodash';
const isAndroid = Capacitor.getPlatform() === 'android';
export const LinkTypePreviewer = ({ link }: { link: string }) => {
const { t } = useTranslation();
-1
View File
@@ -1,7 +1,6 @@
import { useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import { Comment, Role, useComment, useEditedComment, useSubplebbit } from '@plebbit/plebbit-react-hooks';
import useSubplebbitsStore from '@plebbit/plebbit-react-hooks/dist/stores/subplebbits';
import { useSubplebbitField } from '../../hooks/use-stable-subplebbit';
import { useLocation, useNavigate, useParams } from 'react-router-dom';
import { isAllView } from '../../lib/utils/view-utils';