diff --git a/src/pages/invite/InviteBot.tsx b/src/pages/invite/InviteBot.tsx index 8711d4fd..1b337910 100644 --- a/src/pages/invite/InviteBot.tsx +++ b/src/pages/invite/InviteBot.tsx @@ -1,3 +1,4 @@ +/* eslint-disable react/jsx-no-literals */ import { useParams } from "react-router-dom"; import { API } from "revolt.js"; import styled from "styled-components/macro"; @@ -11,21 +12,64 @@ import Markdown from "../../components/markdown/Markdown"; import { useClient } from "../../controllers/client/ClientController"; const BotInfo = styled.div` - gap: 12px; display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + gap: 12px; padding: 12px; + width: 100%; + margin: 20px 0; + border-radius: 10px; - h1, - p { - margin: 0; + .name { + display: flex; + align-items: center; + gap: 16px; + font-size: 1.5rem; + font-weight: 500; + + h1 { + margin: 0; + } + } + + .description { + display: flex; + flex-direction: column; + align-items: center; + text-align: center; + font-size: 1rem; + line-height: 1; + color: #ddd; + margin-top: 12px; + margin-bottom: 24px; } `; const Option = styled.div` - gap: 8px; display: flex; - margin-top: 4px; - margin-bottom: 12px; + flex-direction: column; + justify-content: center; + align-items: center; + gap: 12px; + padding: 12px; + width: 100%; + margin: 20px 0; + + label { + font-size: 16px; + margin-right: 16px; + } + + .select-container { + display: flex; + flex-direction: column; + gap: 14px; + justify-content: space-between; + align-items: center; + width: 100%; + } `; export default function InviteBot() { @@ -38,71 +82,113 @@ export default function InviteBot() { // eslint-disable-next-line }, []); - const [server, setServer] = useState("none"); - const [group, setGroup] = useState("none"); + const [server, setServer] = useState(undefined); + const [group, setGroup] = useState(undefined); + const [selectedOption, setSelectedOption] = useState(""); + + const handleAdd = () => { + if (selectedOption === "server" && server) { + client.bots.invite(data!._id, { server }); + } else if (selectedOption === "group" && group) { + client.bots.invite(data!._id, { group }); + } + }; return ( -
+
This section is under construction. {typeof data === "undefined" && } {data && ( <> - - +
+

{data.username}

- {data.description && ( - - )}
+ {data.description && ( +
+ +
+ )}
- Add to server - Add to group - )}