fix(#2526): change getplayersmatches procedure

keep-around/f09ad060abadb54ab731d2923f633e5162e907d2
Andrei Dekterev 4 years ago
parent cdfdb015ae
commit a961d09e62
  1. 1
      src/features/Common/Input/styled.tsx
  2. 1
      src/features/PlayerPage/hooks.tsx
  3. 3
      src/pages/HighlightsPage/components/FormHighlights/hooks.tsx
  4. 22
      src/pages/HighlightsPage/components/FormHighlights/styled.tsx
  5. 4
      src/pages/HighlightsPage/index.tsx
  6. 6
      src/pages/HighlightsPage/styled.tsx
  7. 3
      src/requests/getMatches/getPlayerMatches.tsx

@ -187,6 +187,7 @@ export const Error = styled(T9n)<ErrorProps>`
)} )}
` `
export const LabelAfter = styled.span<TitleProps>` export const LabelAfter = styled.span<TitleProps>`
margin-left: 10px;
font-style: normal; font-style: normal;
font-weight: normal; font-weight: normal;
white-space: nowrap; white-space: nowrap;

@ -39,6 +39,7 @@ export const usePlayerPage = () => {
offset, offset,
playerId, playerId,
sportType, sportType,
sub_only: true,
}), }),
[ [
playerId, playerId,

@ -309,7 +309,7 @@ export const useHighlightsForm = () => {
name: team.name_eng, name: team.name_eng,
})), })),
), ),
), 300), ), 1000),
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
[formState.teamValue], [formState.teamValue],
) )
@ -362,6 +362,7 @@ export const useHighlightsForm = () => {
offset: 0, offset: 0,
playerId: formState?.selectedPlayer?.id, playerId: formState?.selectedPlayer?.id,
sportType: formState?.sport?.id, sportType: formState?.sport?.id,
sub_only: false,
}) })
.then(({ broadcast }) => setPlayerMatches( .then(({ broadcast }) => setPlayerMatches(
broadcast.map((match: Match) => ({ ...match, isChecked: false })), broadcast.map((match: Match) => ({ ...match, isChecked: false })),

@ -82,26 +82,16 @@ export const ScForm = styled.form`
` `
: ''}; : ''};
.FormHighlights__input__duration { & ul {
& input { max-height: 200px;
max-width: 40px;
}
}
.FormHighlights__input__sound {
& input {
max-width: 100px;
} }
& input {
text-overflow: ellipsis;
} }
.FormHighlights__select__teams, .FormHighlights__input__duration {
.FormHighlights__select__players {
& ul {
max-height: 200px;
}
& input { & input {
text-overflow: ellipsis; max-width: 40px;
} }
} }

@ -61,8 +61,8 @@ const HighlightsPage = () => {
<FormHighlights price={price} /> <FormHighlights price={price} />
<MatchesHighlights /> <MatchesHighlights />
</ScWrapperContent> </ScWrapperContent>
<ScButtonWrap onClick={() => setIsOpenPopupChangeCard(true)}> <ScButtonWrap disabled={isNotEmpty} onClick={() => setIsOpenPopupChangeCard(true)}>
<ScButton disabled={isNotEmpty}> <ScButton>
<T9n t='order_and_buy' /> <T9n t='order_and_buy' />
<ScPrice> <ScPrice>
{isMobileDevice ? ` | $${price}` : ''} {isMobileDevice ? ` | $${price}` : ''}

@ -46,14 +46,14 @@ export const ScButton = styled(ButtonSolid)`
height: 50px; height: 50px;
background: #294FC4; background: #294FC4;
border-radius: 5px; border-radius: 5px;
opacity: ${({ disabled }) => (disabled ? 0.5 : 1)}
` `
export const ScButtonWrap = styled.div` export const ScButtonWrap = styled.div<{disabled: boolean}>`
display: flex; display: flex;
justify-content: center; justify-content: center;
margin-bottom: 100px; margin-bottom: 100px;
opacity: ${({ disabled }) => (disabled ? 0.5 : 1)}
` `
export const ScPrice = styled.span` export const ScPrice = styled.span`

@ -15,6 +15,7 @@ type Args = {
offset: number, offset: number,
playerId: number, playerId: number,
sportType: SportTypes, sportType: SportTypes,
sub_only?: boolean,
} }
export const getPlayerMatches = async ({ export const getPlayerMatches = async ({
@ -22,6 +23,7 @@ export const getPlayerMatches = async ({
offset, offset,
playerId, playerId,
sportType, sportType,
sub_only,
}: Args): Promise<MatchesBySection> => { }: Args): Promise<MatchesBySection> => {
const config = { const config = {
body: { body: {
@ -30,6 +32,7 @@ export const getPlayerMatches = async ({
_p_offset: offset, _p_offset: offset,
_p_player_id: playerId, _p_player_id: playerId,
_p_sport: sportType, _p_sport: sportType,
_p_sub_only: sub_only,
...client.requests?.[proc], ...client.requests?.[proc],
}, },
proc, proc,

Loading…
Cancel
Save