From b78cc3fa2ff40fc44cae29dda57adbd714e0f39c Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Thu, 25 Jun 2020 15:34:35 +0200 Subject: [PATCH] Adjust button rounding (#3051) * Adjust button rounding * ReferendumInfo icon --- .../src/Overview/ReferendumVotes.tsx | 11 +++++++--- packages/page-storage/src/Query.tsx | 6 ++++++ packages/react-components/src/AddressInfo.tsx | 3 +-- packages/react-components/src/Badge.tsx | 2 +- .../react-components/src/Button/Button.tsx | 21 +++++-------------- .../react-components/src/DemocracyLocks.tsx | 3 +-- packages/react-components/src/Icon.tsx | 5 ++++- packages/react-components/src/LabelHelp.tsx | 3 +-- .../react-components/src/StakingUnbonding.tsx | 3 +-- .../react-components/src/styles/components.ts | 4 ---- .../react-components/src/styles/semantic.ts | 2 +- packages/react-hooks/src/useAccountInfo.ts | 1 + packages/react-query/src/FormatBalance.tsx | 9 ++++++++ 13 files changed, 39 insertions(+), 34 deletions(-) diff --git a/packages/page-democracy/src/Overview/ReferendumVotes.tsx b/packages/page-democracy/src/Overview/ReferendumVotes.tsx index 3669783150..ab8ff777eb 100644 --- a/packages/page-democracy/src/Overview/ReferendumVotes.tsx +++ b/packages/page-democracy/src/Overview/ReferendumVotes.tsx @@ -59,9 +59,8 @@ function ReferendumVotes ({ change, className = '', count, index, isWinning, tot <> (k className='result' label={ } value={isAllLocked ? 'all' : balancesAll.lockedBalance} diff --git a/packages/react-components/src/Badge.tsx b/packages/react-components/src/Badge.tsx index 1c67741d99..ca5b2fbd37 100644 --- a/packages/react-components/src/Badge.tsx +++ b/packages/react-components/src/Badge.tsx @@ -27,7 +27,7 @@ function Badge ({ className = '', color = 'normal', hover, info, isInline, isSma
diff --git a/packages/react-components/src/Button/Button.tsx b/packages/react-components/src/Button/Button.tsx index 8e2a0689cb..80a3f02b38 100644 --- a/packages/react-components/src/Button/Button.tsx +++ b/packages/react-components/src/Button/Button.tsx @@ -4,25 +4,19 @@ import { ButtonProps } from './types'; -import React, { useState } from 'react'; +import React from 'react'; import SUIButton from 'semantic-ui-react/dist/commonjs/elements/Button/Button'; import styled from 'styled-components'; import Icon from '../Icon'; -import Tooltip from '../Tooltip'; -let idCounter = 0; - -function Button ({ children, className = '', floated, icon, isAnimated, isBasic = false, isCircular = false, isDisabled = false, isFluid = false, isIcon, isLoading = false, isNegative = false, isPositive = false, isPrimary = false, label, labelPosition, onClick, onMouseEnter, onMouseLeave, size, tabIndex, tooltip }: ButtonProps): React.ReactElement { - const [triggerId] = useState(`button-${++idCounter}`); +function Button ({ children, className = '', floated, icon, isAnimated, isBasic = false, isCircular = false, isDisabled = false, isFluid = false, isIcon, isLoading = false, isNegative = false, isPositive = false, isPrimary = false, label, labelPosition, onClick, onMouseEnter, onMouseLeave, size, tabIndex }: ButtonProps): React.ReactElement { const props = { animate: 'fade', animated: isAnimated, basic: isBasic, - circular: isCircular, + circular: true, className: `${className} ${isCircular ? 'isCircular' : ''} ${isIcon ? 'isIcon' : ''} ${(isCircular || isIcon || !(children || label)) ? 'icon' : ''}`, - 'data-for': triggerId, - 'data-tip': !!tooltip, disabled: isDisabled, floated, fluid: isFluid, @@ -48,18 +42,13 @@ function Button ({ children, className = '', floated, icon, isAnimated, isBasic {label} {children} - {tooltip && ( - - )} ); } export default React.memo(styled(Button)` + border-radius: 10rem !important; + &:not(.icon) { > .ui--Icon { margin-right: 0.25rem; diff --git a/packages/react-components/src/DemocracyLocks.tsx b/packages/react-components/src/DemocracyLocks.tsx index 011a73cdbd..3d9fb69905 100644 --- a/packages/react-components/src/DemocracyLocks.tsx +++ b/packages/react-components/src/DemocracyLocks.tsx @@ -40,9 +40,8 @@ function DemocracyLocks ({ className = '', value }: Props): React.ReactElement

void; onMouseOver?: () => void; size?: '1x' | '2x'; + tooltip?: string; } // one-time init of FA libraries library.add(fas); -function Icon ({ className = '', color = 'normal', icon, isSpinning, onClick, onMouseOut, onMouseOver, size = '1x' }: Props): React.ReactElement { +function Icon ({ className = '', color = 'normal', icon, isSpinning, onClick, onMouseOut, onMouseOver, size = '1x', tooltip }: Props): React.ReactElement { return ( return (

{isTooltipOpen && (