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. 18
      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>`
margin-left: 10px;
font-style: normal;
font-weight: normal;
white-space: nowrap;

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

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

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

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

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

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

Loading…
Cancel
Save