Skip to content

Commit

Permalink
added set for future use & added helper fn in MF
Browse files Browse the repository at this point in the history
  • Loading branch information
fahad-aot committed Dec 19, 2024
1 parent 87185f9 commit 7abe417
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 5 additions & 4 deletions forms-flow-web/src/components/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +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;
if(location.includes("view-edit")){
setIsPreviewRoute(true);
}
const viewOnlyRoutes = new Set (["view-edit"]);
setIsPreviewRoute(() => HelperServices.isViewOnlyRoute(location,viewOnlyRoutes));
},[]);
return (
<div className={`main-container ${isPreviewRoute ? 'm-0' : ''}`}>
<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 7abe417

Please sign in to comment.