consolidated ismobile
This commit is contained in:
1 parent
f99cb84658
commit
e4af85cdfa
14 files changed
+100
-106
No files matched your search
@@ -0,0 +1,23 @@
|
||||
.mobile .automation-editor--flow-wrapper--toolbar {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.mobile .automation-editor--flow-wrapper--toolbar--title {
|
||||
padding-left: 2.5em;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
.mobile .automation-editor--flow-wrapper--toolbar--title--text .id,
|
||||
.mobile .automation-editor--flow-wrapper--toolbar--title .input-text-view.description,
|
||||
.mobile .automation-editor--flow-wrapper--toolbar--edit-btn {
|
||||
display: none;
|
||||
}
|
||||
@@ -1,25 +1,32 @@
|
||||
import "./index.css";
|
||||
import Icon from "@mui/material/Icon";
|
||||
import { CheckMarkIcon } from "components/Icons";
|
||||
import "./index.mobile.css";
|
||||
|
||||
import { FC, useState } from "react";
|
||||
import { AutomationData } from "types/automations";
|
||||
import { Modal } from "components/Modal";
|
||||
import { AutoInfoBox } from "./AutoInfoBox";
|
||||
import ModeEditOutlineTwoToneIcon from "@mui/icons-material/ModeEditOutlineTwoTone";
|
||||
import { Button } from "components/Inputs/Button";
|
||||
import { useAutomatioEditorState, EditorData } from "./state";
|
||||
import { MiniFailure } from "types/validators/helper";
|
||||
import InputYaml from "components/Inputs/InputYaml";
|
||||
import { TagDB } from "components/AutomationManager/TagDB";
|
||||
import { useCookies } from "react-cookie";
|
||||
import { ControlButton } from "react-flow-renderer";
|
||||
|
||||
import Skeleton from "@mui/material/Skeleton";
|
||||
import LinearProgress from "@mui/material/LinearProgress";
|
||||
import { useCookies } from "react-cookie";
|
||||
|
||||
import Edit from "@mui/icons-material/Edit";
|
||||
import Icon from "@mui/material/Icon";
|
||||
import ModeEditOutlineTwoToneIcon from "@mui/icons-material/ModeEditOutlineTwoTone";
|
||||
import { CheckMarkIcon } from "components/Icons";
|
||||
|
||||
import { Modal } from "components/Modal";
|
||||
import { Button } from "components/Inputs/Button";
|
||||
import InputYaml from "components/Inputs/InputYaml";
|
||||
import { TagDB } from "components/AutomationManager/TagDB";
|
||||
import { DAGDims } from "components/DAGGraph/elements/types";
|
||||
import { DAGAutomationGraph } from "components/DAGGraph";
|
||||
import { InputList } from "components/Inputs/InputList";
|
||||
import { InputTextView } from "components/Inputs/InputTextView";
|
||||
import { ControlButton } from "react-flow-renderer";
|
||||
import Edit from "@mui/icons-material/Edit";
|
||||
|
||||
import { AutomationData } from "types/automations";
|
||||
import { MiniFailure } from "types/validators/helper";
|
||||
|
||||
import { AutoInfoBox } from "./AutoInfoBox";
|
||||
import { useAutomatioEditorState, EditorData } from "./state";
|
||||
|
||||
interface Props {
|
||||
automation?: AutomationData;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
.condition-node-base.mobile {
|
||||
.mobile .condition-node-base {
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.condition-node-base.mobile .condition-node-base--list {
|
||||
.mobile .condition-node-base .condition-node-base--list {
|
||||
flex-direction: row;
|
||||
display: flex;
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
.condition-node-base.mobile .condition-node-base--body {
|
||||
.mobile .condition-node-base .condition-node-base--body {
|
||||
min-height: 3em;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.condition-node-base.mobile .condition-node-base--body.edit {
|
||||
.mobile .condition-node-base .condition-node-base--body.edit {
|
||||
max-height: 500px;
|
||||
}
|
||||
@@ -84,11 +84,7 @@ export const ConditionNodeBase: FC<ConditionNodeBaseProps> = (props) => {
|
||||
// render
|
||||
return (
|
||||
<div
|
||||
className={[
|
||||
"condition-node-base",
|
||||
isMobile ? "mobile" : "",
|
||||
isEdited ? "is-edited" : "",
|
||||
].join(" ")}
|
||||
className={["condition-node-base", isEdited ? "is-edited" : ""].join(" ")}
|
||||
>
|
||||
<div className="condition-node-base--list">
|
||||
<InputList
|
||||
|
||||
@@ -2,6 +2,7 @@ import "./index.css";
|
||||
import MuiModal from "@mui/material/Modal";
|
||||
import { FC, ReactNode } from "react";
|
||||
import { Card, CardContent } from "@mui/material";
|
||||
import useWindowSize from "utils/useWindowSize";
|
||||
|
||||
export interface ModalStyleProps {
|
||||
open: boolean;
|
||||
@@ -10,9 +11,10 @@ export interface Props extends ModalStyleProps {
|
||||
children: ReactNode;
|
||||
}
|
||||
export const Modal: FC<Props> = ({ children, open }) => {
|
||||
const { isMobile } = useWindowSize();
|
||||
return (
|
||||
<MuiModal open={open}>
|
||||
<div className="modal--root">
|
||||
<div className={["modal--root", isMobile ? "mobile" : ""].join(" ")}>
|
||||
<Card variant="outlined">
|
||||
<CardContent>{children}</CardContent>
|
||||
</Card>
|
||||
|
||||
@@ -13,6 +13,7 @@ import Button from "@mui/material/Button";
|
||||
import { useHAConnection } from "haService/connection";
|
||||
import { ConfirmProvider } from "material-ui-confirm";
|
||||
import { Color } from "@mui/material";
|
||||
import useWindowSize from "utils/useWindowSize";
|
||||
|
||||
const theme = createTheme({
|
||||
palette: {
|
||||
@@ -27,6 +28,7 @@ export const InternalPage: FC<{
|
||||
const theme = useTheme();
|
||||
const snackbar = useSnackbar();
|
||||
const snackbarKeyHAConKey = useRef<SnackbarKey | null>(null);
|
||||
const { isMobile } = useWindowSize();
|
||||
|
||||
useEffect(() => {
|
||||
if (conn.status === "error") {
|
||||
@@ -66,7 +68,7 @@ export const InternalPage: FC<{
|
||||
}, [conn, snackbar]);
|
||||
|
||||
return (
|
||||
<main className="page">
|
||||
<main className={["page", isMobile ? "mobile" : ""].join(" ")}>
|
||||
<style>
|
||||
{`:root {
|
||||
${convertPaletteToCss(theme.palette)}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import { FC } from "react";
|
||||
import useWindowSize from "utils/useWindowSize";
|
||||
|
||||
|
||||
export const SizeModal: FC = () => {
|
||||
const size = useWindowSize();
|
||||
|
||||
return <span style={{
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
left: 0,
|
||||
background: 'white',
|
||||
zIndex: 10,
|
||||
}}>{size.width}/{size.height}={size.ratioWbh} ({size.isMobile ? 'm' : 'd'})</span>
|
||||
}
|
||||
Reference in new issue
Block a user