self-hosting tag and hide mutiny+

This commit is contained in:
Paul Miller
2023-09-29 16:43:33 -05:00
parent 4b23571254
commit ee02c55791
5 changed files with 18 additions and 116 deletions

View File

@@ -1,105 +0,0 @@
import { Match, Show, Suspense, Switch } from "solid-js";
import { A } from "solid-start";
import settings from "~/assets/icons/settings.svg";
import pixelLogo from "~/assets/mutiny-pixel-logo.png";
import plusLogo from "~/assets/mutiny-plus-logo.png";
import {
BalanceBox,
BetaWarningModal,
Card,
CombinedActivity,
DecryptDialog,
DefaultMain,
LoadingIndicator,
LoadingShimmer,
NavBar,
OnboardWarning,
PendingNwc,
ReloadPrompt,
SafeArea,
VStack
} from "~/components";
import { useI18n } from "~/i18n/context";
import { FeedbackLink } from "~/routes/Feedback";
import { useMegaStore } from "~/state/megaStore";
export function App() {
const i18n = useI18n();
const [state, _actions] = useMegaStore();
return (
<SafeArea>
<DefaultMain>
<LoadingIndicator />
<header class="mb-2 mt-4 flex w-full items-center justify-between">
<div class="flex items-center gap-2">
<Switch>
<Match when={state.mutiny_plus}>
<img
id="mutiny-logo"
src={plusLogo}
class="h-[25px] w-[86px]"
alt="Mutiny Plus logo"
/>
</Match>
<Match when={true}>
<img
id="mutiny-logo"
src={pixelLogo}
class="h-[25px] w-[75px]"
alt="Mutiny logo"
/>
</Match>
</Switch>
<Show
when={
!state.wallet_loading &&
state.mutiny_wallet?.get_network() !== "bitcoin"
}
>
<div class="text-white-400 -my-1 box-border w-fit rounded bg-neutral-800 px-2 py-1 text-xs uppercase">
{state.mutiny_wallet?.get_network()}
</div>
</Show>
</div>
<A
class="rounded-lg p-2 hover:bg-white/5 active:bg-m-blue md:hidden"
href="/settings"
>
<img src={settings} alt="Settings" class="h-6 w-6" />
</A>
</header>
<Show when={!state.wallet_loading}>
<OnboardWarning />
<ReloadPrompt />
</Show>
<BalanceBox loading={state.wallet_loading} />
<Suspense>
<Show when={!state.wallet_loading && !state.safe_mode}>
<PendingNwc />
</Show>
</Suspense>
<Card title={i18n.t("activity.title")}>
<div class="p-1" />
<VStack>
<Suspense>
<Show
when={!state.wallet_loading}
fallback={<LoadingShimmer />}
>
<CombinedActivity limit={3} />
</Show>
</Suspense>
</VStack>
</Card>
<div class="mt-4 self-center">
<FeedbackLink />
</div>
</DefaultMain>
<DecryptDialog />
<BetaWarningModal />
<NavBar activeTab="home" />
</SafeArea>
);
}

View File

@@ -6,7 +6,6 @@ export * from "./ActivityItem";
export * from "./Amount"; export * from "./Amount";
export * from "./AmountCard"; export * from "./AmountCard";
export * from "./AmountEditable"; export * from "./AmountEditable";
export * from "./App";
export * from "./BalanceBox"; export * from "./BalanceBox";
export * from "./BetaWarningModal"; export * from "./BetaWarningModal";
export * from "./ChooseCurrency"; export * from "./ChooseCurrency";

View File

@@ -20,7 +20,8 @@ export default {
view_transaction: "View Transaction", view_transaction: "View Transaction",
pending: "Pending", pending: "Pending",
error_safe_mode: error_safe_mode:
"Mutiny is running in safe mode. Lightning is disabled." "Mutiny is running in safe mode. Lightning is disabled.",
self_hosted: "Self-hosted",
}, },
contacts: { contacts: {
new: "new", new: "new",

View File

@@ -62,6 +62,11 @@ export default function App() {
{state.mutiny_wallet?.get_network()} {state.mutiny_wallet?.get_network()}
</div> </div>
</Show> </Show>
<Show when={state.settings?.selfhosted === "true"}>
<div class="text-white-400 -my-1 box-border w-fit rounded bg-neutral-800 px-2 py-1 text-xs uppercase">
{i18n.t("common.self_hosted")}
</div>
</Show>
</div> </div>
<A <A
class="rounded-lg p-2 hover:bg-white/5 active:bg-m-blue md:hidden" class="rounded-lg p-2 hover:bg-white/5 active:bg-m-blue md:hidden"

View File

@@ -77,6 +77,7 @@ export default function Settings() {
<BackLink /> <BackLink />
<LargeHeader>{i18n.t("settings.header")}</LargeHeader> <LargeHeader>{i18n.t("settings.header")}</LargeHeader>
<VStack biggap> <VStack biggap>
<Show when={state.settings?.selfhosted !== "true"}>
<SettingsLinkList <SettingsLinkList
header={i18n.t("settings.plus.title")} header={i18n.t("settings.plus.title")}
links={[ links={[
@@ -86,6 +87,7 @@ export default function Settings() {
} }
]} ]}
/> />
</Show>
<SettingsLinkList <SettingsLinkList
header={i18n.t("settings.general")} header={i18n.t("settings.general")}
links={[ links={[