From d39b9db781601c06e1e9bc8df61ba8a2299b68e4 Mon Sep 17 00:00:00 2001 From: Katalina Okano Date: Thu, 8 Jul 2021 17:10:50 -0500 Subject: [PATCH] feat: bot-join machinery redirect --- packages/web/src/pages/machinery/bot-join.tsx | 49 ++++++------------- 1 file changed, 16 insertions(+), 33 deletions(-) diff --git a/packages/web/src/pages/machinery/bot-join.tsx b/packages/web/src/pages/machinery/bot-join.tsx index cfaf2e9..6a96041 100644 --- a/packages/web/src/pages/machinery/bot-join.tsx +++ b/packages/web/src/pages/machinery/bot-join.tsx @@ -1,36 +1,19 @@ -import { navigate } from '@reach/router'; -import { Button } from '@roleypoly/design-system/atoms/button'; -import { Hero } from '@roleypoly/design-system/atoms/hero'; -import { Space } from '@roleypoly/design-system/atoms/space'; -import { Link } from '@roleypoly/design-system/atoms/typography'; -import { GoArrowLeft } from 'react-icons/go'; +import { GenericLoadingTemplate } from '@roleypoly/design-system/templates/generic-loading'; +import * as React from 'react'; +import { useApiContext } from '../../contexts/api/ApiContext'; -const BotJoin = () => ( - -
- Hey. Thanks for taking an interest in Roleypoly. -
- Right now, we're not allowing you to add the Roleypoly Next closed beta bot to any - servers. -
- Please keep an eye on{' '} - - #next-testers - {' '} - for when we're ready. - - -
-
-); +const BotJoin = (props: { serverID: string; path: string }) => { + const { apiUrl } = useApiContext(); + let params = ''; + if (props.serverID) { + params = `?guild=${props.serverID}`; + } + + React.useEffect(() => { + window.location.href = `${apiUrl}/bot-join${params}`; + }, [apiUrl, params]); + + return ; +}; export default BotJoin;