fix add server menu (make tabs move with left css prop

This commit is contained in:
mbecker20
2022-04-27 03:42:38 -04:00
parent 9140035a6e
commit 6752a539aa
2 changed files with 21 additions and 27 deletions
+18 -24
View File
@@ -4,7 +4,6 @@ import { createStore } from "solid-js/store";
import { pushNotification } from "../..";
import { ADD_SERVER } from "@monitor/util";
import { useAppState } from "../../state/StateProvider";
import { combineClasses } from "../../util/helpers";
import { useToggle } from "../../util/hooks";
import Input from "../util/Input";
import Grid from "../util/layout/Grid";
@@ -50,29 +49,24 @@ const Content: Component<{ close: () => void }> = (p) => {
}
};
return (
<>
<Grid
placeItems="center"
style={{ padding: "2rem 1rem 1rem 1rem" }}
>
<Input
ref={nameInput}
value={server.name}
onEdit={(name) => setServer("name", name)}
placeholder="name"
style={{ "font-size": "1.5rem" }}
/>
<Input
value={server.address}
onEdit={(address) => setServer("address", address)}
placeholder="address"
style={{ "font-size": "1.5rem" }}
/>
<button class="green" style={{ width: "100%" }} onClick={create}>
add
</button>
</Grid>
</>
<Grid placeItems="center" style={{ padding: "2rem 1rem 1rem 1rem" }}>
<Input
ref={nameInput}
value={server.name}
onEdit={(name) => setServer("name", name)}
placeholder="name"
style={{ "font-size": "1.5rem" }}
/>
<Input
value={server.address}
onEdit={(address) => setServer("address", address)}
placeholder="address"
style={{ "font-size": "1.5rem" }}
/>
<button class="green" style={{ width: "100%" }} onClick={create}>
add
</button>
</Grid>
);
};
+3 -3
View File
@@ -13,7 +13,6 @@ import { combineClasses } from "../../../util/helpers";
import { LocalStorageSetter, useLocalStorage } from "../../../util/hooks";
import Button from "../Button";
import Flex from "../layout/Flex";
import Grid from "../layout/Grid";
import s from "./tabs.module.scss";
export type Tab = {
@@ -86,9 +85,10 @@ export const ControlledTabs: Component<{
<Flex
gap="0rem"
style={{
position: "relative",
width: `${tabs().length * 100}%`,
transform: `translateX(-${(current() / tabs().length) * 100}%)`,
transition: "transform 350ms ease",
left: `-${current() * 100}%`,
transition: "left 350ms ease",
}}
>
<For each={tabs()}>