Skip to content

Commit

Permalink
Resolves SentryWallet counter + spacing fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbartnik committed Jan 16, 2024
1 parent c5faa52 commit 01769ec
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 39 deletions.
21 changes: 4 additions & 17 deletions apps/sentry-client-desktop/src/features/home/SentryWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {accruingStateAtom} from "@/hooks/useAccruingInfo";
import {AssignKeysSentryNotRunning} from "@/components/AssignKeysSentryNotRunning";
import {GrRefresh} from "react-icons/gr";
import {LuListChecks} from "react-icons/lu";
import {useStorage} from "@/features/storage";

// TODO -> replace with dynamic value later
export const recommendedFundingBalance = ethers.parseEther("0.005");
Expand All @@ -50,6 +51,7 @@ export function SentryWallet() {
const [selectedWallet, setSelectedWallet] = useState<string | null>(null);
const [isMoreOptionsOpen, setIsMoreOptionsOpen] = useState<boolean>(false); // dropdown state
const {startRuntime, stopRuntime, sentryRunning, nodeLicenseStatusMap} = useOperatorRuntime();
const {data} = useStorage();


const [isOpen, setIsOpen] = useState<boolean>(false);
Expand Down Expand Up @@ -156,33 +158,18 @@ export function SentryWallet() {
return element;
}


function getWalletCounter() {
let totalKeyLength: number = 0;

new Map([...nodeLicenseStatusMap].filter(([, status]) => {
if (selectedWallet === null) {
return true;
}
return status.ownerPublicKey === selectedWallet;
}))
.forEach((_, key) => {
totalKeyLength += key.toString().length;
});

return (
<>
{owners.length > 0
{nodeLicenseStatusMap.size > 0
? (loading
? ("Loading...")
: (`${totalKeyLength} key${totalKeyLength === 1 ? '' : 's'} in ${owners.length} wallet${owners.length === 1 ? '' : 's'}`))
: (`${nodeLicenseStatusMap.size} key${nodeLicenseStatusMap.size === 1 ? '' : 's'} in ${data?.whitelistedWallets?.length} wallet${data?.whitelistedWallets?.length === 1 ? '' : 's'}`))
: ("No keys")}
</>
);

}


function onCloseWalletConnectedModal() {
setAssignedWallet({show: false, txHash: ""});
setUnassignedWallet({show: false, txHash: ""});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,9 @@ export function ExportSentryDrawer() {
</div>

) : (
<div className="w-full flex flex-col gap-8 mt-12">
<div className="flex flex-col gap-2 px-6 pt-8">

<p className="text-[15px] text-[#525252] mt-2">
<div className="w-full flex flex-col gap-8">
<div className="flex flex-col gap-2 px-6 pt-6">
<p className="text-[15px] text-[#525252]">
By exporting a Sentry Wallet, you can continue running your node on another client
without the need
to leave your local machine on.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import {BiLoaderAlt} from "react-icons/bi";
import {ImportSentryAlertModal} from "@/features/home/modals/ImportSentryAlertModal";
import {verifyPrivateKey} from "@sentry/core";
import {useOperatorRuntime} from "@/hooks/useOperatorRuntime";
import {useStorage} from "@/features/storage";

export function ImportSentryDrawer() {
const setDrawerState = useSetAtom(drawerStateAtom);
const {isLoading, importPrivateKey} = useOperator();
const {stopRuntime} = useOperatorRuntime();
const {data, setData} = useStorage();
const [inputValue, setInputValue] = useState('');
const [showModal, setShowModal] = useState<boolean>(false);
const [privateKeyError, setPrivateKeyError] = useState({
Expand Down Expand Up @@ -54,10 +52,6 @@ export function ImportSentryDrawer() {
if (stopRuntime) {
void stopRuntime()
}
void setData({
...data,
whitelistedWallets: [],
});
});
};

Expand Down Expand Up @@ -88,10 +82,9 @@ export function ImportSentryDrawer() {
</div>

) : (
<div className="w-full flex flex-col gap-8 mt-12">
<div className="flex flex-col gap-2 px-6 pt-8">

<p className="text-[15px] text-[#525252] mt-2">
<div className="w-full flex flex-col gap-8">
<div className="flex flex-col gap-2 px-6 pt-6">
<p className="text-[15px] text-[#525252]">
By importing a Sentry Wallet, you can continue running your node without the need to
leave your local machine on.
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ export function KycRequiredCard({wallet, status}: KycRequiredCardProps) {
title={`KYC required: ${clampAddress(wallet)}`}
/>

<p className="text-[15px] text-[#525252] mt-3">
180 days remaining for esXAI to be claimed
</p>
<Blockpass onClick={onStartKyc}/>
</>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function ViewKeysDrawer() {
<div
className="h-full flex flex-col justify-start items-center">
<div
className="absolute top-0 w-full h-[4rem] flex flex-row justify-between items-center border-b border-gray-200 text-lg font-semibold px-8">
className="w-full h-[4rem] flex flex-row justify-between items-center border-b border-gray-200 text-lg font-semibold px-8">
<span>View keys in wallet</span>
<div className="cursor-pointer z-10" onClick={() => setDrawerState(null)}>
<AiOutlineClose/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ export function ViewKeysFlow() {
if (!loading && !success) {
return (
<div>
<div className="w-full flex flex-col gap-8 mt-12">
<div className="flex flex-col gap-2 px-6 pt-8">
<p className="text-[15px] text-[#525252] mt-2">
<div className="w-full flex flex-col gap-8">
<div className="flex flex-col gap-2 px-6 pt-6">
<p className="text-[15px] text-[#525252]">
Enter the the public key of the wallet you want to view keys for
</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export function BuyKeysFlow() {
<div className="relative w-full h-screen flex flex-col gap-8">
{/* Top of buy */}
<div className="flex flex-col gap-8">

<div className="flex flex-col gap-2 px-6 pt-8">
<div className="flex flex-row items-center gap-2">
<span className="flex gap-3 items-center text-lg font-semibold">
Expand Down

0 comments on commit 01769ec

Please sign in to comment.