Skip to content

Commit bbe32fd

Browse files
committed
Merge remote-tracking branch 'origin/develop' into editaahn/refactor-modular-merge
2 parents d369ff5 + 6d1a050 commit bbe32fd

File tree

50 files changed

+549
-561
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+549
-561
lines changed

apps/extension/package.json

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@keplr-wallet/extension",
3-
"version": "0.12.297",
3+
"version": "0.12.299",
44
"author": "chainapsis",
55
"license": "Apache-2.0",
66
"private": true,
@@ -26,34 +26,34 @@
2626
"@ethersproject/transactions": "^5.7.0",
2727
"@floating-ui/react": "^0.23.0",
2828
"@floating-ui/react-dom": "^1.3.0",
29-
"@keplr-wallet/analytics": "0.12.297",
30-
"@keplr-wallet/background": "0.12.297",
31-
"@keplr-wallet/chain-validator": "0.12.297",
32-
"@keplr-wallet/common": "0.12.297",
33-
"@keplr-wallet/cosmos": "0.12.297",
34-
"@keplr-wallet/crypto": "0.12.297",
35-
"@keplr-wallet/hooks": "0.12.297",
36-
"@keplr-wallet/hooks-bitcoin": "0.12.297",
37-
"@keplr-wallet/hooks-internal": "0.12.297",
38-
"@keplr-wallet/hooks-starknet": "0.12.297",
39-
"@keplr-wallet/ledger-cosmos": "0.12.297",
40-
"@keplr-wallet/popup": "0.12.297",
41-
"@keplr-wallet/proto-types": "0.12.297",
42-
"@keplr-wallet/provider": "0.12.297",
43-
"@keplr-wallet/router": "0.12.297",
44-
"@keplr-wallet/router-extension": "0.12.297",
45-
"@keplr-wallet/simple-fetch": "0.12.297",
46-
"@keplr-wallet/stores": "0.12.297",
47-
"@keplr-wallet/stores-bitcoin": "0.12.297",
48-
"@keplr-wallet/stores-core": "0.12.297",
49-
"@keplr-wallet/stores-etc": "0.12.297",
50-
"@keplr-wallet/stores-eth": "0.12.297",
51-
"@keplr-wallet/stores-ibc": "0.12.297",
52-
"@keplr-wallet/stores-internal": "0.12.297",
53-
"@keplr-wallet/stores-starknet": "0.12.297",
54-
"@keplr-wallet/topup-client": "0.12.297",
55-
"@keplr-wallet/types": "0.12.297",
56-
"@keplr-wallet/unit": "0.12.297",
29+
"@keplr-wallet/analytics": "0.12.299",
30+
"@keplr-wallet/background": "0.12.299",
31+
"@keplr-wallet/chain-validator": "0.12.299",
32+
"@keplr-wallet/common": "0.12.299",
33+
"@keplr-wallet/cosmos": "0.12.299",
34+
"@keplr-wallet/crypto": "0.12.299",
35+
"@keplr-wallet/hooks": "0.12.299",
36+
"@keplr-wallet/hooks-bitcoin": "0.12.299",
37+
"@keplr-wallet/hooks-internal": "0.12.299",
38+
"@keplr-wallet/hooks-starknet": "0.12.299",
39+
"@keplr-wallet/ledger-cosmos": "0.12.299",
40+
"@keplr-wallet/popup": "0.12.299",
41+
"@keplr-wallet/proto-types": "0.12.299",
42+
"@keplr-wallet/provider": "0.12.299",
43+
"@keplr-wallet/router": "0.12.299",
44+
"@keplr-wallet/router-extension": "0.12.299",
45+
"@keplr-wallet/simple-fetch": "0.12.299",
46+
"@keplr-wallet/stores": "0.12.299",
47+
"@keplr-wallet/stores-bitcoin": "0.12.299",
48+
"@keplr-wallet/stores-core": "0.12.299",
49+
"@keplr-wallet/stores-etc": "0.12.299",
50+
"@keplr-wallet/stores-eth": "0.12.299",
51+
"@keplr-wallet/stores-ibc": "0.12.299",
52+
"@keplr-wallet/stores-internal": "0.12.299",
53+
"@keplr-wallet/stores-starknet": "0.12.299",
54+
"@keplr-wallet/topup-client": "0.12.299",
55+
"@keplr-wallet/types": "0.12.299",
56+
"@keplr-wallet/unit": "0.12.299",
5757
"@keystonehq/animated-qr": "^0.8.6",
5858
"@keystonehq/hw-app-base": "0.1.1",
5959
"@keystonehq/hw-transport-webusb": "0.4.0",

apps/extension/src/components/modal/modal.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { ModalProps } from "./types";
1515
import Color from "color";
1616
import SimpleBar from "simplebar-react";
1717
import { ColorPalette } from "../../styles";
18+
import { useTheme } from "styled-components";
1819

1920
const AnimatedSimpleBar = animated(SimpleBar);
2021

@@ -133,6 +134,7 @@ const ModalChild: FunctionComponent<
133134
forceNotOverflowAuto,
134135
disableBackdrop,
135136
}) => {
137+
const theme = useTheme();
136138
const onCloseTransitionEndRef = useRef(onCloseTransitionEnd);
137139
onCloseTransitionEndRef.current = onCloseTransitionEnd;
138140
useLayoutEffect(() => {
@@ -204,7 +206,11 @@ const ModalChild: FunctionComponent<
204206
backgroundColor: disableBackdrop
205207
? "rgba(0,0,0,0)"
206208
: transition.to((t) =>
207-
Color(ColorPalette["gray-550"])
209+
Color(
210+
theme.mode === "light"
211+
? ColorPalette["gray-550"]
212+
: ColorPalette["gray-700"]
213+
)
208214
.alpha(t * 0.55)
209215
.string()
210216
),

apps/extension/src/config.ts

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3952,6 +3952,65 @@ export const EmbedChainInfos: (ChainInfo | ModularChainInfo)[] = [
39523952
],
39533953
features: [],
39543954
},
3955+
{
3956+
chainId: "zigchain-1",
3957+
chainName: "ZIGChain",
3958+
chainSymbolImageUrl:
3959+
"https://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/zigchain/chain.png",
3960+
rpc: "https://rpc-zigchain.keplr.app",
3961+
rest: "https://lcd-zigchain.keplr.app",
3962+
bip44: { coinType: 118 },
3963+
bech32Config: {
3964+
bech32PrefixAccAddr: "zig",
3965+
bech32PrefixAccPub: "zigpub",
3966+
bech32PrefixValAddr: "zigvaloper",
3967+
bech32PrefixValPub: "zigvaloperpub",
3968+
bech32PrefixConsAddr: "zigvalcons",
3969+
bech32PrefixConsPub: "zigvalconspub",
3970+
},
3971+
currencies: [
3972+
{
3973+
coinDenom: "ZIG",
3974+
coinMinimalDenom: "uzig",
3975+
coinDecimals: 6,
3976+
coinGeckoId: "zignaly",
3977+
coinImageUrl:
3978+
"https://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/zigchain/uzig.png",
3979+
},
3980+
{
3981+
coinDenom: "stzig",
3982+
coinMinimalDenom:
3983+
"coin.zig109f7g2rzl2aqee7z6gffn8kfe9cpqx0mjkk7ethmx8m2hq4xpe9snmaam2.stzig",
3984+
coinDecimals: 6,
3985+
coinImageUrl:
3986+
"https://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/zigchain/stzig.png",
3987+
},
3988+
],
3989+
feeCurrencies: [
3990+
{
3991+
coinDenom: "ZIG",
3992+
coinMinimalDenom: "uzig",
3993+
coinDecimals: 6,
3994+
coinGeckoId: "zignaly",
3995+
coinImageUrl:
3996+
"https://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/zigchain/uzig.png",
3997+
gasPriceStep: {
3998+
low: 0.0025,
3999+
average: 0.025,
4000+
high: 0.05,
4001+
},
4002+
},
4003+
],
4004+
stakeCurrency: {
4005+
coinDenom: "ZIG",
4006+
coinMinimalDenom: "uzig",
4007+
coinDecimals: 6,
4008+
coinGeckoId: "zignaly",
4009+
coinImageUrl:
4010+
"https://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/zigchain/uzig.png",
4011+
},
4012+
features: ["cosmwasm"],
4013+
},
39554014
];
39564015

39574016
// The origins that are able to pass any permission that external webpages can have.

apps/extension/src/hooks/use-rewards.ts

Lines changed: 7 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect, useMemo, useRef, useState } from "react";
1+
import { useMemo } from "react";
22
import { ViewToken } from "../pages/main";
33
import { useStore } from "../stores";
44
import {
@@ -34,8 +34,6 @@ const USDN_CURRENCY = {
3434

3535
const zeroDec = new Dec(0);
3636

37-
const homeRewardsSuppressedByKeyId = new Set<string>();
38-
3937
export function useRewards() {
4038
const {
4139
chainStore,
@@ -53,11 +51,6 @@ export function useRewards() {
5351
useStarknetClaimRewards();
5452

5553
const { states, getClaimAllEachState } = useClaimAllEachState();
56-
const prevSelectedKeyIdRef = useRef(keyRingStore.selectedKeyInfo?.id);
57-
const keyId = keyRingStore.selectedKeyInfo?.id ?? "unknown";
58-
59-
const [claimAllIsCompleted, setClaimAllIsCompleted] = useState(false);
60-
const [claimAllIsLoading, setClaimAllIsLoading] = useState(false);
6154

6255
const viewClaimTokens: ViewClaimToken[] = (() => {
6356
const res: ViewClaimToken[] = [];
@@ -240,10 +233,6 @@ export function useRewards() {
240233

241234
const claimAll = () => {
242235
analyticsStore.logEvent("click_claimAll");
243-
homeRewardsSuppressedByKeyId.delete(keyId);
244-
245-
setClaimAllIsCompleted(false);
246-
setClaimAllIsLoading(true);
247236

248237
for (const viewClaimToken of viewClaimTokens) {
249238
const state = getClaimAllEachState(
@@ -300,7 +289,7 @@ export function useRewards() {
300289
return count;
301290
}, [viewClaimTokens, getClaimAllEachState]);
302291

303-
const hasAnyInProgress = useMemo(() => {
292+
const claimAllIsLoading = useMemo(() => {
304293
for (const viewClaimToken of viewClaimTokens) {
305294
const state = getClaimAllEachState(
306295
viewClaimToken.modularChainInfo.chainId
@@ -312,100 +301,9 @@ export function useRewards() {
312301
return false;
313302
}, [viewClaimTokens, getClaimAllEachState]);
314303

315-
useEffect(() => {
316-
setClaimAllIsLoading(hasAnyInProgress);
317-
}, [hasAnyInProgress]);
318-
319-
useEffect(() => {
320-
if (homeRewardsSuppressedByKeyId.has(keyId)) {
321-
setClaimAllIsCompleted(false);
322-
return;
323-
}
324-
setClaimAllIsCompleted(
325-
totalClaimTokenCount > 0 && finishedCount === totalClaimTokenCount
326-
);
327-
}, [finishedCount, totalClaimTokenCount, keyId]);
328-
329-
const [count, setCount] = useState(0);
330-
331-
const claimCountText = useMemo(() => {
332-
if (totalClaimTokenCount === 0) {
333-
return "";
334-
}
335-
336-
return `${succeededCount}/${totalClaimTokenCount}`;
337-
}, [succeededCount, totalClaimTokenCount]);
338-
339-
useEffect(() => {
340-
if (keyRingStore.selectedKeyInfo?.id !== prevSelectedKeyIdRef.current) {
341-
return;
342-
}
343-
344-
if (!claimAllIsCompleted) {
345-
return;
346-
}
347-
348-
setCount(6);
349-
350-
const interval = setInterval(() => {
351-
setCount((prev) => {
352-
if (prev <= 1) {
353-
clearInterval(interval);
354-
setClaimAllIsCompleted(false);
355-
return 0;
356-
}
357-
return prev - 1;
358-
});
359-
}, 1000);
360-
361-
return () => {
362-
setCount(0);
363-
clearInterval(interval);
364-
setClaimAllIsCompleted(false);
365-
};
366-
// eslint-disable-next-line react-hooks/exhaustive-deps
367-
}, [claimAllIsCompleted]);
368-
369-
useEffect(() => {
370-
if (keyRingStore.selectedKeyInfo?.id !== prevSelectedKeyIdRef.current) {
371-
setClaimAllIsLoading(false);
372-
setClaimAllIsCompleted(false);
373-
setCount(0);
374-
for (const s of states) {
375-
s.reset();
376-
}
377-
prevSelectedKeyIdRef.current = keyRingStore.selectedKeyInfo?.id;
378-
homeRewardsSuppressedByKeyId.delete(keyId);
379-
}
380-
// eslint-disable-next-line react-hooks/exhaustive-deps
381-
}, [keyRingStore.selectedKeyInfo?.id]);
382-
383-
const claimAllIsCompletedRef = useRef(claimAllIsCompleted);
384-
const countRef = useRef(count);
385-
const keyIdRef = useRef(keyId);
386-
387-
// complete 되고 다른 페이지로 이동할 경우에만 UI상태를 초기화 하기 위해서 참조를 유지한다.
388-
useEffect(() => {
389-
claimAllIsCompletedRef.current = claimAllIsCompleted;
390-
}, [claimAllIsCompleted]);
391-
392-
useEffect(() => {
393-
countRef.current = count;
394-
}, [count]);
395-
396-
useEffect(() => {
397-
keyIdRef.current = keyId;
398-
}, [keyId]);
399-
400-
useEffect(() => {
401-
return () => {
402-
if (claimAllIsCompletedRef.current && countRef.current > 0) {
403-
homeRewardsSuppressedByKeyId.add(keyIdRef.current);
404-
setCount(0);
405-
setClaimAllIsCompleted(false);
406-
}
407-
};
408-
}, []);
304+
const claimAllIsCompleted = useMemo(() => {
305+
return totalClaimTokenCount > 0 && finishedCount === totalClaimTokenCount;
306+
}, [finishedCount, totalClaimTokenCount]);
409307

410308
return {
411309
viewClaimTokens,
@@ -418,7 +316,7 @@ export function useRewards() {
418316
claimAllIsCompleted,
419317
getClaimAllEachState,
420318
states,
421-
count,
422-
claimCountText,
319+
succeededCount,
320+
totalClaimTokenCount,
423321
};
424322
}

apps/extension/src/manifest.v2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
"name": "Keplr",
55
"description": "Keplr is a browser extension wallet for the Inter blockchain ecosystem.",
6-
"version": "0.12.297",
6+
"version": "0.12.299",
77
"icons": {
88
"16": "assets/icon-16.png",
99
"48": "assets/icon-48.png",

apps/extension/src/manifest.v3.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
"name": "Keplr",
55
"description": "Keplr is a browser extension wallet for the Inter blockchain ecosystem.",
6-
"version": "0.12.297",
6+
"version": "0.12.299",
77
"icons": {
88
"16": "assets/icon-16.png",
99
"48": "assets/icon-48.png",

apps/extension/src/pages/main/components/account-switch-float-modal/account-item.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { ColorPalette } from "../../../../styles";
44
import { Body3, Caption2, Subtitle4 } from "../../../../components/typography";
55
import { KeyInfo } from "@keplr-wallet/background";
66
import { observer } from "mobx-react-lite";
7-
import { Tooltip } from "../../../../components/tooltip";
87
import { EllipsisIcon } from "../../../../components/icon";
98
import { XAxis, YAxis } from "../../../../components/axis";
109
import { Image } from "../../../../components/image";
@@ -24,6 +23,7 @@ import { useGetKeyInfoParagraph } from "../../../../hooks/key-info";
2423
import { useGetIcnsName } from "../../../../hooks/use-get-icns-name";
2524
import { ContextMenuStyles } from "../../../../components/context-menu";
2625
import { AccountNameIcon } from "../account-icon";
26+
import { PortalTooltip } from "../../../../components/tooltip/portal";
2727

2828
const Styles = {
2929
AccountItem: styled.div<{ isSelected: boolean }>`
@@ -218,14 +218,14 @@ export const AccountItemSwitchModal = observer(
218218
{icnsPrimaryName && (
219219
<React.Fragment>
220220
<Gutter size="0.375rem" />
221-
<Tooltip
221+
<PortalTooltip
222222
hideArrow={true}
223223
content={
224224
<Caption2 color={ColorPalette["white"]}>
225225
{icnsPrimaryName}
226226
</Caption2>
227227
}
228-
allowedPlacements={["top", "bottom", "right"]}
228+
allowedPlacements={["top"]}
229229
>
230230
<Image
231231
alt="icns-icon"
@@ -238,7 +238,7 @@ export const AccountItemSwitchModal = observer(
238238
opacity: isSelected ? COMMON_HOVER_OPACITY : 1,
239239
}}
240240
/>
241-
</Tooltip>
241+
</PortalTooltip>
242242
</React.Fragment>
243243
)}
244244
</XAxis>

0 commit comments

Comments
 (0)