Skip to content

Commit

Permalink
feat: connect button style
Browse files Browse the repository at this point in the history
  • Loading branch information
igorgoldobin committed Feb 6, 2024
1 parent 644c7e2 commit a2d22e2
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/components/SelectNetwork/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const SelectNetwork = () => {
</>
) : 'Wrong network'}
</div> */}
<a onClick={() => setShowOptions(true)} className="btn-sm text-slate-300 hover:text-white transition duration-150 ease-in-out w-full group [background:linear-gradient(theme(colors.slate.900),_theme(colors.slate.900))_padding-box,_conic-gradient(theme(colors.slate.400),_theme(colors.slate.700)_25%,_theme(colors.slate.700)_75%,_theme(colors.slate.400)_100%)_border-box] relative before:absolute before:inset-0 before:bg-slate-800/30 before:rounded-full before:pointer-events-none">
<a onClick={() => setShowOptions(true)} className="btn-sm text-slate-300 bg-purple-400 hover:text-white transition duration-150 ease-in-out w-full group [background:linear-gradient(theme(colors.slate.900),_theme(colors.slate.900))_padding-box,_conic-gradient(theme(colors.slate.400),_theme(colors.slate.700)_25%,_theme(colors.slate.700)_75%,_theme(colors.slate.400)_100%)_border-box] relative before:absolute before:inset-0 before:bg-slate-800/30 before:rounded-full before:pointer-events-none">
<span className="relative inline-flex items-center flex gap-2">
{activeNetwork ? (
<>
Expand Down
1 change: 1 addition & 0 deletions src/components/SelectNetwork/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
border: 1px solid #ccc;
border-radius: 5px;
background-color: white;
color: #262626;
}

.option {
Expand Down
21 changes: 5 additions & 16 deletions src/components/WalletModal/Option.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,18 @@
import { Connection, ConnectionType } from 'web3/connection'

import cx from 'classnames'

import styles from './styles.module.scss'

interface Props {
connection: Connection
activate: () => void
pendingConnectionType?: ConnectionType
}

const Option = ({ connection, activate, pendingConnectionType }: Props) => {
const isPending = connection.type === pendingConnectionType

return (
<button
type="button"
className={cx(styles['wallet-button'], {[styles.disabled]: !isPending && !!pendingConnectionType}, 'btn col-5 text-center mt-3 py-3')}
onClick={!pendingConnectionType ? activate : undefined}
>
<img src={connection.getIcon?.()} />
<h3>
{connection.getName()}
</h3>
{isPending && 'Connecting'}
<button onClick={!pendingConnectionType ? activate : undefined} className="btn-sm text-slate-300 bg-purple-400 hover:text-white transition duration-150 ease-in-out w-full group [background:linear-gradient(theme(colors.slate.900),_theme(colors.slate.900))_padding-box,_conic-gradient(theme(colors.slate.400),_theme(colors.slate.700)_25%,_theme(colors.slate.700)_75%,_theme(colors.slate.400)_100%)_border-box] relative before:absolute before:inset-0 before:bg-slate-800/30 before:rounded-full before:pointer-events-none">
<span className="relative inline-flex items-center flex gap-2">
{connection.getName()} <span
className="tracking-normal text-purple-500 group-hover:translate-x-0.5 transition-transform duration-150 ease-in-out ml-1">-&gt;</span>
</span>
</button>
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/WalletModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const WalletModal = () => {
Connect wallet
</div>
<div className={styles['wallets-grid']}>
{connections.filter(c => c.shouldDisplay()).map(connection => (
{connections.filter(c => c.shouldDisplay() && c.getName() === 'MetaMask').map(connection => (
<Option
key={connection.getName()}
connection={connection}
Expand Down
14 changes: 7 additions & 7 deletions src/components/WalletModal/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
.header {
margin-bottom: 15px;
font-size: 20px;
color: #000;
color: #ffffff;
}

.body {
padding: 10px;
background-color: white;
padding: 20px;
background-color: #581c87;
border-radius: 8px;
}

Expand All @@ -47,12 +47,12 @@
display: flex;
align-items: center;
gap: 20px;
color: #000;
color: #ffffff;

border-radius: 5px;
border: 1px solid #ccc;
outline: none;
border-radius: 30px;
border: 1px solid #2b012c;
cursor: pointer;
background-color: #1a011a;

h3 {
font-weight: normal;
Expand Down

0 comments on commit a2d22e2

Please sign in to comment.