Skip to content

Commit

Permalink
refactor(RouteLink): use transient props for isMobile
Browse files Browse the repository at this point in the history
  • Loading branch information
maxime-gendron committed May 10, 2021
1 parent 3792d63 commit 8667e0a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/react/src/components/route-link/route-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { Icon, IconName } from '../icon/icon';
import { StyledLink } from './styles/styled-link';
import { useDeviceContext } from '../device-context-provider/device-context-provider';

const Link = styled(StyledLink)<{isMobile: boolean, $hasLabel: boolean}>`
const Link = styled(StyledLink)<{ $isMobile: boolean, $hasLabel: boolean }>`
color: ${({ disabled, theme }) => (disabled ? theme.main['primary-1.2'] : theme.main['primary-1.1'])};
font-size: ${({ isMobile }) => (isMobile ? '1rem' : '0.875rem')};
font-size: ${({ $isMobile }) => ($isMobile ? '1rem' : '0.875rem')};
svg {
margin-right: ${({ $hasLabel }) => ($hasLabel ? 'var(--spacing-1x)' : '0')};
Expand Down Expand Up @@ -60,7 +60,7 @@ export function RouteLink({
disabled={disabled}
exact={exact}
$hasLabel={!!label}
isMobile={isMobile}
$isMobile={isMobile}
tabIndex={disabled ? -1 : 0}
to={href}
type="route"
Expand Down

0 comments on commit 8667e0a

Please sign in to comment.