Fix some icon display size + fix padding issue on EditableChip component (#314)

* Fix some icon display size + fix padding issue on EditableChip component

* Fix according to PR

* Fix server generate and deploy scripts

* Fix image size on Opportunities board

* Fix lint

* Fix according to PR
This commit is contained in:
Charles Bochet
2023-06-16 14:16:35 +02:00
committed by GitHub
parent 98127d1d4c
commit 7f25f16766
18 changed files with 64 additions and 41 deletions

View File

@ -1,3 +1,4 @@
import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { IconPlus } from '@/ui/icons/index';
@ -21,9 +22,10 @@ const StyledButton = styled.button`
`;
export const NewButton = () => {
const theme = useTheme();
return (
<StyledButton>
<IconPlus size={16} />
<IconPlus size={theme.iconSizeMedium} />
New
</StyledButton>
);

View File

@ -19,8 +19,8 @@ export type EditableChipProps = {
// TODO: refactor
const StyledInplaceInput = styled.input`
padding-left: ${(props) => props.theme.spacing(1)};
padding-right: ${(props) => props.theme.spacing(1)};
padding-left: ${(props) => props.theme.spacing(2)};
padding-right: ${(props) => props.theme.spacing(2)};
width: 100%;
${textInputStyle}

View File

@ -1,4 +1,5 @@
import React from 'react';
import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { IconCheck } from '@/ui/icons/index';
@ -35,10 +36,13 @@ export function DropdownMenuSelectableItem({
onClick,
children,
}: React.PropsWithChildren<Props>) {
const theme = useTheme();
return (
<DropdownMenuSelectableItemContainer onClick={onClick} selected={selected}>
<StyledLeftContainer>{children}</StyledLeftContainer>
<StyledRightIcon>{selected && <IconCheck size={16} />}</StyledRightIcon>
<StyledRightIcon>
{selected && <IconCheck size={theme.iconSizeMedium} />}
</StyledRightIcon>
</DropdownMenuSelectableItemContainer>
);
}

View File

@ -1,3 +1,4 @@
import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import {
@ -65,6 +66,7 @@ function SortAndFilterBar<SortField, TData extends FilterableFieldsType>({
onRemoveFilter,
onCancelClick,
}: OwnProps<SortField, TData>) {
const theme = useTheme();
return (
<StyledBar>
<StyledChipcontainer>
@ -76,9 +78,9 @@ function SortAndFilterBar<SortField, TData extends FilterableFieldsType>({
id={sort.key}
icon={
sort.order === 'desc' ? (
<IconArrowNarrowDown />
<IconArrowNarrowDown size={theme.iconSizeMedium} />
) : (
<IconArrowNarrowUp />
<IconArrowNarrowUp size={theme.iconSizeMedium} />
)
}
onRemove={() => onRemoveSort(sort.key)}

View File

@ -1,4 +1,5 @@
import { ReactNode } from 'react';
import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { IconX } from '@/ui/icons/index';
@ -50,13 +51,14 @@ function SortOrFilterChip({
icon,
onRemove,
}: OwnProps) {
const theme = useTheme();
return (
<StyledChip>
<StyledIcon>{icon}</StyledIcon>
{labelKey && <StyledLabelKey>{labelKey}:&nbsp;</StyledLabelKey>}
{labelValue}
<StyledDelete onClick={onRemove} data-testid={'remove-icon-' + id}>
<IconX />
<IconX size={theme.iconSizeMedium} />
</StyledDelete>
</StyledChip>
);