refactor settingsmodal to render it globally

This commit is contained in:
Tom (plebeius.eth)
2025-03-05 12:06:27 +01:00
parent 37e325c3d2
commit b686ca3dd0
5 changed files with 9 additions and 21 deletions
+5
View File
@@ -22,6 +22,7 @@ import ReplyModal from './components/reply-modal';
import PostForm from './components/post-form';
import SubplebbitStats from './components/subplebbit-stats';
import TopBar from './components/topbar';
import SettingsModal from './components/settings-modal';
const BoardLayout = () => {
const { accountCommentIndex, subplebbitAddress } = useParams();
@@ -91,6 +92,9 @@ const GlobalLayout = () => {
const { activeCid, threadCid, subplebbitAddress, closeModal, showReplyModal, scrollY } = useReplyModalStore();
const location = useLocation();
const isInSettingsView = location.pathname.endsWith('/settings');
return (
<>
<ChallengeModal />
@@ -104,6 +108,7 @@ const GlobalLayout = () => {
subplebbitAddress={subplebbitAddress}
/>
)}
{isInSettingsView && <SettingsModal />}
<Outlet />
</>
);