Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions components/brain/BrainMobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,23 @@
}, [pathname, searchParams, waveId, isApp]);

// Handle tab visibility and reset on wave changes
useEffect(() => {

Check failure on line 164 in components/brain/BrainMobile.tsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Refactor this function to reduce its Cognitive Complexity from 19 to the 15 allowed.

See more on https://sonarcloud.io/project/issues?id=6529-Collections_6529seize-frontend&issues=AZrzov4cJwJDfqohvqlV&open=AZrzov4cJwJDfqohvqlV&pullRequest=1636
if (!hasWave) {
if (
activeView !== BrainView.DEFAULT &&
activeView !== BrainView.WAVES &&
activeView !== BrainView.MESSAGES &&
activeView !== BrainView.NOTIFICATIONS
)
setActiveView(BrainView.DEFAULT);
) {
// Reset to appropriate view based on current route
if (pathname === "/waves") {
setActiveView(BrainView.WAVES);
} else if (pathname === "/messages") {
setActiveView(BrainView.MESSAGES);
} else {
setActiveView(BrainView.DEFAULT);
}
}
return;
}

Expand Down
9 changes: 6 additions & 3 deletions components/voting/VotingModal.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ExtendedDrop } from "@/helpers/waves/drop.helpers";
Comment thread
ragnep marked this conversation as resolved.
import React from "react";
import { createPortal } from "react-dom";
import SecondaryButton from "../utils/button/SecondaryButton";
import { SingleWaveDropVote } from "../waves/drop/SingleWaveDropVote";
import ModalLayout from "../waves/memes/submission/layout/ModalLayout";
Expand All @@ -19,9 +20,9 @@ const VotingModal: React.FC<VotingModalProps> = ({
return null;
}

return (
const modalContent = (
<div
className="tw-fixed tw-inset-0 tw-bg-gray-600 tw-bg-opacity-50 tw-backdrop-blur-[1px] tw-z-50 tw-flex tw-items-center tw-justify-center"
className="tw-fixed tw-inset-0 tw-bg-gray-600 tw-bg-opacity-50 tw-backdrop-blur-[1px] tw-z-[1000] tw-flex tw-items-center tw-justify-center"
onClick={(e) => e.stopPropagation()}
>
<div
Expand All @@ -31,7 +32,7 @@ const VotingModal: React.FC<VotingModalProps> = ({
></div>

<div
className="tw-w-full tw-max-w-2xl tw-z-10"
className="tw-w-full tw-max-w-2xl tw-z-10 tw-px-4"
onClick={(e) => e.stopPropagation()}
>
<ModalLayout title="Vote for this artwork" onCancel={onClose}>
Expand All @@ -46,6 +47,8 @@ const VotingModal: React.FC<VotingModalProps> = ({
</div>
</div>
);

return createPortal(modalContent, document.body);
};

export default VotingModal;