diff --git a/public/i18n/en.json b/public/i18n/en.json index d723515..977e810 100644 --- a/public/i18n/en.json +++ b/public/i18n/en.json @@ -558,7 +558,8 @@ "created_at": "Created At", "recommended_by": "Recommended By", "already_in_fed": "You're already in a federation!", - "descriptionpart2": "Each one is ran by a group of different inviduals or companies. Discover one that you or your friends might trust below." + "descriptionpart2": "Each one is ran by a group of different inviduals or companies. Discover one that you or your friends might trust below.", + "join_me": "Join me" }, "gift": { "give_sats_link": "Give sats as a gift", diff --git a/src/components/FederationInviteShower.tsx b/src/components/FederationInviteShower.tsx new file mode 100644 index 0000000..12cb1e1 --- /dev/null +++ b/src/components/FederationInviteShower.tsx @@ -0,0 +1,55 @@ +import { Copy, QrCode } from "lucide-solid"; +import { createSignal, Show } from "solid-js"; +import { QRCodeSVG } from "solid-qr-code"; + +import { SimpleDialog } from "~/components"; +import { useI18n } from "~/i18n/context"; +import { useCopy } from "~/utils"; + +export function FederationInviteShower(props: { + name?: string; + inviteCode: string; +}) { + const i18n = useI18n(); + const [showQr, setShowQr] = createSignal(false); + + const [copy, copied] = useCopy({ copiedTimeout: 1000 }); + + return ( + <> +
+ + +
{" "} + { + setShowQr(open); + }} + title={i18n.t("settings.manage_federations.join_me")} + > + +

+ {props.name} +

+
+
+ +
+
+ + ); +} diff --git a/src/components/index.ts b/src/components/index.ts index ab5ed26..b2c9e40 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -57,3 +57,4 @@ export * from "./HomeBalance"; export * from "./EditProfileForm"; export * from "./ImportNsecForm"; export * from "./LightningAddressShower"; +export * from "./FederationInviteShower"; diff --git a/src/routes/settings/ManageFederations.tsx b/src/routes/settings/ManageFederations.tsx index 244362a..b665f7a 100644 --- a/src/routes/settings/ManageFederations.tsx +++ b/src/routes/settings/ManageFederations.tsx @@ -18,7 +18,6 @@ import { Suspense, Switch } from "solid-js"; -import { QRCodeSVG } from "solid-qr-code"; import { AmountSats, @@ -28,6 +27,7 @@ import { DefaultMain, ExternalLink, FancyCard, + FederationInviteShower, InfoBox, KeyValue, LabelCircle, @@ -85,6 +85,7 @@ type RefetchType = ( export function AddFederationForm(props: { refetch?: RefetchType; setup?: boolean; + browseOnly?: boolean; }) { const i18n = useI18n(); const [state, actions] = useMegaStore(); @@ -179,7 +180,7 @@ export function AddFederationForm(props: { return ( <> - + {i18n.t("settings.manage_federations.manual")} @@ -223,6 +224,8 @@ export function AddFederationForm(props: { + + {i18n.t("settings.manage_federations.discover")} @@ -314,19 +317,21 @@ export function AddFederationForm(props: { - + + + )} @@ -460,15 +465,15 @@ function FederationListItem(props: { > + + + -
- -
@@ -580,6 +585,11 @@ export function ManageFederations() { + + + + +