botPosition

master
Tudor Stanciu 2020-06-06 02:07:04 +03:00
parent 49db1e4f08
commit 91f0fb0651
2 changed files with 19 additions and 2 deletions

View File

@ -42,3 +42,6 @@ docker run --restart=always -p 5005:80 -d cloud.canister.io:5000/tstanciu/revers
Rename container
docker rename <containet_id> reverse-proxy-frontend
##############################################################################################
import { makeStyles, useTheme } from "@material-ui/core/styles";
const theme = useTheme();

View File

@ -3,17 +3,31 @@ import PropTypes from "prop-types";
import { connect } from "react-redux";
import { botType } from "../botType";
import Wizard from "./Wizard";
import { makeStyles } from "@material-ui/core/styles";
const useStyles = makeStyles(theme => ({
bot: {
position: "fixed",
bottom: theme.spacing(2),
right: theme.spacing(2),
zIndex: 1
},
botPosition: {
position: "absolute"
}
}));
const BotsManager = ({ bot }) => {
const [type, setType] = useState(bot.type);
const classes = useStyles();
useEffect(() => {
if (bot.type) setType(bot.type);
}, [bot.type]);
return (
<div style={{ position: "absolute" }}>
{type === botType.wizard && <Wizard />}
<div className={classes.botPosition}>
<div className={classes.bot}>{type === botType.wizard && <Wizard />}</div>
</div>
);
};