Skip to content

Commit b85ee71

Browse files
committed
fix overflow behaviour
1 parent 7441b43 commit b85ee71

File tree

9 files changed

+30
-6
lines changed

9 files changed

+30
-6
lines changed

apps/react-starter/src/App.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ function App() {
3939
<IxApplicationHeader name="Siemens Industrial Experience">
4040
<Logo />
4141
<IxAvatar username="Your user" extra="Administrator">
42-
<IxDropdownItem icon={iconUserSettings} label="User Settings" onClick={showDemoMessage} />
42+
<IxDropdownItem
43+
icon={iconUserSettings}
44+
label={t("settings.user-settings")}
45+
onClick={showDemoMessage}
46+
/>
4347
<IxDropdownItem icon={iconLogOut} label="Logout" onClick={showDemoMessage} />
4448
</IxAvatar>
4549
</IxApplicationHeader>

apps/react-starter/src/hooks/mediaQuery.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ export function useMediaQuery(query: string) {
2525
}, [query]);
2626
return matches;
2727
}
28+
29+
export const useIsMobileViewPort = () => useMediaQuery("(max-width: 48em)");

apps/react-starter/src/pages/devices/components/modal/add-device-modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export default function AddDeviceModal() {
122122
</form>
123123
</IxModalContent>
124124

125-
<IxModalFooter>
125+
<IxModalFooter className={styles.ModalFooter}>
126126
<IxButton aria-label={t("device-add-modal.dismiss")} outline onClick={() => dismiss()}>
127127
{t("device-add-modal.dismiss")}
128128
</IxButton>

apps/react-starter/src/pages/devices/components/modal/styles.module.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,7 @@
1616
.ItemFullWidth {
1717
grid-column: 1 / 3;
1818
}
19+
20+
.ModalFooter {
21+
margin-top: 1rem;
22+
}

apps/react-starter/src/pages/overview/components/device-range/styles.module.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
.DeviceRange {
1111
height: 21rem;
12+
min-height: 21rem;
13+
max-height: 21rem;
1214
}
1315

1416
.echarts {

apps/react-starter/src/pages/overview/components/incidents/overview/incident-list/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* LICENSE file in the root directory of this source tree.
88
*/
99
import useShowDemoMessage from "@/hooks/demoMessage";
10-
import { useMediaQuery } from "@/hooks/mediaQuery";
10+
import { useIsMobileViewPort } from "@/hooks/mediaQuery";
1111
import { iconOpenExternal, iconUpload } from "@siemens/ix-icons/icons";
1212
import {
1313
IxButton,
@@ -20,9 +20,9 @@ import {
2020
IxRow,
2121
IxTypography,
2222
} from "@siemens/ix-react";
23+
import { useTranslation } from "react-i18next";
2324
import { type Incident } from "../incident";
2425
import styles from "./styles.module.css";
25-
import { useTranslation } from "react-i18next";
2626

2727
function DesktopItem({ incident }: { incident: Incident }) {
2828
const { t } = useTranslation();
@@ -95,7 +95,7 @@ function MobileItem({ incident }: { incident: Incident }) {
9595
}
9696

9797
function IncidentList(props: { incidents: Incident[]; search: string }) {
98-
const isMobile = useMediaQuery("(max-width: 48em)");
98+
const isMobile = useIsMobileViewPort();
9999
const searchFilter = (incident: Incident) => {
100100
if (!props.search) {
101101
return true;

apps/react-starter/src/pages/overview/components/status-history/styles.module.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
.StatusHistory {
1111
height: 21rem;
12+
min-height: 21rem;
13+
max-height: 21rem;
1214
}
1315

1416
.echarts {

apps/react-starter/src/pages/overview/index.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,21 @@ import { useTranslation } from "react-i18next";
1212
import Incidents from "./components/incidents/overview";
1313
import Overview from "./components/overview";
1414
import styles from "./styles.module.css";
15+
import { useIsMobileViewPort } from "@/hooks/mediaQuery";
16+
import clsx from "clsx";
1517

1618
const OverviewPage = () => {
1719
const { t } = useTranslation();
20+
const isMobile = useIsMobileViewPort();
1821

1922
return (
2023
<>
2124
<IxContentHeader headerTitle={t("content-header")} slot="header"></IxContentHeader>
22-
<section className={styles.List}>
25+
<section
26+
className={clsx(styles.List, {
27+
[styles["h-100"]]: !isMobile,
28+
})}
29+
>
2330
<Overview></Overview>
2431
<Incidents></Incidents>
2532
</section>

apps/react-starter/src/pages/overview/styles.module.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,8 @@
1616
flex-direction: column;
1717
gap: 2rem;
1818
overflow: hidden;
19+
}
20+
21+
.List.h-100 {
1922
height: 100%;
2023
}

0 commit comments

Comments
 (0)