This commit is contained in:
parent
a68cdeeb20
commit
98e671ee45
@ -1,21 +1,21 @@
|
||||
import {useUserProfile} from "@snort/system-react";
|
||||
import { useUserProfile } from "@snort/system-react";
|
||||
import classNames from "classnames";
|
||||
import {FormattedMessage, useIntl} from "react-intl";
|
||||
import {useNavigate} from "react-router-dom";
|
||||
import { FormattedMessage, useIntl } from "react-intl";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
import NavLink from "@/Components/Button/NavLink";
|
||||
import {NoteCreatorButton} from "@/Components/Event/Create/NoteCreatorButton";
|
||||
import { NoteCreatorButton } from "@/Components/Event/Create/NoteCreatorButton";
|
||||
import Icon from "@/Components/Icons/Icon";
|
||||
import Avatar from "@/Components/User/Avatar";
|
||||
import {ProfileLink} from "@/Components/User/ProfileLink";
|
||||
import { ProfileLink } from "@/Components/User/ProfileLink";
|
||||
import useEventPublisher from "@/Hooks/useEventPublisher";
|
||||
import {HasNotificationsMarker} from "@/Pages/Layout/HasNotificationsMarker";
|
||||
import {subscribeToNotifications} from "@/Utils/Notifications";
|
||||
import {getCurrentSubscription} from "@/Utils/Subscription";
|
||||
import { HasNotificationsMarker } from "@/Pages/Layout/HasNotificationsMarker";
|
||||
import { subscribeToNotifications } from "@/Utils/Notifications";
|
||||
import { getCurrentSubscription } from "@/Utils/Subscription";
|
||||
|
||||
import useLogin from "../../Hooks/useLogin";
|
||||
import {LogoHeader} from "./LogoHeader";
|
||||
import {WalletBalance} from "@/Pages/Layout/WalletBalance";
|
||||
import { LogoHeader } from "./LogoHeader";
|
||||
import { WalletBalance } from "@/Pages/Layout/WalletBalance";
|
||||
|
||||
const MENU_ITEMS = [
|
||||
{
|
||||
|
@ -1,9 +1,9 @@
|
||||
import {useEffect, useMemo, useState} from "react";
|
||||
import {Sats, useWallet} from "@/Wallet";
|
||||
import {useRates} from "@/Hooks/useRates";
|
||||
import {FormattedMessage, FormattedNumber} from "react-intl";
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import { Sats, useWallet } from "@/Wallet";
|
||||
import { useRates } from "@/Hooks/useRates";
|
||||
import { FormattedMessage, FormattedNumber } from "react-intl";
|
||||
import Icon from "@/Components/Icons/Icon";
|
||||
import {useNavigate} from "react-router-dom";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
export const WalletBalance = () => {
|
||||
const [balance, setBalance] = useState<Sats | null>(null);
|
||||
@ -20,21 +20,21 @@ export const WalletBalance = () => {
|
||||
|
||||
const msgValues = useMemo(() => {
|
||||
return {
|
||||
amount: <FormattedNumber style="currency" currency="USD" value={(rates?.ask ?? 0) * (balance ?? 0) * 1e-8}/>,
|
||||
amount: <FormattedNumber style="currency" currency="USD" value={(rates?.ask ?? 0) * (balance ?? 0) * 1e-8} />,
|
||||
};
|
||||
}, [balance, rates]);
|
||||
|
||||
return (
|
||||
<div className="w-full flex flex-col max-xl:hidden pl-3 py-2 cursor-pointer" onClick={() => navigate('/wallet')}>
|
||||
<div className="w-full flex flex-col max-xl:hidden pl-3 py-2 cursor-pointer" onClick={() => navigate("/wallet")}>
|
||||
<div className="grow flex items-center justify-between">
|
||||
<div className="flex gap-1 items-center text-xl">
|
||||
<Icon name="sats" size={28}/>
|
||||
<FormattedNumber value={balance ?? 0}/>
|
||||
<Icon name="sats" size={28} />
|
||||
<FormattedNumber value={balance ?? 0} />
|
||||
</div>
|
||||
<Icon name="dots" className="text-secondary"/>
|
||||
<Icon name="dots" className="text-secondary" />
|
||||
</div>
|
||||
<div className="text-secondary text-sm">
|
||||
<FormattedMessage defaultMessage="~{amount}" id="3QwfJR" values={msgValues}/>
|
||||
<FormattedMessage defaultMessage="~{amount}" id="3QwfJR" values={msgValues} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user