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 { T9n } from 'features/T9n' |
||||
import { SportTypes } from 'config' |
||||
|
||||
export const SportName = styled(T9n)<{ color: string }>` |
||||
margin-right: 10px; |
||||
font-size: 11px; |
||||
color: ${({ color }) => color}; |
||||
letter-spacing: 0.02em; |
||||
text-transform: uppercase; |
||||
import { getSportColor, getSportLexic } from 'helpers' |
||||
|
||||
@media ${devices.tablet} { |
||||
font-size: 10px; |
||||
margin-right: 5px; |
||||
} |
||||
` |
||||
import { useLexicsStore } from 'features/LexicsStore' |
||||
|
||||
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