feat: 🎸 (770) added GK label in match popup (#288)

* feat: 🎸 (770) added GK label in match popup

* quick fix
keep-around/af30b88d367751c9e05a735e4a0467a96238ef47
Arthur 5 years ago committed by GitHub
parent e349d12a14
commit e4b9627e95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      src/config/lexics/indexLexics.tsx
  2. 1
      src/features/MatchPage/types.tsx
  3. 24
      src/features/MatchPopup/components/PlayersList/index.tsx
  4. 38
      src/features/MatchPopup/components/PlayersList/styled.tsx

@ -3,6 +3,7 @@ import { proceduresLexics } from './procedures'
const matchPopupLexics = { const matchPopupLexics = {
apply: 13491, apply: 13491,
episode_duration: 13410, episode_duration: 13410,
gk: 3515,
go_back_to_match: 13405, go_back_to_match: 13405,
match_interviews: 13031, match_interviews: 13031,
match_settings: 13490, match_settings: 13490,

@ -15,6 +15,7 @@ export type MatchPlaylistOption = {
} }
export type PlayerPlaylistOption = { export type PlayerPlaylistOption = {
gk?: boolean,
id: number, id: number,
name_eng: string, name_eng: string,
name_rus: string, name_rus: string,

@ -2,6 +2,7 @@ import map from 'lodash/map'
import { ProfileTypes } from 'config' import { ProfileTypes } from 'config'
import { T9n } from 'features/T9n'
import { PlayerPlaylistOptions } from 'features/MatchPage/types' import { PlayerPlaylistOptions } from 'features/MatchPage/types'
import { useMatchPopupStore } from 'features/MatchPopup/store' import { useMatchPopupStore } from 'features/MatchPopup/store'
@ -12,6 +13,8 @@ import {
Logo, Logo,
PlayerName, PlayerName,
Button, Button,
PlayerPhoto,
PlayerGk,
} from './styled' } from './styled'
type Props = { type Props = {
@ -37,13 +40,20 @@ export const PlayersList = ({
map(players, (player) => ( map(players, (player) => (
<Item key={player.id} isReady={allLoaded}> <Item key={player.id} isReady={allLoaded}>
<Button onClick={() => handlePlayerClick(player)}> <Button onClick={() => handlePlayerClick(player)}>
<Logo <PlayerPhoto>
id={player.id} <Logo
sportType={match.sportType} id={player.id}
profileType={ProfileTypes.PLAYERS} sportType={match.sportType}
team={team} profileType={ProfileTypes.PLAYERS}
onLoad={() => onLoad(player.id)} team={team}
/> onLoad={() => onLoad(player.id)}
/>
{player.gk && (
<PlayerGk>
<T9n t='gk' />
</PlayerGk>
)}
</PlayerPhoto>
<PlayerName nameObj={player} /> <PlayerName nameObj={player} />
</Button> </Button>
</Item> </Item>

@ -34,7 +34,8 @@ export const List = styled.ul<ListProps>`
export const Item = styled.li<ItemProps>` export const Item = styled.li<ItemProps>`
width: 76px; width: 76px;
height: 95px; min-height: 95px;
max-height: 110px;
margin: 10px; margin: 10px;
transition: .3s; transition: .3s;
opacity: ${({ isReady }) => ( opacity: ${({ isReady }) => (
@ -77,20 +78,13 @@ type LogoProps = {
} }
export const Logo = styled(ProfileLogo)<LogoProps>` export const Logo = styled(ProfileLogo)<LogoProps>`
width: 65px; width: 100%;
height: 65px;
border-radius: 50%; border-radius: 50%;
background-color: ${({ team }) => ( background-color: ${({ team }) => (
team === Teams.TEAM1 team === Teams.TEAM1
? '#222222' ? '#222222'
: '#FFFFFF' : '#FFFFFF'
)}; )};
@media ${devices.mobile} {
width: 49px;
height: 49px;
margin-right: 11px;
}
` `
export const PlayerName = styled(Name)` export const PlayerName = styled(Name)`
@ -109,3 +103,29 @@ export const PlayerName = styled(Name)`
letter-spacing: 0.1px; letter-spacing: 0.1px;
} }
` `
export const PlayerPhoto = styled.div`
position: relative;
width: 65px;
height: 65px;
margin-bottom: 10px;
@media ${devices.mobile} {
width: 49px;
height: 49px;
margin-right: 11px;
}
`
export const PlayerGk = styled.span`
position: absolute;
bottom: 0;
left: 50%;
transform: translate(-50%, 50%);
width: 24px;
font-weight: bold;
font-size: 9px;
line-height: 12px;
background-color: #fff;
border-radius: 12px;
`

Loading…
Cancel
Save