Skip to content

Commit

Permalink
fix: remove extra attrs from GlobalSearch and Text
Browse files Browse the repository at this point in the history
  • Loading branch information
awinogradov committed Sep 27, 2023
1 parent fab2706 commit c08aa64
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/components/GlobalSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ const StyledResults = styled.div`
padding-bottom: ${gapS};
`;

const StyledSearchIcon = styled(IconSearchOutline)<{ focused?: boolean }>`
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const StyledSearchIcon = styled(({ focused, ...props }) => <IconSearchOutline {...props} />)<{ focused?: boolean }>`
${({ focused }) =>
focused &&
`
Expand Down
4 changes: 4 additions & 0 deletions src/components/Input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ const StyledInput = styled(({ forwardRef, size, view, brick, iconLeft, iconRight
padding: 5px 8px;
font-size: 13px;
& ${StyledIconContainer} {
top: 5px;
}
`}
${({ size, iconLeft }) =>
Expand Down
10 changes: 8 additions & 2 deletions src/components/Text/Text.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from 'react';
import styled, { css, createGlobalStyle } from 'styled-components';
import { fontDisplay, gapL, gapM, gapS, gapSm, gapXl, gapXs, textColor } from '@taskany/colors';

Expand Down Expand Up @@ -44,10 +45,15 @@ export interface TextProps extends React.HTMLAttributes<HTMLDivElement> {
lines?: number;
wordWrap?: React.CSSProperties['wordWrap'];
wordBreak?: React.CSSProperties['wordBreak'];
as?: string;
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
export const Text = styled.div<TextProps>`
export const Text = styled(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
({ color, as: Tag = 'div', size, weight, ellipsis, lines, wordBreak, wordWrap, ...props }: TextProps) => (
<Tag {...props} />
),
)<TextProps>`
font-size: 16px;
font-family: ${fontDisplay};
color: ${textColor};
Expand Down

0 comments on commit c08aa64

Please sign in to comment.