Bounty display alignment (#5191)

This commit is contained in:
Jaco 2021-05-03 10:18:17 +03:00 committed by GitHub
parent 58da285ba1
commit 2f572b68c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 21 additions and 37 deletions

View File

@ -8,7 +8,6 @@ import React, { useCallback, useMemo, useState } from 'react';
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';
@ -21,7 +20,6 @@ import BountyStatusView from './BountyStatusView';
import Curator from './Curator';
import DueBlocks from './DueBlocks';
import { useBountyStatus } from './hooks';
import { bountyLabelColor } from './theme';
import { useTranslation } from './translate';
import VotersColumn from './VotersColumn';
@ -200,7 +198,7 @@ function Bounty ({ bestNumber, bounty, className = '', description, index, isEve
);
}
export default React.memo(styled(Bounty)(({ theme }: ThemeProps) => `
export default React.memo(styled(Bounty)`
&.isCollapsed {
visibility: collapse;
}
@ -258,11 +256,9 @@ export default React.memo(styled(Bounty)(({ theme }: ThemeProps) => `
.label {
text-align: right;
padding: 0 1.7rem 0 0;
font-weight: 500;
font-size: 0.7rem;
line-height: normal;
color: ${bountyLabelColor[theme.theme]};
text-transform: uppercase;
color: var(--color-label);
text-transform: lowercase;
}
.label-column-right, .label-column-left{
@ -275,11 +271,11 @@ export default React.memo(styled(Bounty)(({ theme }: ThemeProps) => `
}
.label-column-right {
padding: 0 0 0.75rem;
padding: 0 0 0.5rem;
}
.label-column-left {
padding: 0 0 0.75rem;
padding: 0 0 0.5rem;
}
& .td-info-action-row {
@ -309,11 +305,11 @@ export default React.memo(styled(Bounty)(({ theme }: ThemeProps) => `
.block-to-time {
font-size: 0.7rem;
line-height: 1.5rem;
color: ${bountyLabelColor[theme.theme]};
color: var(--color-label);
}
& .votes-table {
display: flex;
justify-content: space-between;
}
`));
`);

View File

@ -8,10 +8,8 @@ import React, { useMemo } from 'react';
import styled from 'styled-components';
import VotingDescriptionInfo from '@polkadot/app-bounties/BountyInfos/VotingDescriptionInfo';
import { ThemeProps } from '@polkadot/react-components/types';
import { useMembers } from '@polkadot/react-hooks';
import { bountyLabelColor } from '../theme';
import { useTranslation } from '../translate';
import VotingLink from './VotingLink';
@ -51,11 +49,11 @@ function VotingSummary ({ className, proposal, status }: Props): JSX.Element {
);
}
export default React.memo(styled(VotingSummary)(({ theme }: ThemeProps) => `
export default React.memo(styled(VotingSummary)`
.voting-summary-text {
font-size: 0.85rem;
line-height: 1.5rem;
color: ${bountyLabelColor[theme.theme]}
color: var(--color-label);
span {
min-width: 0.5rem;
@ -69,4 +67,4 @@ export default React.memo(styled(VotingSummary)(({ theme }: ThemeProps) => `
align-items: center;
line-height: 1.5rem;
}
`));
`);

View File

@ -1,13 +1,14 @@
// Copyright 2017-2021 @polkadot/app-bounties authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ThemeProps } from '@polkadot/react-components/types';
import React from 'react';
import styled from 'styled-components';
import { Icon } from '@polkadot/react-components';
import { ThemeProps } from '@polkadot/react-components/types';
import { bountyLabelColor, bountySvgColor } from '../theme';
import { bountySvgColor } from '../theme';
interface Props {
className: '';
@ -48,7 +49,7 @@ export default React.memo(styled(BountyInfo)(({ theme }: ThemeProps) => `
font-weight: 400;
font-size: 0.714rem;
line-height: 0.864rem;
color: ${bountyLabelColor[theme.theme]};
color: var(--color-label);
word-wrap: break-word;
}
`));

View File

@ -4,10 +4,6 @@
import React from 'react';
import styled from 'styled-components';
import { ThemeProps } from '@polkadot/react-components/types';
import { bountyLabelColor } from './theme';
interface Props {
className?: string;
dataTestId?: string;
@ -24,9 +20,9 @@ function Description ({ className = '', dataTestId = '', description }: Props):
);
}
export default React.memo(styled(Description)(({ theme }: ThemeProps) => `
export default React.memo(styled(Description)`
margin-top: 0.28rem;
font-size: 0.7rem;
line-height: 0.85rem;
color: ${bountyLabelColor[theme.theme]};
`));
color: var(--color-label);
`);

View File

@ -8,10 +8,8 @@ import React, { useMemo } from 'react';
import styled from 'styled-components';
import { AddressSmall, Icon } from '@polkadot/react-components';
import { ThemeProps } from '@polkadot/react-components/types';
import { getProposalToDisplay } from './helpers/extendedStatuses';
import { bountyLabelColor } from './theme';
import { useTranslation } from './translate';
interface Props {
@ -58,7 +56,7 @@ function VotersColumn ({ className, option, proposals, status }: Props): React.R
);
}
export default React.memo(styled(VotersColumn)(({ theme }: ThemeProps) => `
export default React.memo(styled(VotersColumn)`
width: 50%;
.vote-numbers {
@ -69,7 +67,7 @@ export default React.memo(styled(VotersColumn)(({ theme }: ThemeProps) => `
.vote-numbers-icon svg {
max-width: 10px;
color: ${bountyLabelColor[theme.theme]};
color: var(--color-label);
}
.vote-numbers-label {
@ -80,4 +78,4 @@ export default React.memo(styled(VotersColumn)(({ theme }: ThemeProps) => `
text-transform: uppercase;
color: var(--color-label);
}
`));
`);

View File

@ -6,11 +6,6 @@ type bountyTheme = {
light: string;
}
export const bountyLabelColor: bountyTheme = {
dark: '#757575',
light: '#8B8B8B'
};
export const bountySvgColor: bountyTheme = {
dark: '#8E8E8E',
light: '#4D4D4D'

View File

@ -68,7 +68,7 @@ export default React.memo(styled(Table)`
table {
border-spacing: 0;
max-width: 100%;
overflow-x: hidden;
overflow: hidden;
position: relative;
width: 100%;
z-index: 1;