Skip to content

Commit

Permalink
Merge branch 'chainapsis:master' into SN-1.15-support
Browse files Browse the repository at this point in the history
  • Loading branch information
iKapitonau authored Oct 17, 2024
2 parents 318c0db + fde3f61 commit 20e1021
Show file tree
Hide file tree
Showing 213 changed files with 16,430 additions and 2,250 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
publish:
name: Publish to npm and create release
runs-on: ubuntu-20.04
runs-on: ubuntu-20.04-l
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
check-firefox-archive:
name: Test that docker can produce the same result for firefox
needs: [publish]
runs-on: ubuntu-20.04
runs-on: ubuntu-20.04-l
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
Expand Down
53 changes: 28 additions & 25 deletions apps/extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@keplr-wallet/extension",
"version": "0.12.130",
"version": "0.12.140",
"author": "chainapsis",
"license": "Apache-2.0",
"private": true,
Expand All @@ -26,29 +26,31 @@
"@ethersproject/transactions": "^5.7.0",
"@floating-ui/react": "^0.23.0",
"@floating-ui/react-dom": "^1.3.0",
"@keplr-wallet/analytics": "0.12.130",
"@keplr-wallet/background": "0.12.130",
"@keplr-wallet/chain-validator": "0.12.130",
"@keplr-wallet/common": "0.12.130",
"@keplr-wallet/cosmos": "0.12.130",
"@keplr-wallet/crypto": "0.12.130",
"@keplr-wallet/hooks": "0.12.130",
"@keplr-wallet/hooks-internal": "0.12.130",
"@keplr-wallet/ledger-cosmos": "0.12.130",
"@keplr-wallet/popup": "0.12.130",
"@keplr-wallet/proto-types": "0.12.130",
"@keplr-wallet/provider": "0.12.130",
"@keplr-wallet/router": "0.12.130",
"@keplr-wallet/router-extension": "0.12.130",
"@keplr-wallet/simple-fetch": "0.12.130",
"@keplr-wallet/stores": "0.12.130",
"@keplr-wallet/stores-core": "0.12.130",
"@keplr-wallet/stores-etc": "0.12.130",
"@keplr-wallet/stores-eth": "0.12.130",
"@keplr-wallet/stores-ibc": "0.12.130",
"@keplr-wallet/stores-internal": "0.12.130",
"@keplr-wallet/types": "0.12.130",
"@keplr-wallet/unit": "0.12.130",
"@keplr-wallet/analytics": "0.12.140",
"@keplr-wallet/background": "0.12.140",
"@keplr-wallet/chain-validator": "0.12.140",
"@keplr-wallet/common": "0.12.140",
"@keplr-wallet/cosmos": "0.12.140",
"@keplr-wallet/crypto": "0.12.140",
"@keplr-wallet/hooks": "0.12.140",
"@keplr-wallet/hooks-internal": "0.12.140",
"@keplr-wallet/hooks-starknet": "0.12.140",
"@keplr-wallet/ledger-cosmos": "0.12.140",
"@keplr-wallet/popup": "0.12.140",
"@keplr-wallet/proto-types": "0.12.140",
"@keplr-wallet/provider": "0.12.140",
"@keplr-wallet/router": "0.12.140",
"@keplr-wallet/router-extension": "0.12.140",
"@keplr-wallet/simple-fetch": "0.12.140",
"@keplr-wallet/stores": "0.12.140",
"@keplr-wallet/stores-core": "0.12.140",
"@keplr-wallet/stores-etc": "0.12.140",
"@keplr-wallet/stores-eth": "0.12.140",
"@keplr-wallet/stores-ibc": "0.12.140",
"@keplr-wallet/stores-internal": "0.12.140",
"@keplr-wallet/stores-starknet": "0.12.140",
"@keplr-wallet/types": "0.12.140",
"@keplr-wallet/unit": "0.12.140",
"@keystonehq/animated-qr": "^0.8.6",
"@keystonehq/keystone-sdk": "^0.2.3",
"@ledgerhq/devices": "^6.20.0",
Expand Down Expand Up @@ -142,6 +144,7 @@
"mobx-react-lite": "^3",
"mobx-utils": "^6",
"react": "^16.8.0 || ^17 || ^18",
"react-dom": "^16.8.0 || ^17 || ^18"
"react-dom": "^16.8.0 || ^17 || ^18",
"starknet": "^6"
}
}
2 changes: 2 additions & 0 deletions apps/extension/src/bottom-tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ export const BottomTabsRouteProvider: FunctionComponent<
flexDirection: "row",
alignItems: "center",
justifyContent: "space-evenly",

zIndex: 999999,
}}
>
{tabs.map((tab, i) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ export const CollapsibleList: FunctionComponent<CollapsibleListProps> = ({
lenAlwaysShown,
hideNumInTitle,
notRenderHiddenItems,
altViewMoreIntlTextId,
onCollapse,
}) => {
if (!lenAlwaysShown || lenAlwaysShown < 0) {
lenAlwaysShown = items.length;
Expand Down Expand Up @@ -106,6 +108,9 @@ export const CollapsibleList: FunctionComponent<CollapsibleListProps> = ({
e.preventDefault();

setIsCollapsed(!isCollapsed);
if (onCollapse) {
onCollapse(!isCollapsed);
}
if (!isCollapsed) {
setNotRenderHiddenItemsIsClosing(true);
}
Expand All @@ -116,7 +121,11 @@ export const CollapsibleList: FunctionComponent<CollapsibleListProps> = ({
<Button2>
{isCollapsed
? intl.formatMessage(
{ id: "components.collapsible-list.view-more-tokens" },
{
id:
altViewMoreIntlTextId ||
"components.collapsible-list.view-more-tokens",
},
{ remain: hidden.length }
)
: intl.formatMessage({
Expand Down
4 changes: 4 additions & 0 deletions apps/extension/src/components/collapsible-list/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@ export interface CollapsibleListProps {
// 이걸 키면 리스트가 길때 성능이 조금 더 좋아진다.
// 하지만 부작용으로 펼칠때는 트랜지션없이 즉각적으로 펼쳐진다.
notRenderHiddenItems?: boolean;

altViewMoreIntlTextId?: string;

onCollapse?: (isCollapsed: boolean) => void;
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,13 @@ export const ContractAddressBookModal: FunctionComponent<{
onSelect: (address: string) => void;
close: () => void;
}> = observer(({ isOpen, chainId, onSelect, close }) => {
const { queriesStore } = useStore();
const { chainStore, queriesStore, starknetQueriesStore } = useStore();

const contracts =
queriesStore.get(chainId).tokenContracts.queryTokenContracts.tokenContracts;
"cosmos" in chainStore.getModularChain(chainId)
? queriesStore.get(chainId).tokenContracts.queryTokenContracts
.tokenContracts
: starknetQueriesStore.get(chainId).queryTokenContracts.tokenContracts;

const [search, setSearch] = useState("");
const searchRef = useFocusOnMount<HTMLInputElement>();
Expand Down
39 changes: 26 additions & 13 deletions apps/extension/src/components/dropdown/dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const Dropdown: FunctionComponent<DropdownProps> = ({
menuContainerMaxHeight,
allowSearch,
searchExcludedKeys,
direction = "down",
}) => {
const [isOpen, setIsOpen] = React.useState(false);
const wrapperRef = useRef<HTMLInputElement>(null);
Expand Down Expand Up @@ -124,24 +125,36 @@ export const Dropdown: FunctionComponent<DropdownProps> = ({
</Styles.Text>
</Box>
<Column weight={1} />
<ArrowDropDownIcon width="1.25rem" height="1.25rem" />
<Box
style={{
transform: direction === "up" ? "scaleY(-1)" : undefined,
}}
>
<ArrowDropDownIcon width="1.25rem" height="1.25rem" />
</Box>
</Columns>
</Styles.SelectedContainer>
<Styles.MenuContainer isOpen={isOpen && filteredItems.length > 0}>
<Styles.MenuContainer
isOpen={isOpen && filteredItems.length > 0}
direction={direction}
size={size}
>
<Styles.MenuContainerScroll
menuContainerMaxHeight={menuContainerMaxHeight}
>
{filteredItems.map((item) => (
<Styles.MenuItem
key={item.key}
onClick={() => {
onSelect(item.key);
setIsOpen(false);
}}
>
{item.label}
</Styles.MenuItem>
))}
<Styles.MenuItemsContainer direction={direction}>
{filteredItems.map((item) => (
<Styles.MenuItem
key={item.key}
onClick={() => {
onSelect(item.key);
setIsOpen(false);
}}
>
{item.label}
</Styles.MenuItem>
))}
</Styles.MenuItemsContainer>
</Styles.MenuContainerScroll>
</Styles.MenuContainer>
</Styles.Container>
Expand Down
29 changes: 28 additions & 1 deletion apps/extension/src/components/dropdown/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ export const Styles = {
position: relative;
`,

DropdownContainer: styled.div<{
direction: "up" | "down";
}>`
display: flex;
flex-direction: ${(props) =>
props.direction === "down" ? "column" : "column-reverse"};
position: relative;
`,

SelectedContainer: styled.div<{
isOpen: boolean;
size: string;
Expand Down Expand Up @@ -68,6 +77,8 @@ export const Styles = {
`,
MenuContainer: styled.div.withConfig<{
isOpen: boolean;
direction: "up" | "down";
size: string;
}>({
shouldForwardProp: (prop) => {
if (prop === "isOpen") {
Expand All @@ -77,10 +88,19 @@ export const Styles = {
},
})`
position: absolute;
${({ direction, size }) =>
direction === "down"
? ""
: size === "small"
? "bottom: 2.5rem;"
: "bottom: 3.25rem;"}
width: 100%;
margin-top: 0.375rem;
${({ direction }) =>
direction === "down"
? "margin-top: 0.375rem"
: "margin-bottom: 0.375rem"};
z-index: 1;
Expand Down Expand Up @@ -115,6 +135,13 @@ export const Styles = {
}
}};
`,

MenuItemsContainer: styled.div<{ direction: "up" | "down" }>`
display: flex;
flex-direction: ${({ direction }) =>
direction === "down" ? "column" : "column-reverse"};
`,

MenuContainerScroll: styled(SimpleBar).withConfig<{
menuContainerMaxHeight?: string;
}>({
Expand Down
2 changes: 2 additions & 0 deletions apps/extension/src/components/dropdown/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ export interface DropdownProps {

allowSearch?: boolean;
searchExcludedKeys?: string[];

direction?: "up" | "down";
}
9 changes: 5 additions & 4 deletions apps/extension/src/components/image/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, { FunctionComponent, useLayoutEffect, useState } from "react";
import { AppCurrency, ChainInfo } from "@keplr-wallet/types";
import { AppCurrency, ChainInfo, ModularChainInfo } from "@keplr-wallet/types";
import { observer } from "mobx-react-lite";
import { useStore } from "../../stores";
import { ChainIdHelper } from "@keplr-wallet/cosmos";

/**
* 그냥 이미지 컴포넌트인데 오류 났을때 대체 이미지를 보여주는 기능이 있음
Expand Down Expand Up @@ -71,7 +72,7 @@ export const RawImageFallback: FunctionComponent<

export const ChainImageFallback: FunctionComponent<
Omit<React.ImgHTMLAttributes<HTMLImageElement>, "src" | "alt"> & {
chainInfo: ChainInfo;
chainInfo: ChainInfo | ModularChainInfo;

size: string;
alt?: string;
Expand Down Expand Up @@ -105,7 +106,7 @@ export const ChainImageFallback: FunctionComponent<

export const CurrencyImageFallback: FunctionComponent<
Omit<React.ImgHTMLAttributes<HTMLImageElement>, "src" | "alt"> & {
chainInfo: ChainInfo;
chainInfo: ChainInfo | ModularChainInfo;
currency: AppCurrency;

size: string;
Expand Down Expand Up @@ -167,7 +168,7 @@ export const CurrencyImageFallback: FunctionComponent<
}
} else {
if (
chainStore.getChain(chainInfo.chainId).chainIdentifier ===
ChainIdHelper.parse(chainInfo.chainId).identifier ===
axelarChainIdentifier &&
currency.coinMinimalDenom !== "uaxl"
) {
Expand Down
Loading

0 comments on commit 20e1021

Please sign in to comment.