Skip to content

Commit

Permalink
fix: change source side panel lp#2058340
Browse files Browse the repository at this point in the history
- wrap application layout overrides in l-application for higher specificity
  • Loading branch information
petermakowski committed Mar 26, 2024
1 parent bb3080b commit 11722a0
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const FetchImagesFormFields = (): JSX.Element => {

return (
<Row>
<Col size={6}>
<Col size={12}>
<ul className="p-inline-list">
<li className="p-inline-list__item u-display--inline-block">
<FormikField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useDispatch, useSelector } from "react-redux";
import * as Yup from "yup";

import FormikForm from "@/app/base/components/FormikForm";
import { useSidePanel } from "@/app/base/side-panel-context";
import UbuntuImageSelect from "@/app/images/components/UbuntuImageSelect";
import type { ImageValue } from "@/app/images/types";
import { bootResourceActions } from "@/app/store/bootresource";
Expand Down Expand Up @@ -60,6 +61,14 @@ const FetchedImages = ({ closeForm, source }: Props): JSX.Element | null => {
const cleanup = useCallback(() => bootResourceActions.cleanup(), []);
const saved = previousSaving && !saving && !error;

const { setSidePanelSize } = useSidePanel();
useEffect(() => {
setSidePanelSize("large");
return () => {
setSidePanelSize("regular");
};
}, [setSidePanelSize]);

useEffect(() => {
return () => {
dispatch(bootResourceActions.clearFetchedImages());
Expand All @@ -83,9 +92,9 @@ const FetchedImages = ({ closeForm, source }: Props): JSX.Element | null => {

return (
<>
<h4>
<p>
Showing images fetched from <strong>{source.url || "maas.io"}</strong>
</h4>
</p>
<hr />
<FormikForm<FetchedImagesValues>
allowUnchanged
Expand Down
84 changes: 43 additions & 41 deletions src/scss/_patterns_application.scss
Original file line number Diff line number Diff line change
@@ -1,50 +1,52 @@
@mixin maas-application {
.l-main {
display: flex;
flex-direction: column;
overflow: hidden;
@media (min-width: $breakpoint-small) {
flex-direction: row;
}
.l-main__nav {
flex-shrink: 0;
overflow-y: auto;
height: 30%;
scrollbar-gutter: stable;

.l-application {
.l-main {
display: flex;
flex-direction: column;
overflow: hidden;
@media (min-width: $breakpoint-small) {
height: calc(100vh - 2.5rem);
flex-direction: row;
}
.l-main__nav {
flex-shrink: 0;
overflow-y: auto;
height: 30%;
scrollbar-gutter: stable;

@media (min-width: $breakpoint-small) {
height: calc(100vh - 2.5rem);
}
}
.l-main__content {
width: 100%;
overflow-y: auto;
}
}
.l-main__content {
width: 100%;
overflow-y: auto;
.l-aside {
z-index: $side-panel-z-index;
background-color: $color-x-light;
}
}
.l-aside {
z-index: $side-panel-z-index;
background-color: $color-x-light;
}
// override to allow for large width aside
.l-aside {
// add width transition for transition between aside sizes
@include vf-transition(
$property: #{transform,
box-shadow,
visibility, width},
$duration: snap
);
@media (min-width: $breakpoint-x-small) {
&.is-large {
width: 67rem;
// override to allow for large width aside
.l-aside {
// add width transition for transition between aside sizes
@include vf-transition(
$property: #{transform,
box-shadow,
visibility, width},
$duration: snap
);
@media (min-width: $breakpoint-x-small) {
&.is-large {
width: 67rem;
}
}
}
}
.l-navigation-bar.is-pinned {
width: 100%;
display: block;
visibility: visible;
grid-area: navbar;
height: 3.5rem;
.l-navigation-bar.is-pinned {
width: 100%;
display: block;
visibility: visible;
grid-area: navbar;
height: 3.5rem;
}
}
}

0 comments on commit 11722a0

Please sign in to comment.