Skip to content

Commit

Permalink
Merge pull request #1053 from PintoGideon/Redesigning-Pacs-Q/R
Browse files Browse the repository at this point in the history
Fix the sidebar bug in the niivue page
  • Loading branch information
PintoGideon authored Feb 7, 2024
2 parents baa13f9 + dc34c68 commit 93479a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/VisualDatasets/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const VisualDatasets: React.FunctionComponent = () => {
// --------------------------------------------------------------------------------

// when the web app is ready, hide the sidebar and set the page title.
React.useEffect(() => {
useEffect(() => {
document.title = "Fetal MRI Viewer";
dispatch(setIsNavOpen(false));
dispatch(
Expand Down
8 changes: 6 additions & 2 deletions src/components/Wrapper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import "./wrapper.css";
interface IOtherProps {
children: any;
user: IUserState;
niivueActive: boolean;
}
interface IPropsFromDispatch {
onSidebarToggle: typeof onSidebarToggle;
Expand All @@ -22,7 +23,7 @@ interface IPropsFromDispatch {
type AllProps = IUiState & IOtherProps & IPropsFromDispatch;

const Wrapper: React.FC<AllProps> = (props: AllProps) => {
const { children, user }: IOtherProps = props;
const { children, user, niivueActive }: IOtherProps = props;
const onNavToggle = () => {
props.setIsNavOpen(!props.isNavOpen);
};
Expand All @@ -34,7 +35,9 @@ const Wrapper: React.FC<AllProps> = (props: AllProps) => {
if (data.mobileView) {
props.setIsNavOpen(false);
}
if (!data.mobileView) {

// The default setting of the niivue viewer is without a sidebar active. It explicitly set's it to false in it's component.
if (!data.mobileView && !niivueActive) {
props.setIsNavOpen(true);
}
};
Expand Down Expand Up @@ -66,6 +69,7 @@ const mapDispatchToProps = (dispatch: Dispatch) => ({
const mapStateToProps = ({ ui, user }: ApplicationState) => ({
isNavOpen: ui.isNavOpen,
loading: ui.loading,
niivueActive: ui.sidebarActiveItem === "niivue",
user,
});

Expand Down

0 comments on commit 93479a4

Please sign in to comment.