Skip to content

Commit

Permalink
fix: update overlay styles when switching address (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
patricio0312rev authored and ItsANameToo committed Oct 12, 2023
1 parent 7364495 commit 742d767
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
18 changes: 11 additions & 7 deletions resources/js/Components/Layout/LayoutWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ interface LayoutWrapperProperties extends HTMLAttributes<HTMLDivElement> {
isMaintenanceModeActive?: boolean;
belowHeader?: React.ReactNode;
mustBeSigned?: boolean;
displayAuthOverlay?: boolean;
showBackButton?: boolean;
}

Expand All @@ -27,6 +28,7 @@ export const LayoutWrapper = ({
toastMessage,
isMaintenanceModeActive,
mustBeSigned = false,
displayAuthOverlay = true,
showBackButton = false,
}: LayoutWrapperProperties): JSX.Element => {
const { authenticated, showAuthOverlay, wallet, user, showCloseButton, closeOverlay } = useAuth({
Expand All @@ -52,13 +54,15 @@ export const LayoutWrapper = ({
/>
</header>

<AuthOverlay
show={showAuthOverlay}
showCloseButton={showCloseButton}
mustBeSigned={mustBeSigned}
closeOverlay={closeOverlay}
showBackButton={showBackButton}
/>
{displayAuthOverlay && (
<AuthOverlay
show={showAuthOverlay}
showCloseButton={showCloseButton}
mustBeSigned={mustBeSigned}
closeOverlay={closeOverlay}
showBackButton={showBackButton}
/>
)}

{belowHeader}

Expand Down
3 changes: 3 additions & 0 deletions resources/js/Pages/Galleries/MyGalleries/Create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { GalleryNfts } from "@/Components/Galleries/Hooks/useGalleryNftsContext"
import { NftGridEditable } from "@/Components/Galleries/NftGridEditable";
import { LayoutWrapper } from "@/Components/Layout/LayoutWrapper";
import { NoNftsOverlay } from "@/Components/Layout/NoNftsOverlay";
import { useMetaMaskContext } from "@/Contexts/MetaMaskContext";
import { useAuthorizedAction } from "@/Hooks/useAuthorizedAction";
import { GalleryNameInput } from "@/Pages/Galleries/Components/GalleryNameInput";
import { useGalleryForm } from "@/Pages/Galleries/hooks/useGalleryForm";
Expand Down Expand Up @@ -46,6 +47,7 @@ const Create = ({
const { props } = usePage();

const { signedAction } = useAuthorizedAction();
const { initialized } = useMetaMaskContext();

const [isGalleryFormSliderOpen, setIsGalleryFormSliderOpen] = useState(false);
const [gallerySliderActiveTab, setGallerySliderActiveTab] = useState<GalleryFormSliderTabs>();
Expand Down Expand Up @@ -103,6 +105,7 @@ const Create = ({
withSlider
toastMessage={props.toast}
belowHeader={<NoNftsOverlay show={paginatedNfts.length === 0} />}
displayAuthOverlay={paginatedNfts.length > 0 && initialized}
>
<Head title={title} />

Expand Down

0 comments on commit 742d767

Please sign in to comment.