Skip to content

Commit

Permalink
change dropdown to custom dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
joeizang committed Nov 14, 2024
1 parent 6cab7bb commit d4b2436
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions libs/remix-ui/run-tab/src/lib/components/account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { FormattedMessage, useIntl } from 'react-intl'
import { CopyToClipboard } from '@remix-ui/clipboard'
import { AccountProps } from '../types'
import { PassphrasePrompt } from './passphrase'
import { CustomTooltip } from '@remix-ui/helper'
import { CustomMenu, CustomToggle, CustomTooltip } from '@remix-ui/helper'
import { Dropdown } from 'react-bootstrap'
const _paq = window._paq = window._paq || []

export function AccountUI(props: AccountProps) {
Expand Down Expand Up @@ -235,7 +236,27 @@ export function AccountUI(props: AccountProps) {
{props.accounts.isRequesting && <i className="fa fa-spinner fa-pulse ml-2" aria-hidden="true"></i>}
</label>
<div className="udapp_account">
<select
<Dropdown className="udapp_selectExEnvOptions">
<Dropdown.Toggle as={CustomToggle} icon={null} id="txorigin" data-id="runTabSelectAccount" className="btn btn-light btn-block w-100 d-inline-block border border-dark form-control">
{selectedAccount ? loadedAccounts[selectedAccount] : ''}
</Dropdown.Toggle>
<Dropdown.Menu as={CustomMenu} className="w-100 custom-dropdown-items" data-id="custom-dropdown-items">
{accounts && accounts.length > 0 ? accounts.map((value, index) => (
<Dropdown.Item
key={index}
eventKey={selectedAccount}
onSelect={(e) => {
props.setAccount(value)
}}
>
<span className="">
{loadedAccounts[value]}
</span>
</Dropdown.Item>
)) : <Dropdown.Item></Dropdown.Item>}
</Dropdown.Menu>
</Dropdown>
{/* <select
id="txorigin"
data-id="runTabSelectAccount"
name="txorigin"
Expand All @@ -250,7 +271,7 @@ export function AccountUI(props: AccountProps) {
{loadedAccounts[value]}
</option>
))}
</select>
</select> */}
</div>
</div>
)
Expand Down Expand Up @@ -280,4 +301,4 @@ const EIP712_Example = {
{ name: 'createdAt', type: 'uint256' },
],
},
}
}

0 comments on commit d4b2436

Please sign in to comment.