diff --git a/packages/DApp/src/components/Button.tsx b/packages/DApp/src/components/Button.tsx index 497817d..a4739fd 100644 --- a/packages/DApp/src/components/Button.tsx +++ b/packages/DApp/src/components/Button.tsx @@ -27,6 +27,12 @@ export const ButtonPrimary = styled(Button)` filter: grayscale(1); } ` + +export const ProposeButton = styled(ButtonPrimary)` + padding: 10px 0; + width: 343px; +` + export const ButtonSecondary = styled(Button)` background: ${Colors.VioletSecondary}; color: ${Colors.VioletDark}; diff --git a/packages/DApp/src/components/StatusConnectButton.tsx b/packages/DApp/src/components/ConnectButton.tsx similarity index 79% rename from packages/DApp/src/components/StatusConnectButton.tsx rename to packages/DApp/src/components/ConnectButton.tsx index bbd507b..06a97de 100644 --- a/packages/DApp/src/components/StatusConnectButton.tsx +++ b/packages/DApp/src/components/ConnectButton.tsx @@ -1,5 +1,5 @@ -import React, { ReactNode, useState } from 'react' -import { ButtonPrimary } from './Button' +import React, { useState } from 'react' +import { ProposeButton } from './Button' import { useEthers } from '@usedapp/core' import styled from 'styled-components' import { Modal } from './Modal' @@ -7,12 +7,12 @@ import { LinkExternal } from './Link' import statusLogo from '../assets/images/statusLogo.svg' import { ColumnFlexDiv } from '../constants/styles' -export type StatusConnectButtonProps = { - children: ReactNode +export type ConnectButtonProps = { + text?: string className?: string } -export function StatusConnectButton({ children, className }: StatusConnectButtonProps) { +export function ConnectButton({ text, className }: ConnectButtonProps) { const [showModal, setShowModal] = useState(false) const { activateBrowserWallet } = useEthers() @@ -31,9 +31,9 @@ export function StatusConnectButton({ children, className }: StatusConnectButton {' '} )} - - {children} - + + {!text ? 'Connect to Vote' : text} + ) } diff --git a/packages/DApp/src/components/PageInfo.tsx b/packages/DApp/src/components/PageInfo.tsx index 708e78b..0c8dea2 100644 --- a/packages/DApp/src/components/PageInfo.tsx +++ b/packages/DApp/src/components/PageInfo.tsx @@ -1,8 +1,6 @@ import React from 'react' import styled from 'styled-components' -import { ButtonPrimary } from '../components/Button' import { ColumnFlexDiv } from '../constants/styles' -import { StatusConnectButton } from './StatusConnectButton' interface PageInfoProps { heading: string @@ -16,18 +14,6 @@ export const PageInfo = ({ heading, text }: PageInfoProps) => ( ) -interface ProposeButtonProps { - onClick: () => void -} - -export function ProposeButton({ onClick }: ProposeButtonProps) { - return Propose community -} - -export function ConnectButton() { - return Connect to Vote -} - export const InfoWrap = styled(ColumnFlexDiv)` max-width: 630px; padding: 48px 0; @@ -48,12 +34,3 @@ const InfoText = styled.p` line-height: 32px; margin-bottom: 24px; ` -const ProposeButtonStyled = styled(ButtonPrimary)` - padding: 10px 0; - width: 343px; -` - -const ConnectButtonStyled = styled(StatusConnectButton)` - padding: 10px 0; - width: 343px; -` diff --git a/packages/DApp/src/components/directory/DirectoryInfo.tsx b/packages/DApp/src/components/directory/DirectoryInfo.tsx index 59631d2..8c52e2e 100644 --- a/packages/DApp/src/components/directory/DirectoryInfo.tsx +++ b/packages/DApp/src/components/directory/DirectoryInfo.tsx @@ -1,6 +1,7 @@ import React from 'react' -import { ConnectButton, InfoWrap, PageInfo } from '../PageInfo' +import { InfoWrap, PageInfo } from '../PageInfo' import { useEthers } from '@usedapp/core' +import { ConnectButton } from '../ConnectButton' export function DirectoryInfo() { const { account } = useEthers() diff --git a/packages/DApp/src/components/top/TopBar.tsx b/packages/DApp/src/components/top/TopBar.tsx index f99d88c..3cbbf01 100644 --- a/packages/DApp/src/components/top/TopBar.tsx +++ b/packages/DApp/src/components/top/TopBar.tsx @@ -5,7 +5,7 @@ import { useEthers, shortenAddress } from '@usedapp/core' import { Logo } from './Logo' import { Colors } from '../../constants/styles' import { Animation } from '../../constants/animation' -import { StatusConnectButton } from '../StatusConnectButton' +import { ConnectButton } from '../ConnectButton' export function TopBar() { const { account, deactivate } = useEthers() @@ -58,7 +58,7 @@ export function TopBar() { ) : ( - Connect + )} @@ -163,8 +163,10 @@ const StyledNavLink = styled(NavLink)` } } ` -const ButtonConnect = styled(StatusConnectButton)` + +const ButtonConnect = styled(ConnectButton)` padding: 10px 27px; + width: auto; ` const AccountWrap = styled.div` diff --git a/packages/DApp/src/components/votes/VotesInfo.tsx b/packages/DApp/src/components/votes/VotesInfo.tsx index 0585a62..020d180 100644 --- a/packages/DApp/src/components/votes/VotesInfo.tsx +++ b/packages/DApp/src/components/votes/VotesInfo.tsx @@ -1,10 +1,12 @@ import React, { useState } from 'react' -import { InfoWrap, ConnectButton, ProposeButton, PageInfo } from '../PageInfo' +import { InfoWrap, PageInfo } from '../PageInfo' import { useEthers } from '@usedapp/core' import { Modal } from '../Modal' import { ProposeModal } from '../card/ProposeModal' import { VoteConfirmModal } from '../card/VoteConfirmModal' import { CommunityDetail } from '../../models/community' +import { ProposeButton } from '../Button' +import { ConnectButton } from '../ConnectButton' export function VotesInfo() { const { account } = useEthers() @@ -43,7 +45,11 @@ export function VotesInfo() { )} - {account ? setShowProposeModal(true)} /> : } + {account ? ( + setShowProposeModal(true)}>Propose community + ) : ( + + )} ) }