refactor: optional route
This commit is contained in:
@@ -87,10 +87,7 @@ const PageRoutes = () => {
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Route index element={<LazyIt><RegPage /></LazyIt>} />
|
<Route index element={<LazyIt><RegPage /></LazyIt>} />
|
||||||
<Route path="set_name">
|
<Route path="set_name/:from?" element={<LazyIt><RegWithUsernamePage /></LazyIt>} />
|
||||||
<Route index element={<LazyIt><RegWithUsernamePage /></LazyIt>} />
|
|
||||||
<Route path=":from" element={<LazyIt><RegWithUsernamePage /></LazyIt>} />
|
|
||||||
</Route>
|
|
||||||
</Route>
|
</Route>
|
||||||
<Route
|
<Route
|
||||||
path="/email_login"
|
path="/email_login"
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ const RegWithUsername: FC = () => {
|
|||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const [username, setUsername] = useState("");
|
const [username, setUsername] = useState("");
|
||||||
const query = new URLSearchParams(location.search);
|
const query = new URLSearchParams(location.search);
|
||||||
// const githubCode = query.get("gcode");
|
|
||||||
// todo: check if query param exists
|
// todo: check if query param exists
|
||||||
const token = query.get("magic_token") as string;
|
const token = query.get("magic_token") as string;
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user