feat: bot-join machinery redirect

This commit is contained in:
41666 2021-07-08 17:10:50 -05:00
parent ab3f718e6d
commit d39b9db781

View file

@ -1,36 +1,19 @@
import { navigate } from '@reach/router'; import { GenericLoadingTemplate } from '@roleypoly/design-system/templates/generic-loading';
import { Button } from '@roleypoly/design-system/atoms/button'; import * as React from 'react';
import { Hero } from '@roleypoly/design-system/atoms/hero'; import { useApiContext } from '../../contexts/api/ApiContext';
import { Space } from '@roleypoly/design-system/atoms/space';
import { Link } from '@roleypoly/design-system/atoms/typography';
import { GoArrowLeft } from 'react-icons/go';
const BotJoin = () => ( const BotJoin = (props: { serverID: string; path: string }) => {
<Hero> const { apiUrl } = useApiContext();
<div> let params = '';
Hey. Thanks for taking an interest in Roleypoly. if (props.serverID) {
<br /> params = `?guild=${props.serverID}`;
Right now, we're not allowing you to add the Roleypoly Next closed beta bot to any }
servers.
<br /> React.useEffect(() => {
Please keep an eye on{' '} window.location.href = `${apiUrl}/bot-join${params}`;
<Link href={'https://discord.com/channels/386659935687147521/790741820173844530'}> }, [apiUrl, params]);
#next-testers
</Link>{' '} return <GenericLoadingTemplate />;
for when we're ready. };
<Space />
<Button
onClick={() => {
navigate(-1);
}}
color="muted"
size="small"
icon={<GoArrowLeft />}
>
Go back
</Button>
</div>
</Hero>
);
export default BotJoin; export default BotJoin;