Skip to content

Commit

Permalink
Merge pull request AOT-Technologies#2444 from fahad-aot/bugfix/fwf-40…
Browse files Browse the repository at this point in the history
…35-sidebar-fix-in-preview

bugfix/fwf-4035-Hid sidebar in preview page
  • Loading branch information
arun-s-aot authored Dec 20, 2024
2 parents d5fb8a6 + 7abe417 commit d2baaab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 10 additions & 2 deletions forms-flow-web/src/components/App.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import React,{useState, useEffect} from "react";
import PropTypes from "prop-types";
import { Provider } from "react-redux";
import { ConnectedRouter } from "connected-react-router";
Expand All @@ -12,10 +12,18 @@ import {
QueryClientProvider,
} from 'react-query';
const queryClient = new QueryClient();
import { HelperServices } from '@formsflow/service';

const App = React.memo((props) => {
const { store, history, publish, subscribe, getKcInstance } = props;
const [isPreviewRoute,setIsPreviewRoute] = useState(false);
useEffect(()=> {
const location = window.location.pathname;
const viewOnlyRoutes = new Set (["view-edit"]);
setIsPreviewRoute(() => HelperServices.isViewOnlyRoute(location,viewOnlyRoutes));
},[]);
return (
<div className="main-container">
<div className={`main-container ${isPreviewRoute && 'm-0'}`}>
<Helmet>
{KEYCLOAK_URL ? <link rel="preconnect" href={KEYCLOAK_URL} /> : null}
</Helmet>
Expand Down
2 changes: 2 additions & 0 deletions forms-flow-web/src/components/Form/EditForm/FormEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,7 @@ const EditComponent = () => {
)}
</div>
</Card.Header>
<div className="form-edit">
<Card.Body>
<div className="form-builder custom-scroll">
{!createDesigns ? (
Expand Down Expand Up @@ -1119,6 +1120,7 @@ const EditComponent = () => {
)}
</div>
</Card.Body>
</div>
</Card>
</div>
<div
Expand Down

0 comments on commit d2baaab

Please sign in to comment.