Skip to content

Commit b5f8fe0

Browse files
committed
feat: update button styles
1 parent 66b1320 commit b5f8fe0

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

packages/web3/src/connect-button/connect-button.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,6 @@ export const ConnectButton: React.FC<ConnectButtonProps> = (props) => {
164164
);
165165
}
166166

167-
const unsigned = needSign && !signed;
168-
169-
console.log('unsigned:', unsigned, account?.status);
170-
171167
const buttonInnerText = (
172168
<div className={`${prefixCls}-content`}>
173169
<div className={`${prefixCls}-content-inner`}>
@@ -185,8 +181,6 @@ export const ConnectButton: React.FC<ConnectButtonProps> = (props) => {
185181
</div>
186182
);
187183

188-
console.log('signIn:', typeof sign?.signIn, account?.status);
189-
190184
const buttonContent = (
191185
<ConnectButtonInner
192186
intl={intl}
@@ -207,7 +201,6 @@ export const ConnectButton: React.FC<ConnectButtonProps> = (props) => {
207201
return;
208202
}
209203

210-
console.log('onSignInClick:', account, needSign, signed);
211204
if (signed) {
212205
return;
213206
}
@@ -219,14 +212,12 @@ export const ConnectButton: React.FC<ConnectButtonProps> = (props) => {
219212

220213
// If account is not connected, we need to sign in
221214
// If account is connected but not signed, we also need to sign in
222-
console.log('signIn:', account?.address, needSign);
223215
if (account?.status === ConnectStatus.Connected && signed) {
224216
return;
225217
}
226218

227219
// If account is not connected, we need to sign in
228220
// If account is connected but not signed, we also need to sign in
229-
console.log('signIn:', account?.address, needSign);
230221
if (account && needSign) {
231222
sign
232223
.signIn?.(account.address!)

packages/web3/src/connect-button/style/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ const genConnectButtonStyle: GenerateStyle<ConnectButtonToken> = (token) => {
2222
alignItems: 'center',
2323
flexDirection: 'row',
2424
},
25+
[`${token.antCls}-badge`]: {
26+
marginRight: token.marginXS,
27+
},
2528
[`${token.componentCls}-text`]: {
2629
[`${token.antCls}-typography`]: {
2730
color: 'unset',

packages/web3/src/theme/useStyle/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { TinyColor } from '@ctrl/tinycolor';
66
import { ConfigProvider as AntdConfigProvider, theme as AntTheme } from 'antd';
77
import type { GlobalToken } from 'antd';
88

9-
import { ComponentToken as ConnectModalComponentToken } from '../../connect-modal/style';
9+
import type { ComponentToken as ConnectModalComponentToken } from '../../connect-modal/style';
1010

1111
const { useToken } = AntTheme;
1212

@@ -50,13 +50,13 @@ export type Web3AliasToken = GlobalToken & {
5050
*/
5151
web3ComponentsCls: string;
5252
/**
53-
* antd 的 className
53+
* className for antd components
5454
* @type {string}
5555
* @example .ant
5656
*/
5757
antCls: string;
5858
/**
59-
* 自定义 ConnectModal token
59+
* custom `ConnectModal` token
6060
* @type {Partial<ConnectModalComponentToken>}
6161
* @example { hoverBg: 'red' }
6262
*/
@@ -65,8 +65,8 @@ export type Web3AliasToken = GlobalToken & {
6565

6666
/**
6767
* useStyle for css in js
68-
* @param componentName {string} 组件的名字
69-
* @param styleFn {GenerateStyle} 生成样式的函数
68+
* @param componentName {string} component name
69+
* @param styleFn {GenerateStyle} generate style function
7070
* @returns UseStyleResult
7171
*/
7272
export function useStyle(

0 commit comments

Comments
 (0)