Skip to content

Commit 600e279

Browse files
chore: update sdk core version - 2.0.10
1 parent e176ef3 commit 600e279

File tree

4 files changed

+51
-50
lines changed

4 files changed

+51
-50
lines changed

packages/ui-kit/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pushchain/ui-kit",
3-
"version": "2.0.6",
3+
"version": "2.0.10",
44
"homepage": "https://push.org",
55
"keywords": [
66
"pushchain",
@@ -19,7 +19,7 @@
1919
"dependencies": {
2020
"@coral-xyz/anchor": "^0.31.1",
2121
"@metamask/sdk": "^0.32.0",
22-
"@pushchain/core": "2.0.8",
22+
"@pushchain/core": "2.0.10",
2323
"@solana/web3.js": "^1.98.2",
2424
"@walletconnect/ethereum-provider": "^2.21.5",
2525
"buffer": "^6.0.3",

packages/ui-kit/src/lib/components/PushUniversalAccountButton/index.tsx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,23 @@ interface CustomTheme extends DefaultTheme {
2626
themeMode: string;
2727
}
2828

29+
const GlobalStyle = createGlobalStyle<{ uid: string }>`
30+
[data-pw-wrapper='${(props) => props.uid}']{
31+
${(props) => {
32+
const { themeOverrides, themeMode } = props.theme as CustomTheme;
33+
const isLightMode = themeMode === 'light';
34+
const { dark, light, ...globalOverrides } = themeOverrides;
35+
const newTokens = {
36+
...mapButtonCoreToInt(globalOverrides),
37+
...mapButtonCoreToInt((isLightMode ? light : dark) ?? {}),
38+
};
39+
return Object.entries(newTokens)
40+
.map(([key, value]) => `${key}: ${value};`)
41+
.join('\n');
42+
}}
43+
}
44+
`;
45+
2946
const PushUniversalAccountButton: FC<PushUniversalAccountButtonProps> = ({
3047
uid = 'default',
3148
connectButtonText = 'Connect Account',
@@ -42,23 +59,6 @@ const PushUniversalAccountButton: FC<PushUniversalAccountButtonProps> = ({
4259
updateWalletAppData,
4360
} = usePushWalletContext(uid);
4461

45-
const GlobalStyle = createGlobalStyle<{ uid: string }>`
46-
[data-pw-wrapper='${(props) => props.uid}']{
47-
${(props) => {
48-
const { themeOverrides, themeMode } = props.theme as CustomTheme;
49-
const isLightMode = themeMode === 'light';
50-
const { dark, light, ...globalOverrides } = themeOverrides;
51-
const newTokens = {
52-
...mapButtonCoreToInt(globalOverrides),
53-
...mapButtonCoreToInt((isLightMode ? light : dark) ?? {}),
54-
};
55-
return Object.entries(newTokens)
56-
.map(([key, value]) => `${key}: ${value};`)
57-
.join('\n');
58-
}}
59-
}
60-
`;
61-
6262
useEffect(() => {
6363
if (modalAppOverride) updateModalAppData(modalAppOverride);
6464
if (loginAppOverride) updateWalletAppData(loginAppOverride);

packages/ui-kit/src/lib/providers/PushWalletProvider.tsx

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -42,39 +42,40 @@ const PushWalletConfigDefault: ProviderConfigProps = {
4242
},
4343
};
4444

45+
const GlobalStyle = createGlobalStyle<{ uid: string }>`
46+
[data-pw-wrapper='${(props) => props.uid}']{
47+
#w3m-modal {
48+
z-index: 9999 !important;
49+
position: fixed !important;
50+
}
51+
52+
${(props) => {
53+
const { themeMode, themeOverrides } = props.theme as CustomTheme;
54+
const isLightMode = themeMode === PushUI.CONSTANTS.THEME.LIGHT;
55+
const { dark, light, ...globalOverrides } = themeOverrides;
56+
const newOverrides = {
57+
...{
58+
...themeDefault,
59+
...buttonThemeDefault,
60+
...(isLightMode ? lightThemeDefault : darkThemeDefault),
61+
},
62+
...mapCoreToInt(globalOverrides),
63+
...mapCoreToInt((isLightMode ? light : dark) ?? {}),
64+
};
65+
return Object.entries(newOverrides)
66+
.map(([key, value]) => `${key}: ${value};`)
67+
.join('\n');
68+
}}
69+
}
70+
`;
71+
4572
export const PushUniversalWalletProvider: FC<PushWalletProviderProps> = ({
4673
config,
4774
app,
4875
themeMode = PushUI.CONSTANTS.THEME.LIGHT,
4976
themeOverrides = {},
5077
children,
5178
}) => {
52-
const GlobalStyle = createGlobalStyle<{ uid: string }>`
53-
[data-pw-wrapper='${(props) => props.uid}']{
54-
#w3m-modal {
55-
z-index: 9999 !important;
56-
position: fixed !important;
57-
}
58-
59-
${(props) => {
60-
const { themeMode, themeOverrides } = props.theme as CustomTheme;
61-
const isLightMode = themeMode === PushUI.CONSTANTS.THEME.LIGHT;
62-
const { dark, light, ...globalOverrides } = themeOverrides;
63-
const newOverrides = {
64-
...{
65-
...themeDefault,
66-
...buttonThemeDefault,
67-
...(isLightMode ? lightThemeDefault : darkThemeDefault),
68-
},
69-
...mapCoreToInt(globalOverrides),
70-
...mapCoreToInt((isLightMode ? light : dark) ?? {}),
71-
};
72-
return Object.entries(newOverrides)
73-
.map(([key, value]) => `${key}: ${value};`)
74-
.join('\n');
75-
}}
76-
}
77-
`;
7879

7980
const mergedConfig: ProviderConfigProps = {
8081
...PushWalletConfigDefault,

packages/ui-kit/yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -783,9 +783,9 @@ __metadata:
783783
languageName: node
784784
linkType: hard
785785

786-
"@pushchain/core@npm:2.0.8":
787-
version: 2.0.8
788-
resolution: "@pushchain/core@npm:2.0.8"
786+
"@pushchain/core@npm:2.0.10":
787+
version: 2.0.10
788+
resolution: "@pushchain/core@npm:2.0.10"
789789
dependencies:
790790
"@bufbuild/protobuf": "npm:^2.0.0"
791791
"@coral-xyz/anchor": "npm:^0.31.0"
@@ -802,7 +802,7 @@ __metadata:
802802
tslib: "npm:^2.3.0"
803803
tweetnacl: "npm:^1.0.3"
804804
viem: "npm:2.27.2"
805-
checksum: 10/766ca3786aaea3693f2ce2df8e184fdaeda765202fedbbdd69b82abdf51e40ebc43e78ad030872304aff65d16e13d52fc19ffca92cdcd937074ca1ed40640b70
805+
checksum: 10/ecbe937b3d4bbffaac07df9e89a94482fb7cb6f1c12547fbb474ab1dc52272767017bc5d705f82240c7e404a7547e6fb64c91adee44187e0af274ffc3118aaa0
806806
languageName: node
807807
linkType: hard
808808

@@ -812,7 +812,7 @@ __metadata:
812812
dependencies:
813813
"@coral-xyz/anchor": "npm:^0.31.1"
814814
"@metamask/sdk": "npm:^0.32.0"
815-
"@pushchain/core": "npm:2.0.8"
815+
"@pushchain/core": "npm:2.0.10"
816816
"@solana/web3.js": "npm:^1.98.2"
817817
"@types/react": "npm:^18.3.13"
818818
"@types/react-is": "npm:^19"

0 commit comments

Comments
 (0)