bruh
This commit is contained in:
parent
85e70157ad
commit
0e0005e8b7
1 changed files with 62 additions and 45 deletions
|
@ -1,51 +1,68 @@
|
||||||
import '../src/App.css'
|
import "../src/App.css";
|
||||||
import "./reviewed.css"
|
import "./reviewed.css";
|
||||||
import { sendReview } from '../src/components/api'
|
import { sendReview } from "../src/components/api";
|
||||||
|
|
||||||
export default function App() {
|
export default function App() {
|
||||||
const token = window.location.hash.substring(window.location.hash.indexOf("access_token") + "access_token".length + 1).substring(0, 30)
|
const token = window.location.hash
|
||||||
console.log(token)
|
.substring(
|
||||||
|
window.location.hash.indexOf("access_token") + "access_token".length + 1,
|
||||||
|
)
|
||||||
|
.substring(0, 30);
|
||||||
|
console.log(token);
|
||||||
if (token === "") {
|
if (token === "") {
|
||||||
window.location.href = "https://discord.com/oauth2/authorize?client_id=1208380910525743134&response_type=token&redirect_uri=https%3A%2F%2Fexhq.dev%2Freview%2F&scope=identify"
|
window.location.href =
|
||||||
|
"https://discord.com/oauth2/authorize?client_id=1208380910525743134&response_type=code&redirect_uri=https%3A%2F%2Famy.rip%2Freview%2F&scope=identify";
|
||||||
}
|
}
|
||||||
let ref!: HTMLTextAreaElement;
|
let ref!: HTMLTextAreaElement;
|
||||||
return <div class='reviewOuterparent'>
|
return (
|
||||||
<div class='reviewParent'>
|
<div class="reviewOuterparent">
|
||||||
|
<div class="reviewParent">
|
||||||
<img src="../fjonkie.png" alt="" />
|
<img src="../fjonkie.png" alt="" />
|
||||||
<span>(it doesnt)</span>
|
<span>(it doesnt)</span>
|
||||||
<textarea
|
<textarea
|
||||||
ref={ref}
|
ref={ref}
|
||||||
onKeyPress={async (e) => {
|
onKeyPress={async (e) => {
|
||||||
if (e.key === "Enter") {
|
if (e.key === "Enter") {
|
||||||
e.preventDefault()
|
e.preventDefault();
|
||||||
if (await sendReview(ref.value, token)) {
|
if (await sendReview(ref.value, token)) {
|
||||||
alert("review sent!")
|
alert("review sent!");
|
||||||
} else {
|
} else {
|
||||||
alert("something went wrong, check your network tab or something idfk")
|
alert(
|
||||||
|
"something went wrong, check your network tab or something idfk",
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
placeholder='your shitty review'
|
placeholder="your shitty review"
|
||||||
class='reviewText'
|
class="reviewText"
|
||||||
name="" id="" cols="25" rows="3">
|
name=""
|
||||||
</textarea>
|
id=""
|
||||||
|
cols="25"
|
||||||
|
rows="3"
|
||||||
|
></textarea>
|
||||||
|
|
||||||
<div class='flexButton'>
|
<div class="flexButton">
|
||||||
<button onclick={async () => {
|
<button
|
||||||
|
onclick={async () => {
|
||||||
try {
|
try {
|
||||||
const success = await sendReview(ref.value, token);
|
const success = await sendReview(ref.value, token);
|
||||||
if (success) {
|
if (success) {
|
||||||
alert("Review sent successfully!");
|
alert("Review sent successfully!");
|
||||||
} else {
|
} else {
|
||||||
alert("Failed to send review. open your browser's network tab for more info lmao");
|
alert(
|
||||||
|
"Failed to send review. open your browser's network tab for more info lmao",
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
alert("how");
|
alert("how");
|
||||||
}
|
}
|
||||||
|
}}
|
||||||
}} class='sendButton'>send yo shi</button>
|
class="sendButton"
|
||||||
|
>
|
||||||
|
send yo shi
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue