Skip to content

Commit

Permalink
feat: add esats for federations
Browse files Browse the repository at this point in the history
  • Loading branch information
benalleng authored and futurepaul committed Feb 5, 2024
1 parent ae44a83 commit ece5260
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion e2e/fedimint.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ test("fedmint join, receive, send", async ({ page }) => {
await expect(
page
.locator("div")
.filter({ hasText: /^100 SATS$/ })
.filter({ hasText: /^100 eSATS$/ })
.nth(1)
).toBeVisible();

Expand Down
9 changes: 7 additions & 2 deletions src/components/Amount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export function AmountSats(props: {
amountSats: bigint | number | undefined;
icon?: "lightning" | "community" | "chain" | "plus" | "minus";
denominationSize?: "sm" | "lg" | "xl";
isFederation?: boolean;
}) {
const i18n = useI18n();
return (
Expand Down Expand Up @@ -54,14 +55,18 @@ export function AmountSats(props: {
Number(props.amountSats) === 0
}
>
{i18n.t("common.sats")}
{props.isFederation
? i18n.t("common.e_sats")
: i18n.t("common.sats")}
</Show>
<Show
when={
props.amountSats && Number(props.amountSats) === 1
}
>
{i18n.t("common.sat")}
{props.isFederation
? i18n.t("common.e_sat")
: i18n.t("common.sat")}
</Show>
</span>
</h1>
Expand Down
1 change: 1 addition & 0 deletions src/components/BalanceBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export function BalanceBox(props: { loading?: boolean }) {
amountSats={state.balance?.federation || 0}
icon="community"
denominationSize="lg"
isFederation
/>
</div>
<div class="text-lg text-white/70">
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/en/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ export default {
title: "Mutiny Wallet",
nice: "Nice",
home: "Home",
e_sats: "eSATS",
e_sat: "eSat",
sats: "SATS",
sat: "SAT",
fee: "Fee",
Expand Down
1 change: 1 addition & 0 deletions src/routes/settings/ManageFederations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ function FederationListItem(props: {
<AmountSats
amountSats={props.balance}
denominationSize={"sm"}
isFederation
/>
</KeyValue>
</Show>
Expand Down

0 comments on commit ece5260

Please sign in to comment.