Started to do animations | DO NOT USE IN PROD
diff --git a/pages/api/rsmv/complete.js b/pages/api/rsmv/complete.js
index 002caee..6cdd97a 100644
--- a/pages/api/rsmv/complete.js
+++ b/pages/api/rsmv/complete.js
@@ -2,12 +2,12 @@
const Complete = async (req, res) => {
let code = await Axios.post('http://127.0.0.1:3000/api/rsmv/validate', {code:req.body.code});
- if (code.status != 200) {
+ if (code.status !== 200) {
return res.send(404);
}
- if (code.data.user != req.body.uid) return res.send(401)
- if (code.data.guild != req.body.gid) return res.send(401)
- if (code.data.role != req.body.rid) return res.send(401)
+ if (code.data.user !== req.body.uid) return res.send(401)
+ if (code.data.guild !== req.body.gid) return res.send(401)
+ if (code.data.role !== req.body.rid) return res.send(401)
let secret = "slwu0rZV5W6WdmGtgI16du8Ar2tQGMr3Q9dE6u3poKiVODNV9SweaA3buawgkTmTuITXDWOUpBcTFA0qWrUvoshi1JB180WOFwA7"
let resp = await Axios.get(
diff --git a/pages/clicksforms.js b/pages/clicksforms.js
index 8da3441..155d605 100644
--- a/pages/clicksforms.js
+++ b/pages/clicksforms.js
@@ -49,7 +49,7 @@
<ListItem><Code colour="6576CC">/manage</Code> Lets you manage your servers forms.</ListItem>
</List>
</Panel>
- <Panel halfSize={true} id="services" style={this.state.toHighlight == "services" ? {border: "solid 10px red"} : {}}>
+ <Panel halfSize={true} id="services" style={this.state.toHighlight === "services" ? {border: "solid 10px red"} : {}}>
<Title>Services</Title>
<Divider toHighlight={this.state.toHighlight} highlightColour="6576CC" name="services"/>
<Text>ClicksForms supports services such as <a href="https://docs.google.com/forms">Google Forms</a> through our Add-on.</Text>
diff --git a/pages/clicksforms/form.js b/pages/clicksforms/form.js
index df5aeec..aa1b032 100644
--- a/pages/clicksforms/form.js
+++ b/pages/clicksforms/form.js
@@ -61,14 +61,14 @@
method: "GET",
mode: "cors"
})
- if ( (await code).status == 404 ) {
+ if ( (await code).status === 404 ) {
return {
redirect: {
destination: '/clicksforms/error/deleted',
permanent: true
}
}
- } else if ( code.status != 200 ) {
+ } else if ( code.status !== 200 ) {
return {
redirect: {
destination: '/clicksforms/error/unknown',
diff --git a/pages/nucleus/embed/index.js b/pages/nucleus/embed/index.js
deleted file mode 100644
index 7ef2ced..0000000
--- a/pages/nucleus/embed/index.js
+++ /dev/null
@@ -1,106 +0,0 @@
-import HCaptcha from 'react-hcaptcha';
-import Axios from 'axios';
-import Router from 'next/router';
-import React from 'react';
-import Header from '../../../Components/Header'
-import { useReward } from 'react-rewards';
-import { Card, CardRow } from '../../../Components/Card';
-
-import { AutoLayout, Panel, Title, Text, Divider } from '../../../Components/Panels';
-import { List, ListItem } from '../../../Components/Texttools';
-import { useColorMode } from 'theme-ui';
-import Styles from '../../../styles/nucleus/embed.module.css';
-
-
-function Embed(props) {
- const [clicked, setClicked] = React.useState(false);
- const [theme, setTheme] = useColorMode()
-
- const { reward: reward, isAnimating: isAnimating } = useReward('confetti', 'confetti', {
- elementSize: 10,
- elementCount: 150,
- startVelocity: 35,
- lifetime: 300,
- decay: 0.94,
- spread: 170,
- position: "absolute",
- colors: ["#68D49E"]
- });
-
- async function submitForm(tkn) {
- if ( clicked ) {
- Router.push('/nucleus/verify/alreadyVerified', '/nucleus/verify/success');
- }
- setClicked(true);
- reward();
- let code = await Axios.post('/api/nucleus/verify/complete', {
- code: props.code,
- tkn: tkn
- });
- setTimeout(() => {
- if (code.data.success === true ) return Router.push('/nucleus/verify/success','/nucleus/verify')
- else return Router.push('/nucleus/verify/failure','/nucleus/verify')
- }, 2500);
- }
-
- return <>
- <Header
- name="Embed Editor"
- subtext={`Editing embed in ${props.gName}`}
- gradient={["F27878", "D96B6B"]}
- wave="web/waves/header/nucleus"
- buttons={[]}
- />
- <AutoLayout>
- <Panel>
- <Title>Preview</Title>
- <Divider name="preview"/>
- <div className={Styles.previewEmbed}>
- <div className={Styles.left}></div>
- <div className={Styles.title}><input ></input></div>
- <div className={Styles.description}><input ></input></div>
- </div>
- <div className={Styles.right}>
- <div className={Styles.uploadImage} />
- </div>
- <>
-
- </>
- <div className={Styles.footer}>
- <ImageUpload size={64} />
- </div>
- </Panel>
- <Panel halfSize={false} id="invite">
- <Title>Invite</Title>
- <Divider />
- <CardRow>
- <Card
- wave="nucleus"
- icon="bots/nucleus/circle"
- buttonText={"FFFFFF"} gradient={["F27878", "D96B6B"]}
- title="Nucleus"
- subtext="Invite Nucleus to your server"
- buttons={[
- {color: "424242", link: "https://discord.com/api/oauth2/authorize?client_id=715989276382462053&permissions=121295465718&scope=bot%20applications.commands", text: "Invite"}
- ]}
- url="https://discord.com/api/oauth2/authorize?client_id=715989276382462053&permissions=121295465718&scope=bot%20applications.commands"
- />
- </CardRow>
- </Panel>
- </AutoLayout>
- </>
-}
-
-export default Embed;
-export async function getServerSideProps(ctx) {
- return {
- props: {
- gID: code.data.gID,
- gName: code.data.gName,
- mID: code.data.mID,
- cID: code.data.cID,
- headers: headers,
- code: ctx.query.code
- }
- }
-}
\ No newline at end of file
diff --git a/pages/nucleus/verify/index.js b/pages/nucleus/verify/index.js
index 5057b2a..38a3aea 100644
--- a/pages/nucleus/verify/index.js
+++ b/pages/nucleus/verify/index.js
@@ -12,7 +12,6 @@
function Verify(props) {
const [clicked, setClicked] = React.useState(false);
- const [theme, setTheme] = useColorMode()
const { reward: reward, isAnimating: isAnimating } = useReward('confetti', 'confetti', {
elementSize: 10,
@@ -46,7 +45,7 @@
name={props.guild_name}
customImage={props.guild_icon_url}
roundImage={true}
- subtext={`${props.memberCount} members`}
+ subtext={`Welcome, ${props.username}`}
gradient={["F27878", "D96B6B"]}
wave="web/waves/header/nucleus"
buttons={[]}
@@ -87,8 +86,7 @@
}
let code;
try {
- await Axios.patch(`http://localhost:10000/verify/${ctx.query.code}`);
- code = await Axios.get(`http://localhost:10000/verify/${ctx.query.code}`, {code: ctx.query.code});
+ code = await Axios.get(`http://localhost:10000/verify/${ctx.query.code}`);
} catch (e) {
return {
redirect: {
@@ -105,7 +103,7 @@
gID: code.data.gID,
guild_name: code.data.gName,
guild_icon_url: code.data.gIcon,
- memberCount: code.data.mCount,
+ username: code.data.uName,
headers: headers,
code: ctx.query.code
}
diff --git a/pages/rsmv/index.js b/pages/rsmv/index.js
index f46c46e..231bcc5 100644
--- a/pages/rsmv/index.js
+++ b/pages/rsmv/index.js
@@ -21,7 +21,7 @@
async handleVerificationSuccess(cls, token) {
const chk = await Axios.put('/api/rsmv/verifyTkn', { tkn: token.toString() })
- if(chk.data.success == true) {
+ if(chk.data.success === true) {
this.setState({
captchaComplete: true
})
@@ -107,7 +107,7 @@
}
let code = await Axios.post('http://localhost:3000/api/rsmv/validate', {code:ctx.query.code});
let headers = ctx.req.headers;
- if (code.status != 200 ) {
+ if (code.status !== 200 ) {
return {
redirect: {
destination: '/rsmv/failure',
diff --git a/pages/rsmv/rsmvtesting.js b/pages/rsmv/rsmvtesting.js
index 8587221..e37f1f0 100644
--- a/pages/rsmv/rsmvtesting.js
+++ b/pages/rsmv/rsmvtesting.js
@@ -21,7 +21,7 @@
async handleVerificationSuccess(cls, token) {
const chk = await Axios.put('/api/rsmv/verifyTkn', { tkn: token.toString() })
- if(chk.data.success == true) {
+ if(chk.data.success === true) {
this.setState({
captchaComplete: true
})