fix: introduce shortened connect button
This commit is contained in:
parent
860079b071
commit
103246261f
@ -15,6 +15,7 @@ interface Props {
|
||||
color?: ButtonProps['color']
|
||||
variant?: ButtonProps['variant']
|
||||
size?: ButtonProps['size']
|
||||
short?: boolean
|
||||
}
|
||||
|
||||
export default function WalletConnectButton(props: Props) {
|
||||
|
@ -75,6 +75,7 @@ export default function AccountBalancesTable(props: Props) {
|
||||
},
|
||||
})
|
||||
}}
|
||||
short
|
||||
/>
|
||||
</div>
|
||||
</ConditionalWrapper>
|
||||
|
@ -54,6 +54,7 @@ export default function BorrowButton(props: Props) {
|
||||
e.stopPropagation()
|
||||
}}
|
||||
text='Borrow'
|
||||
short
|
||||
/>
|
||||
</ConditionalWrapper>
|
||||
</div>
|
||||
|
@ -9,8 +9,12 @@ import useAccountIds from 'hooks/accounts/useAccountIds'
|
||||
import useAccountId from 'hooks/useAccountId'
|
||||
import useStore from 'store'
|
||||
|
||||
export default function ActionButton(props: ButtonProps) {
|
||||
const { className, color, variant, size } = props
|
||||
interface Props extends ButtonProps {
|
||||
short?: boolean
|
||||
}
|
||||
|
||||
export default function ActionButton(props: Props) {
|
||||
const { className, color, variant, size, short } = props
|
||||
const defaultProps = { className, color, variant, size }
|
||||
const address = useStore((s) => s.address)
|
||||
const isV1 = useStore((s) => s.isV1)
|
||||
@ -22,7 +26,8 @@ export default function ActionButton(props: ButtonProps) {
|
||||
useStore.setState({ focusComponent: { component: <AccountCreateFirst /> } })
|
||||
}, [])
|
||||
|
||||
if (!address) return <WalletConnectButton {...defaultProps} />
|
||||
if (!address)
|
||||
return <WalletConnectButton {...defaultProps} textOverride={short ? 'Connect' : undefined} />
|
||||
|
||||
if (accountIds && accountIds.length === 0) {
|
||||
return (
|
||||
|
@ -34,6 +34,7 @@ export const Deposit = (props: Props) => {
|
||||
color='tertiary'
|
||||
text='Deposit'
|
||||
leftIcon={<Plus />}
|
||||
short
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
|
@ -56,6 +56,7 @@ export default function LendButton(props: Props) {
|
||||
e.stopPropagation()
|
||||
}}
|
||||
text='Lend'
|
||||
short
|
||||
/>
|
||||
</ConditionalWrapper>
|
||||
</div>
|
||||
|
@ -43,6 +43,7 @@ export default function BorrowButton(props: Props) {
|
||||
e.stopPropagation()
|
||||
}}
|
||||
text='Borrow'
|
||||
short
|
||||
/>
|
||||
</ConditionalWrapper>
|
||||
</div>
|
||||
|
@ -43,6 +43,7 @@ export default function DepositButton(props: Props) {
|
||||
e.stopPropagation()
|
||||
}}
|
||||
text='Deposit'
|
||||
short
|
||||
/>
|
||||
</ConditionalWrapper>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user