Skip to content

Commit 96b939e

Browse files
authored
Add changes from cloud repo to public one (#377)
* Remove unused files * Update activity descriptions * Update SelectDropdown * Update redirect logic for / page * Update HelpText.tsx * Update wording for exit nodes
1 parent 5e13548 commit 96b939e

19 files changed

+157
-144
lines changed

src/app/page.tsx

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,41 @@
11
"use client";
22

33
import FullScreenLoading from "@components/ui/FullScreenLoading";
4+
import { useLocalStorage } from "@hooks/useLocalStorage";
45
import { useRedirect } from "@hooks/useRedirect";
6+
import { useEffect, useState } from "react";
7+
8+
type Props = {
9+
url: string;
10+
queryParams?: string;
11+
};
512

613
export default function Home() {
7-
useRedirect("/peers");
8-
return <FullScreenLoading />;
14+
const [mounted, setMounted] = useState(false);
15+
const [tempQueryParams, setTempQueryParams] = useLocalStorage(
16+
"netbird-query-params",
17+
"",
18+
);
19+
const [queryParams, setQueryParams] = useState("");
20+
21+
useEffect(() => {
22+
setQueryParams(tempQueryParams);
23+
setTempQueryParams("");
24+
setMounted(true);
25+
// eslint-disable-next-line react-hooks/exhaustive-deps
26+
}, []);
27+
28+
return mounted ? (
29+
<Redirect
30+
url={window?.location?.pathname || "/"}
31+
queryParams={queryParams}
32+
/>
33+
) : (
34+
<FullScreenLoading />
35+
);
936
}
37+
38+
const Redirect = ({ url, queryParams }: Props) => {
39+
useRedirect(url == "/" ? "/peers" : url + (queryParams && `?${queryParams}`));
40+
return <FullScreenLoading />;
41+
};

src/assets/countries/CountryDERounded.tsx

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/assets/countries/CountryEURounded.tsx

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/assets/countries/CountryJPRounded.tsx

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/assets/countries/CountryUSRounded.tsx

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/assets/countries/de.svg

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/assets/countries/eu.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/assets/countries/jp.svg

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/assets/countries/us.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/auth/OIDCError.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useOidc, useOidcUser } from "@axa-fr/react-oidc";
22
import Button from "@components/Button";
33
import Paragraph from "@components/Paragraph";
44
import loadConfig from "@utils/config";
5-
import { ArrowRightIcon, LogOut } from "lucide-react";
5+
import { ArrowRightIcon } from "lucide-react";
66
import { useSearchParams } from "next/navigation";
77
import * as React from "react";
88
import { useEffect, useState } from "react";
@@ -55,7 +55,7 @@ export const OIDCError = () => {
5555
variant={"primary"}
5656
size={"sm"}
5757
className={"mt-5"}
58-
onClick={() => login("/", { client_id: config.clientId })}
58+
onClick={() => logout("/", { client_id: config.clientId })}
5959
>
6060
Continue
6161
<ArrowRightIcon size={16} />
@@ -83,7 +83,6 @@ export const OIDCError = () => {
8383
onClick={() => logout("/", { client_id: config.clientId })}
8484
>
8585
Logout
86-
<LogOut size={16} />
8786
</Button>
8887
</>
8988
)}

0 commit comments

Comments
 (0)