You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
spa_instat_tv/src/features/SportIcon/index.tsx

27 lines
550 B

import styled from 'styled-components/macro'
import { SportTypes } from 'config'
import { getSportLexic } from 'helpers'
type IconProps = {
src: string,
}
const Icon = styled.span<IconProps>`
display: inline-block;
height: 10px;
min-width: 10px;
background-image: url(/images/${({ src }) => `${src}-icon`}.svg);
background-repeat: no-repeat;
background-position: center;
background-size: 100% 100%;
`
type Props = {
sport: SportTypes,
}
export const SportIcon = ({ sport }: Props) => (
<Icon src={getSportLexic(sport)} />
)