wallet-connect-web-examples/dapps/react-dapp-v2-with-web3js/src/components/Peer.tsx
Gancho Radkov 49920d0453
feat: examples dapps update (#72)
* feat: updates example dapp with ethers to use `universal-provider`

* feat: updates example dapp with web3 to use `universal-provider`

* fix: sets `paramsString` and `address` to lower case when searching for match

* chore: yarn lock

* refactor: rm `outdated` warning

* refactor: standardize event logging

* refactor: rm logs

* refactor: adds `next` to `ethers` dapp

* chore: rm old files

* refactor: adds next to web3 example

* chore: test deploy vercel

* chore: remove console log

* chore: to trigger deployment

* Revert "chore: to trigger deployment"

This reverts commit bc7712780a101f0152c20ce4eca4d8d117d8eaa7.

* feat: updates readmes

Co-authored-by: crypblizz <45455218+crypblizz8@users.noreply.github.com>
2022-11-08 10:32:07 +02:00

75 lines
1.5 KiB
TypeScript

import * as React from "react";
import styled from "styled-components";
import { CoreTypes } from "@walletconnect/types";
import { colors, fonts } from "../styles";
const SPeerOneLiner = styled.div`
display: flex;
align-items: center;
border-radius: 8px;
border: 2px solid rgb(${colors.darkGrey});
padding: 5px;
& img {
width: 40px;
height: 40px;
}
& > div {
margin-left: 10px;
}
`;
const SPeerCard = styled.div`
align-items: center;
justify-content: center;
display: flex;
width: 100%;
flex-direction: column;
border-radius: 8px;
border: 2px solid rgb(${colors.darkGrey});
padding: 5px;
& > div {
margin: 4px auto;
}
`;
const SIcon = styled.img`
width: 100px;
margin: 0 auto;
`;
const SCenter = styled.div`
text-align: center;
`;
const SUrl = styled(SCenter as any)`
font-size: ${fonts.size.small};
opacity: 0.8;
`;
const SName = styled(SCenter as any)`
font-weight: bold;
`;
interface PeerProps {
oneLiner?: boolean;
metadata: CoreTypes.Metadata;
}
const Peer = (props: PeerProps) =>
props.oneLiner ? (
<SPeerOneLiner>
<img src={props.metadata.icons[0]} alt={props.metadata.name} />
<div>{props.metadata.name}</div>
</SPeerOneLiner>
) : (
<SPeerCard>
<SIcon src={props.metadata.icons[0]} alt={props.metadata.name} />
<SName>{props.metadata.name}</SName>
<SCenter>{props.metadata.description}</SCenter>
<SUrl>{props.metadata.url}</SUrl>
</SPeerCard>
);
export default Peer;