fix(ui): fixes for mobile UI, settings and sessions pages (#451)

Co-authored-by: trashtemp <96388163+trashtemp@users.noreply.github.com>
This commit is contained in:
Paul Makles
2021-12-20 20:48:37 +00:00
committed by GitHub
parent e7459790c5
commit 6e4c4f3ae2
15 changed files with 251 additions and 72 deletions

View File

@@ -554,38 +554,46 @@ export const MyBots = observer(() => {
</a>
.
</h5>
{bots?.map((bot) => {
return (
<BotCard
key={bot._id}
bot={bot}
onDelete={() =>
setBots(bots.filter((x) => x._id !== bot._id))
}
onUpdate={(changes: Changes) =>
setBots(
bots.map((x) => {
if (x._id === bot._id) {
if (
"public" in changes &&
typeof changes.public === "boolean"
)
x.public = changes.public;
if ("interactions_url" in changes)
x.interactions_url =
changes.interactions_url;
if (
changes.remove === "InteractionsURL"
)
x.interactions_url = undefined;
}
return x;
}),
)
}
/>
);
})}
<hr />
<h3>
<Text id="app.settings.pages.bots.title" />
</h3>
<div className={styles.botList}>
{bots?.map((bot) => {
return (
<BotCard
key={bot._id}
bot={bot}
onDelete={() =>
setBots(bots.filter((x) => x._id !== bot._id))
}
onUpdate={(changes: Changes) =>
setBots(
bots.map((x) => {
if (x._id === bot._id) {
if (
"public" in changes &&
typeof changes.public ===
"boolean"
)
x.public = changes.public;
if ("interactions_url" in changes)
x.interactions_url =
changes.interactions_url;
if (
changes.remove ===
"InteractionsURL"
)
x.interactions_url = undefined;
}
return x;
}),
)
}
/>
);
})}
</div>
</div>
);
});