Skip to content

Commit

Permalink
feat(theming cleanup): remove unwanted useTheme
Browse files Browse the repository at this point in the history
  • Loading branch information
Ddouglasz committed Apr 18, 2024
1 parent 098974e commit 3e1775b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 25 deletions.
32 changes: 11 additions & 21 deletions packages/components/field-label/src/field-label.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ import {
import { warning } from '@commercetools-uikit/utils';
import { css } from '@emotion/react';
import styled from '@emotion/styled';
import IconButton from '@commercetools-uikit/icon-button';
import SecondaryIconButton from '@commercetools-uikit/secondary-icon-button';
import { InformationIcon, InfoIcon } from '@commercetools-uikit/icons';
import { InfoIcon } from '@commercetools-uikit/icons';
import Text from '@commercetools-uikit/text';
import Constraints from '@commercetools-uikit/constraints';
import Inline from '@commercetools-uikit/spacings-inline';
import Label from '@commercetools-uikit/label';
import { designTokens, useTheme } from '@commercetools-uikit/design-system';
import { designTokens } from '@commercetools-uikit/design-system';

export type TFieldLabelProps = {
/**
Expand Down Expand Up @@ -105,8 +104,6 @@ const LabelRowWrapper = styled.div`
`;

const FieldLabel = (props: TFieldLabelProps) => {
const { themedValue } = useTheme();

if (props.hintIcon) {
warning(
props.hintIcon.props.size === undefined,
Expand All @@ -132,22 +129,15 @@ const FieldLabel = (props: TFieldLabelProps) => {
{props.title}
</Label>
</Text.Wrap>
{props.onInfoButtonClick &&
themedValue(
<IconButton
label="More Info"
icon={<InformationIcon />}
size="small"
onClick={props.onInfoButtonClick}
/>,
<SecondaryIconButton
label="More Info"
icon={<InfoIcon />}
size="medium"
color="info"
onClick={props.onInfoButtonClick}
/>
)}
{props.onInfoButtonClick && (
<SecondaryIconButton
label="More Info"
icon={<InfoIcon />}
size="medium"
color="info"
onClick={props.onInfoButtonClick}
/>
)}
</Inline>

{props.hint && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ type TDropdownHead = {
};

const DropdownHead = (props: TDropdownHead) => {
const { themedValue } = useTheme();
return (
<div
css={css`
Expand Down Expand Up @@ -96,9 +95,7 @@ const DropdownHead = (props: TDropdownHead) => {
>
{cloneElement(props.iconLeft, {
size: 'big',
color: props.isDisabled
? 'neutral60'
: themedValue('solid', 'primary'),
color: props.isDisabled ? 'neutral60' : 'primary',
})}
</span>
<span
Expand Down

0 comments on commit 3e1775b

Please sign in to comment.