Created the Code.jsx page
This commit is contained in:
parent
b837295bbb
commit
32f218bedb
26
src/states/Code/Code.jsx
Normal file
26
src/states/Code/Code.jsx
Normal file
@ -0,0 +1,26 @@
|
||||
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
|
||||
import Button from "@/common/components/Button";
|
||||
import {faCheckCircle} from "@fortawesome/free-solid-svg-icons";
|
||||
import "./styles.sass";
|
||||
import {AUTH_URL} from "@/App.jsx";
|
||||
import {useEffect} from "react";
|
||||
|
||||
export const Code = () => {
|
||||
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const code = urlParams.get('code');
|
||||
|
||||
useEffect(() => {
|
||||
if (code) {
|
||||
localStorage.setItem("code", code);
|
||||
}
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="code-page">
|
||||
{code && <FontAwesomeIcon icon={faCheckCircle}/>}
|
||||
|
||||
{!code && <Button onClick={() => location.href = AUTH_URL}>Try Again</Button>}
|
||||
</div>
|
||||
);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user