Skip to content

Commit

Permalink
fix modal navigation bug (#4803)
Browse files Browse the repository at this point in the history
  • Loading branch information
sashankaryal authored Sep 16, 2024
1 parent 71e926a commit f8a900f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 20 deletions.
3 changes: 3 additions & 0 deletions app/packages/core/src/components/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { ModalActionsRow } from "../Actions";
import Sidebar from "../Sidebar";
import { useLookerHelpers } from "./hooks";
import { modalContext } from "./modal-context";
import ModalNavigation from "./ModalNavigation";
import { ModalSpace } from "./ModalSpace";
import { TooltipInfo } from "./TooltipInfo";
import { useModalSidebarRenderEntry } from "./use-sidebar-render-entry";
Expand Down Expand Up @@ -163,6 +164,8 @@ const Modal = () => {

const isFullScreen = useRecoilValue(fos.fullscreen);

const { onNavigate } = useLookerHelpers();

const screenParams = useMemo(() => {
return isFullScreen
? { width: "100%", height: "100%" }
Expand Down
2 changes: 1 addition & 1 deletion app/packages/core/src/components/Modal/ModalNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const Arrow = styled.span<{
left: ${(props) => (props.$isRight ? "initial" : "0.75rem")};
z-index: 99999;
padding: 0.75rem;
bottom: 50%;
bottom: 33vh;
width: 3rem;
height: 3rem;
background-color: var(--fo-palette-background-button);
Expand Down
20 changes: 1 addition & 19 deletions app/packages/core/src/components/Modal/ModalSamplePlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import React, { Suspense, useEffect } from "react";
import { useRecoilCallback, useRecoilValue, useSetRecoilState } from "recoil";
import styled from "styled-components";
import Group from "./Group";
import { useLookerHelpers, useModalContext } from "./hooks";
import { useModalContext } from "./hooks";
import { Sample2D } from "./Sample2D";
import { Sample3d } from "./Sample3d";
import ModalNavigation from "./ModalNavigation";

const ContentColumn = styled.div`
display: flex;
Expand All @@ -28,10 +27,6 @@ export const ModalSample = React.memo(() => {
const setIsTooltipLocked = useSetRecoilState(fos.isTooltipLocked);
const setTooltipDetail = useSetRecoilState(fos.tooltipDetail);

const sidebarwidth = useRecoilValue(fos.sidebarWidth(true));
const isSidebarVisible = useRecoilValue(fos.sidebarVisible(true));
const { onNavigate } = useLookerHelpers();

const tooltipEventHandler = useRecoilCallback(
({ snapshot, set }) =>
(e) => {
Expand Down Expand Up @@ -77,9 +72,6 @@ export const ModalSample = React.memo(() => {

return (
<ContentColumn>
<ModalNavigationContainer>
<ModalNavigation onNavigate={onNavigate} />
</ModalNavigationContainer>
<ErrorBoundary onReset={() => {}}>
<Suspense>
{isGroup ? <Group /> : is3D ? <Sample3d /> : <Sample2D />}
Expand All @@ -88,13 +80,3 @@ export const ModalSample = React.memo(() => {
</ContentColumn>
);
});

const ModalNavigationContainer = styled.div`
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
height: 100%;
position: absolute;
left: 0;
`;

0 comments on commit f8a900f

Please sign in to comment.