From 0f69839626b5d6f073b7d623d84071e43defcc70 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Sat, 20 Feb 2021 14:58:45 +0100 Subject: [PATCH] Additional bounties alignment (#4704) * Additional bounties alignment * Button adjust --- packages/page-bounties/src/Bounties.tsx | 28 ++------ packages/page-bounties/src/Bounty.tsx | 17 ++--- .../src/BountyExtraActions/index.tsx | 23 +------ packages/page-bounties/src/index.tsx | 67 +------------------ packages/react-components/src/Table/Head.tsx | 5 +- packages/react-components/src/Table/index.tsx | 4 +- 6 files changed, 18 insertions(+), 126 deletions(-) diff --git a/packages/page-bounties/src/Bounties.tsx b/packages/page-bounties/src/Bounties.tsx index c53eeabbc8..d2fcc5c57d 100644 --- a/packages/page-bounties/src/Bounties.tsx +++ b/packages/page-bounties/src/Bounties.tsx @@ -6,7 +6,6 @@ import styled from 'styled-components'; import Summary from '@polkadot/app-bounties/Summary'; import { Button, Table } from '@polkadot/react-components'; -import { ThemeProps } from '@polkadot/react-components/types'; import Bounty from './Bounty'; import BountyCreate from './BountyCreate'; @@ -22,14 +21,10 @@ function Bounties ({ className }: Props): React.ReactElement { const { bestNumber, bounties } = useBounties(); const headerRef = useRef([ - [t('status'), 'start'], - [t('title'), 'start'], - [], + [t('bounties'), 'start', 3], [t('value'), 'start'], [t('curator'), 'start'], - [t('next action'), 'start'], - [], - [] + [t('next action'), 'start', 3] ]); return ( @@ -41,7 +36,6 @@ function Bounties ({ className }: Props): React.ReactElement { ('No open bounties')} - hasTitle={false} header={headerRef.current} > {bounties && bestNumber && @@ -63,7 +57,7 @@ function Bounties ({ className }: Props): React.ReactElement { ); } -export default React.memo(styled(Bounties)(({ theme }: ThemeProps) => ` +export default React.memo(styled(Bounties)` .bounties-table-wrapper table { background: none; @@ -96,18 +90,4 @@ export default React.memo(styled(Bounties)(({ theme }: ThemeProps) => ` filter: initial; opacity: 1; } - - .ui--Table th:first-child h1 { - padding: 0; - font-weight: ${theme.fontWeightBold}; - font-size: 0.7rem; - line-height: 0.85rem; - text-transform: uppercase; - color: ${theme.colorLabel}; - border: none; - - svg { - display: none; - } - } -`)); +`); diff --git a/packages/page-bounties/src/Bounty.tsx b/packages/page-bounties/src/Bounty.tsx index b878def96e..be852aaa19 100644 --- a/packages/page-bounties/src/Bounty.tsx +++ b/packages/page-bounties/src/Bounty.tsx @@ -10,6 +10,7 @@ import styled from 'styled-components'; import { AddressSmall, Icon, LinkExternal } from '@polkadot/react-components'; import { ThemeProps } from '@polkadot/react-components/types'; import { FormatBalance } from '@polkadot/react-query'; +import { formatNumber } from '@polkadot/util'; import BountyActionMessage from './BountyNextActionInfo/BountyActionMessage'; import { getProposalToDisplay } from './helpers/extendedStatuses'; @@ -65,18 +66,18 @@ function Bounty ({ bestNumber, bounty, className = '', description, index, propo return ( <> - + +
- -

{formatNumber(index)}

{description}
+ + {curatorToRender && ( @@ -159,10 +160,6 @@ function Bounty ({ bestNumber, bounty, className = '', description, index, propo
{t('Proposer')}
-
-
{t('Id')}
- {index.toString()} -
@@ -211,6 +208,10 @@ export default React.memo(styled(Bounty)(({ theme }: ThemeProps) => ` visibility: visible; } + &.noBorder td { + border-bottom: 1px solid transparent; + } + .description-column { max-width: 200px; diff --git a/packages/page-bounties/src/BountyExtraActions/index.tsx b/packages/page-bounties/src/BountyExtraActions/index.tsx index 4b740dadb6..017c98e457 100644 --- a/packages/page-bounties/src/BountyExtraActions/index.tsx +++ b/packages/page-bounties/src/BountyExtraActions/index.tsx @@ -2,17 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 import React, { useMemo, useRef, useState } from 'react'; -import styled from 'styled-components'; import { DeriveCollectiveProposal } from '@polkadot/api-derive/types'; import { Button, Menu, Popup } from '@polkadot/react-components'; -import { ThemeProps } from '@polkadot/react-components/types'; import { useMembers, useToggle } from '@polkadot/react-hooks'; import { BlockNumber, BountyIndex, BountyStatus } from '@polkadot/types/interfaces'; import { determineUnassignCuratorAction } from '../helpers'; import { useBountyStatus, useUserRole } from '../hooks'; -import { bountySvgColor } from '../theme'; import { useTranslation } from '../translate'; import { ValidUnassignCuratorAction } from '../types'; import BountyRejectCurator from './BountyRejectCurator'; @@ -117,7 +114,6 @@ function Index ({ bestNumber, className, description, index, proposals, status } onClose={togglePopupOpen} trigger={