Skip to content

Commit 8c91d2c

Browse files
committed
chore(release): 0.4.0-alpha.3
1 parent e33098f commit 8c91d2c

3 files changed

Lines changed: 32 additions & 14 deletions

File tree

bun.lock

Lines changed: 12 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@inverter-network/react",
33
"description": "INVERTER react",
4-
"version": "0.4.0-alpha.2",
4+
"version": "0.4.0-alpha.3",
55
"exports": {
66
".": {
77
"types": "./dist/types/index.d.ts",

src/components/wallet-widget.tsx

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export function WalletWidget(props: WalletWidgetProps) {
3636
)
3737

3838
const getStartIcon = () => {
39+
if ('startIcon' in props) return props.startIcon
3940
if (!isConnected) return <Wallet size={20} />
4041

4142
if (!!iconSrc)
@@ -56,32 +57,42 @@ export function WalletWidget(props: WalletWidgetProps) {
5657
}
5758

5859
const getEndIcon = () => {
60+
if ('endIcon' in props) return props.endIcon
5961
if (!!isConnected && !!text) return <Pointer size={20} />
6062

6163
return null
6264
}
6365

6466
const getChildren = () => {
6567
if (!isConnected) return 'Connect Wallet'
66-
6768
if (!!text) return text
6869

6970
return compressAddress(address)
7071
}
7172

73+
const color = (() => {
74+
if ('color' in props) return props.color
75+
if (!isConnected || !!text || isUnsupportedChain) return 'primary'
76+
return ''
77+
})()
78+
79+
const variant = (() => {
80+
if ('variant' in props) return props.variant
81+
if (isConnected) return 'outline'
82+
return 'default'
83+
})()
84+
7285
return (
7386
<Button
74-
{...rest}
75-
{...((!isConnected || !!text || isUnsupportedChain) && {
76-
color: 'primary',
77-
})}
87+
color={color}
88+
variant={variant}
7889
startIcon={getStartIcon()}
7990
endIcon={getEndIcon()}
8091
className={cn(className, 'in--leading-[unset]')}
81-
type="button"
82-
size={!size ? 'sm' : size}
92+
type={props.type ?? 'button'}
93+
size={size ?? 'sm'}
8394
onClick={setShowWalletWidget}
84-
{...(isConnected && { variant: 'outline' })}
95+
{...rest}
8596
>
8697
{getChildren()}
8798
</Button>

0 commit comments

Comments
 (0)