Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't display the desktop wallet connect option when using a mobile d… #413

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions packages/web3-react/src/components/Pages/Connectors/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the library. If not, see <http://www.gnu.org/licenses/>.
*/
import React from 'react'
import React, { useMemo } from 'react'
import { useConnectSettingContext } from '../../../contexts/alephiumConnect'
import supportedConnectors from '../../../constants/supportedConnectors'

Expand All @@ -41,14 +41,17 @@ const Connectors: React.FC = () => {
const context = useConnectSettingContext()
const mobile = isMobile()
const wallets = useDefaultWallets()
const connectors = useMemo(() => {
return mobile ? supportedConnectors.filter((c) => c.id !== 'desktopWallet') : supportedConnectors
}, [mobile])

return (
<PageContent style={{ width: 312 }}>
{mobile ? (
<>
<MobileConnectorsContainer>
{supportedConnectors.map((connector) => {
const info = supportedConnectors.filter((c) => c.id === connector.id)[0]
{connectors.map((connector) => {
const info = connectors.filter((c) => c.id === connector.id)[0]
if (!info) return null

let logos = info.logos
Expand Down Expand Up @@ -89,8 +92,8 @@ const Connectors: React.FC = () => {
) : (
<>
<ConnectorsContainer>
{supportedConnectors.map((connector) => {
const info = supportedConnectors.filter((c) => c.id === connector.id)[0]
{connectors.map((connector) => {
const info = connectors.filter((c) => c.id === connector.id)[0]
if (!info) return null

let logos = info.logos
Expand Down
Loading