Ott 455 sport name refactor (#153)
* feat(ott-445): changed sportName component logic * fix(ott-455): minor changes * fix(ott-455): added sport types enum Co-authored-by: Armen <armen9339@gmail.com>keep-around/af30b88d367751c9e05a735e4a0467a96238ef47
parent
3b6d752486
commit
57dcf853c1
@ -1,17 +1,21 @@ |
|||||||
import styled from 'styled-components/macro' |
import React from 'react' |
||||||
|
|
||||||
import { devices } from 'config/devices' |
import { SportTypes } from 'config' |
||||||
import { T9n } from 'features/T9n' |
|
||||||
|
|
||||||
export const SportName = styled(T9n)<{ color: string }>` |
import { getSportColor, getSportLexic } from 'helpers' |
||||||
margin-right: 10px; |
|
||||||
font-size: 11px; |
|
||||||
color: ${({ color }) => color}; |
|
||||||
letter-spacing: 0.02em; |
|
||||||
text-transform: uppercase; |
|
||||||
|
|
||||||
@media ${devices.tablet} { |
import { useLexicsStore } from 'features/LexicsStore' |
||||||
font-size: 10px; |
|
||||||
margin-right: 5px; |
import { Text } from './styled' |
||||||
} |
|
||||||
` |
type SportNameProps = { sport: SportTypes } |
||||||
|
|
||||||
|
export const SportName = ({ sport }: SportNameProps) => { |
||||||
|
const { translate } = useLexicsStore() |
||||||
|
|
||||||
|
return ( |
||||||
|
<Text color={getSportColor(sport)}> |
||||||
|
{translate(getSportLexic(sport))} |
||||||
|
</Text> |
||||||
|
) |
||||||
|
} |
||||||
|
|||||||
@ -0,0 +1,16 @@ |
|||||||
|
import styled from 'styled-components/macro' |
||||||
|
|
||||||
|
import { devices } from 'config/devices' |
||||||
|
|
||||||
|
export const Text = styled.span<{ color: string }>` |
||||||
|
margin-right: 10px; |
||||||
|
font-size: 11px; |
||||||
|
color: ${({ color }) => color}; |
||||||
|
letter-spacing: 0.02em; |
||||||
|
text-transform: uppercase; |
||||||
|
|
||||||
|
@media ${devices.tablet} { |
||||||
|
font-size: 10px; |
||||||
|
margin-right: 5px; |
||||||
|
} |
||||||
|
` |
||||||
Loading…
Reference in new issue