consolidated ismobile

This commit is contained in:
ari committed 2022-07-29 15:16:47 -04:00
1 parent f99cb84658
commit e4af85cdfa
14 files changed
+100 -106

No files matched your search

@@ -1,57 +0,0 @@
.automation-manager.mobile .automation-manager--sidebar.shown {
height: 100vh;
min-height: 100vh;
min-width: 100vw;
}
.automation-manager.mobile .automation-manager--sidebar .automation-manager--sidebar-box--bottom-buttons .hide-btn {
transform: rotate(-90deg);
left: 0.5em;
background-color: var(--mui-background-paper);
height: 2em;
width: 2em;
}
.automation-manager.mobile .automation-manager--sidebar.hidden {
height: 0;
min-height: 0;
}
.automation-manager.mobile .automation-manager--sidebar.hidden .automation-manager--sidebar-box--nav,
.automation-manager.mobile .automation-manager--sidebar.hidden .automation-manager--sidebar-box--list {
display: none;
}
.automation-manager.mobile .automation-manager--sidebar.hidden .automation-manager--sidebar-box--bottom-buttons {
height: 0;
}
.automation-manager.mobile .automation-manager--sidebar.hidden .automation-manager--sidebar-box--bottom-buttons .hide-btn {
transform: rotate(90deg);
top: 1em;
z-index: 100;
}
.automation-manager.mobile .automation-editor--flow-wrapper--toolbar {
align-items: center;
}
.automation-manager.mobile .automation-editor--flow-wrapper--toolbar--title {
padding-left: 2.5em;
justify-content: center;
flex-direction: column;
}
.automation-manager.mobile .automation-editor--flow-wrapper--toolbar--title--text .input-text-view.view span {
max-height: 1.25em;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
word-wrap: break-word;
}
.automation-manager.mobile .automation-editor--flow-wrapper--toolbar--title--text .id,
.automation-manager.mobile .automation-editor--flow-wrapper--toolbar--title .input-text-view.description,
.automation-manager.mobile .automation-editor--flow-wrapper--toolbar--edit-btn {
display: none;
}
@@ -1,5 +1,4 @@
import "./index.css";
import "./index.mobile.css";
import { AutomationEditor } from "components/AutomationEditor";
import { DEFAULT_DIMS } from "components/DAGGraph/elements/constants";
@@ -10,7 +9,6 @@ import {
UseAutomationManagerStateArgs,
} from "./state";
import Alert from "@mui/material/Alert";
import useWindowSize from "utils/useWindowSize";
export type AutomationManagerLoadedProps = UseAutomationManagerStateArgs & {
onAutomationDelete: (aid: string) => void;
@@ -19,10 +17,9 @@ export const AutomationManagerLoaded: FC<
PropsWithChildren<AutomationManagerLoadedProps>
> = ({ children, onAutomationDelete, ...args }) => {
const state = useAutomationManagerState(args);
const { isMobile } = useWindowSize();
return (
<div className={["automation-manager", isMobile ? "mobile" : ""].join(" ")}>
<div className="automation-manager">
{children}
<AutomationManagerSidebar
automations={state.automations}
@@ -1,4 +1,4 @@
.automation-manager--metadatabox.mobile .buttons {
.mobile .automation-manager--metadatabox .buttons {
display: flex;
flex-direction: column;
gap: 0.5em;
@@ -26,13 +26,11 @@ export type MetadataBoxProps = AutomationManagerAuto & {
};
export const MetadataBox: FC<MetadataBoxProps> = (props) => {
const isValidState = ["on", "off"].includes(props.state);
const { isMobile } = useWindowSize();
return (
<div
className={[
"automation-manager--metadatabox",
props.isSelected ? "selected" : "",
isMobile ? "mobile" : "",
props.isNew ? "new" : "",
].join(" ")}
>
@@ -0,0 +1,33 @@
.mobile .automation-manager--sidebar.shown {
height: 100vh;
min-height: 100vh;
min-width: 100vw;
}
.mobile .automation-manager--sidebar .automation-manager--sidebar-box--bottom-buttons .hide-btn {
transform: rotate(-90deg);
left: 0.5em;
background-color: var(--mui-background-paper);
height: 2em;
width: 2em;
}
.mobile .automation-manager--sidebar.hidden {
height: 0;
min-height: 0;
}
.mobile .automation-manager--sidebar.hidden .automation-manager--sidebar-box--nav,
.mobile .automation-manager--sidebar.hidden .automation-manager--sidebar-box--list {
display: none;
}
.mobile .automation-manager--sidebar.hidden .automation-manager--sidebar-box--bottom-buttons {
height: 0;
}
.mobile .automation-manager--sidebar.hidden .automation-manager--sidebar-box--bottom-buttons .hide-btn {
transform: rotate(90deg);
top: 1em;
z-index: 100;
}
@@ -1,4 +1,5 @@
import "./index.css";
import "./index.mobile.css";
import { FC, useState } from "react";
@@ -92,7 +93,14 @@ export const AutomationManagerSidebar: FC<AutomationManagerSidebarProps> = ({
))}
</div>
<div className="automation-manager--sidebar-box--bottom-buttons">
<Button onClick={onAutomationAdd} color="primary" className="add-btn">
<Button
onClick={() => {
onAutomationAdd();
setHidden(true);
}}
color="primary"
className="add-btn"
>
Add
</Button>
<ButtonIcon
@@ -6,7 +6,7 @@
gap: 0.25em;
}
.automation-manager.mobile, .automation-manager.error {
.mobile .automation-manager, .automation-manager.error {
flex-direction: column;
}