diff --git a/src/features/AuthServiceApp/components/Input/index.tsx b/src/components/Input/index.tsx similarity index 100% rename from src/features/AuthServiceApp/components/Input/index.tsx rename to src/components/Input/index.tsx diff --git a/src/features/AuthServiceApp/components/Input/styled.tsx b/src/components/Input/styled.tsx similarity index 100% rename from src/features/AuthServiceApp/components/Input/styled.tsx rename to src/components/Input/styled.tsx diff --git a/src/config/lexics/highlightsPageLexic.tsx b/src/config/lexics/highlightsPageLexic.tsx new file mode 100644 index 00000000..ffad6d06 --- /dev/null +++ b/src/config/lexics/highlightsPageLexic.tsx @@ -0,0 +1,15 @@ +export const highlightsPageLexic = { + add_summary: 18360, + background_music: 18359, + choose_player: 18362, + get_highlights: 18355, + highlight_will_be_generated: 18364, + matches_highlight: 419, + maximal_duration: 18358, + player_highlight: 630, + price: 18356, + purchase_auto_generated: 18363, + sport_highlight: 15115, + team_highlight: 657, + watch_demo: 18357, +} diff --git a/src/config/lexics/indexLexics.tsx b/src/config/lexics/indexLexics.tsx index 1dc8cf4b..18da3b03 100644 --- a/src/config/lexics/indexLexics.tsx +++ b/src/config/lexics/indexLexics.tsx @@ -1,6 +1,7 @@ import { paymentLexics } from './payment' import { proceduresLexics } from './procedures' import { publicLexics } from './public' +import { highlightsPageLexic } from './highlightsPageLexic' const matchPopupLexics = { actions: 1020, @@ -154,6 +155,7 @@ export const indexLexics = { watch_now: 13020, ...confirmPopup, + ...highlightsPageLexic, ...preferencesPopupLexics, ...proceduresLexics, ...matchPopupLexics, diff --git a/src/config/pages.tsx b/src/config/pages.tsx index 0fe4b6c8..59536bb7 100644 --- a/src/config/pages.tsx +++ b/src/config/pages.tsx @@ -1,5 +1,6 @@ export const PAGES = { about_the_project: 'https://instatsport.com/InStatTV/ott_platform', + highlights: '/highlights', home: '/', match: '/matches', matomoInstatBaseUrl: 'https://matomo.instat.tv/', diff --git a/src/features/App/AuthenticatedApp.tsx b/src/features/App/AuthenticatedApp.tsx index 56719971..e796b68d 100644 --- a/src/features/App/AuthenticatedApp.tsx +++ b/src/features/App/AuthenticatedApp.tsx @@ -33,6 +33,7 @@ const MatchPage = lazy(() => import('features/MatchPage')) const PlayerPage = lazy(() => import('features/PlayerPage')) const TournamentPage = lazy(() => import('features/TournamentPage')) const SystemSettings = lazy(() => import('features/SystemSettings')) +const HighlightsPage = lazy(() => import('pages/HighlightsPage')) export const AuthenticatedApp = () => { useLexicsConfig(indexLexics) @@ -73,6 +74,9 @@ export const AuthenticatedApp = () => { + + + {!isProduction && } diff --git a/src/features/AuthServiceApp/components/Login/index.tsx b/src/features/AuthServiceApp/components/Login/index.tsx index f7067db2..6d7ce49c 100644 --- a/src/features/AuthServiceApp/components/Login/index.tsx +++ b/src/features/AuthServiceApp/components/Login/index.tsx @@ -5,7 +5,7 @@ import { RecoveryPopup } from 'features/AuthServiceApp/components/RecoveryPopup' import { PAGES } from '../../config/pages' import { LanguageSelect } from '../LanguageSelect' import { PasswordInput } from '../PasswordInput' -import { Input } from '../Input' +import { Input } from '../../../../components/Input' import { Logo } from '../Logo' import { useLoginForm } from './hooks' import { diff --git a/src/features/AuthServiceApp/components/PasswordInput/index.tsx b/src/features/AuthServiceApp/components/PasswordInput/index.tsx index 2d9ed7fa..5ec87988 100644 --- a/src/features/AuthServiceApp/components/PasswordInput/index.tsx +++ b/src/features/AuthServiceApp/components/PasswordInput/index.tsx @@ -6,7 +6,7 @@ import { isMobileDevice } from 'config/userAgent' import { useToggle } from 'hooks/useToggle' -import { Input } from '../Input' +import { Input } from '../../../../components/Input' const VisibilityButton = styled.button` border: none; diff --git a/src/features/AuthServiceApp/components/RecoveryPopup/index.tsx b/src/features/AuthServiceApp/components/RecoveryPopup/index.tsx index e13a661a..7c863103 100644 --- a/src/features/AuthServiceApp/components/RecoveryPopup/index.tsx +++ b/src/features/AuthServiceApp/components/RecoveryPopup/index.tsx @@ -17,7 +17,7 @@ import { Body, } from './styled' -import { Input } from '../Input' +import { Input } from '../../../../components/Input' import { InputGroup, Error } from '../../styled' type Props = { diff --git a/src/features/AuthServiceApp/components/Registration/index.tsx b/src/features/AuthServiceApp/components/Registration/index.tsx index c22cc405..de2fe192 100644 --- a/src/features/AuthServiceApp/components/Registration/index.tsx +++ b/src/features/AuthServiceApp/components/Registration/index.tsx @@ -8,7 +8,7 @@ import { client } from 'features/AuthServiceApp/config/clients' import { LanguageSelect } from '../LanguageSelect' import { PasswordInput } from '../PasswordInput' -import { Input } from '../Input' +import { Input } from '../../../../components/Input' import { Logo } from '../Logo' import { useRegistrationForm } from './hooks' import { diff --git a/src/features/Combobox/index.tsx b/src/features/Combobox/index.tsx index b6a42e44..da29ce96 100644 --- a/src/features/Combobox/index.tsx +++ b/src/features/Combobox/index.tsx @@ -38,6 +38,7 @@ export const Combobox = (props: Props) => { noSearch, title, withError, + wrapperHeight, } = props const { @@ -62,6 +63,7 @@ export const Combobox = (props: Props) => { {withError && } diff --git a/src/features/Common/Input/styled.tsx b/src/features/Common/Input/styled.tsx index 65367035..23b529db 100644 --- a/src/features/Common/Input/styled.tsx +++ b/src/features/Common/Input/styled.tsx @@ -9,12 +9,13 @@ import { isMobileDevice } from 'config/userAgent' export type WrapperProps = { error?: string | null, hasRightIcon?: boolean, + wrapperHeight?: number, wrapperWidth?: number, } export const wrapperStyles = css` width: ${({ wrapperWidth }) => (wrapperWidth ? `${wrapperWidth}px` : '100%')}; - height: 2.2rem; + height: ${({ wrapperHeight }) => (wrapperHeight ? `${wrapperHeight}px` : '2.2rem')}; margin-top: 20px; padding-left: 24px; padding-right: ${({ hasRightIcon = 24 }) => (hasRightIcon ? '62px' : '24px')}; @@ -23,7 +24,7 @@ export const wrapperStyles = css` display: flex; align-items: center; background-color: #3F3F3F; - box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.3); + box-shadow: 0px 1px 1px rgba(43, 30, 30, 0.3); border-radius: 2px; border: 1px solid ${(({ error }) => (isNil(error) ? 'transparent' : '#E64646'))}; border-width: 1px; @@ -183,23 +184,30 @@ export const Error = styled(T9n)` : '' )} ` +export const LabelAfter = styled.p` + font-style: normal; + font-weight: normal; + white-space: nowrap; + font-size: 0.8rem; + line-height: 24px; + letter-spacing: -0.01em; + padding-top: 2px; + color: ${({ theme: { colors } }) => colors.secondary}; + width: ${({ labelWidth }) => (labelWidth ? `${labelWidth}px` : '')}; + min-width: ${({ labelWidth }) => (labelWidth ? `${labelWidth}px` : '')}; -export const Icon = styled.div<{ image: string }>` - position: absolute; - right: 22px; - top: 50%; - width: 24px; - height: 24px; - transform: translateY(-50%); - background-image: url(/images/${({ image }) => `${image}.svg`}); - background-size: 100%; - background-repeat: no-repeat; - cursor: pointer; + @media ${devices.tablet} { + font-size: 1.6rem; + width: 9rem; + } ${isMobileDevice ? css` - width: 18px; - height: 18px; - right: 11px; + @media (max-width: 650px){ + display: block; + padding-left: 10px; + font-size: 12px; + width: auto; + } ` - : ''} + : ''}; ` diff --git a/src/features/ProfileCard/hooks.tsx b/src/features/ProfileCard/hooks.tsx index bf342bc4..84acf33b 100644 --- a/src/features/ProfileCard/hooks.tsx +++ b/src/features/ProfileCard/hooks.tsx @@ -9,7 +9,12 @@ import { usePageParams } from 'hooks/usePageParams' import { useUserFavoritesStore } from 'features/UserFavorites/store' export const useProfileCard = () => { - const { addRemoveFavorite, userFavorites } = useUserFavoritesStore() + const { + addRemoveFavorite, + setPlayerHighlight, + userFavorites, + } = useUserFavoritesStore() + const { profileId, profileType, @@ -44,6 +49,7 @@ export const useProfileCard = () => { isFavorite, profileId, profileType, + setPlayerHighlight, sportType, toggleFavorites, } diff --git a/src/features/ProfileCard/index.tsx b/src/features/ProfileCard/index.tsx index 4d71c595..e519df6e 100644 --- a/src/features/ProfileCard/index.tsx +++ b/src/features/ProfileCard/index.tsx @@ -1,6 +1,8 @@ +import { Link } from 'react-router-dom' + import type { ObjectWithName } from 'features/Name' -import { ProfileTypes } from 'config' +import { PAGES, ProfileTypes } from 'config' import { T9n } from 'features/T9n' import { useName } from 'features/Name' @@ -16,10 +18,12 @@ import { ProfileName, InfoFlag, StyledLink, + SсBtnWrapper, + SсGetHighlightBtn, } from './styled' import { useProfileCard } from './hooks' -type Props = { +export type ProfileType = { profile: ObjectWithName & { additionalInfo: ObjectWithName & { id: number, @@ -28,13 +32,14 @@ type Props = { }, } -export const ProfileCard = ({ profile }: Props) => { +export const ProfileCard = ({ profile }: ProfileType) => { const name = useName(profile || {}) const { isFavorite, profileId, profileType, + setPlayerHighlight, sportType, toggleFavorites, } = useProfileCard() @@ -65,10 +70,17 @@ export const ProfileCard = ({ profile }: Props) => { ) : } - - - - + + + + + + + setPlayerHighlight(profile)}> + + + + ) diff --git a/src/features/ProfileCard/styled.tsx b/src/features/ProfileCard/styled.tsx index 106ee86d..9ea22702 100644 --- a/src/features/ProfileCard/styled.tsx +++ b/src/features/ProfileCard/styled.tsx @@ -5,6 +5,7 @@ import { isMobileDevice } from 'config/userAgent' import { ProfileLogo } from 'features/ProfileLogo' import { ProfileLink } from 'features/ProfileLink' +import { ButtonSolid } from 'features/Common' import { Name } from 'features/Name' export const Wrapper = styled.div` @@ -167,3 +168,22 @@ export const StyledLink = styled(ProfileLink)` text-decoration: underline; } ` + +export const SсBtnWrapper = styled.div` + display: flex; + flex-direction: row; +` + +export const SсGetHighlightBtn = styled(ButtonSolid)` + background-color: white; + color: #000000; + display: flex; + align-items: center; + font-weight: 600; + font-size: 0.75rem; + text-transform: uppercase; + width: fit-content; + height: 1.95rem; + border-radius: 13px; + margin-left: 5px; +` diff --git a/src/features/UserAccount/components/PersonalInfoForm/index.tsx b/src/features/UserAccount/components/PersonalInfoForm/index.tsx index 3e437393..eafb82ce 100644 --- a/src/features/UserAccount/components/PersonalInfoForm/index.tsx +++ b/src/features/UserAccount/components/PersonalInfoForm/index.tsx @@ -51,7 +51,7 @@ export const PersonalInfoForm = (props: Props) => { autoComplete='given-name' labelWidth={labelWidth} onChange={updateFormValue(firstname)} - editIcon + iconName='Edit' maxLength={500} withError={false} /> @@ -61,7 +61,7 @@ export const PersonalInfoForm = (props: Props) => { autoComplete='family-name' labelWidth={labelWidth} onChange={updateFormValue(lastname)} - editIcon + iconName='Edit' maxLength={500} withError={false} /> @@ -73,7 +73,7 @@ export const PersonalInfoForm = (props: Props) => { labelWidth={labelWidth} onChange={updateFormValue(phone)} error={readFormError(phone)} - editIcon + iconName='Edit' maxLength={100} withError={false} /> diff --git a/src/features/UserAccount/index.tsx b/src/features/UserAccount/index.tsx index 57b1137c..3882f6dd 100644 --- a/src/features/UserAccount/index.tsx +++ b/src/features/UserAccount/index.tsx @@ -1,4 +1,4 @@ -import { Route } from 'react-router-dom' +import { Route, Link } from 'react-router-dom' import { PAGES } from 'config' import { isProduction } from 'config/env' @@ -24,6 +24,7 @@ import { Navigations, StyledLink, UserAccountWrapper, + ScButtonGetHighlight, } from './styled' import { CompanyInfo } from '../CompanyInfo' import { PoweredByInstat } from './components/PoweredByInstat/PoweredByInstat' @@ -70,6 +71,11 @@ const UserAccount = () => { + + + + + diff --git a/src/features/UserAccount/styled.tsx b/src/features/UserAccount/styled.tsx index ae714476..73a64ff5 100644 --- a/src/features/UserAccount/styled.tsx +++ b/src/features/UserAccount/styled.tsx @@ -258,3 +258,12 @@ export const InlineButton = styled.button` opacity: 0.5; } ` + +export const ScButtonGetHighlight = styled(ButtonOutline)` + max-width: 130px; + max-height: 50px; + margin: 15px 0; + border: 1px solid #FFFFFF; + border-radius: 5px; + filter: drop-shadow(0px 1px 1px rgba(0, 0, 0, 0.3)); +` diff --git a/src/features/UserFavorites/hooks/index.tsx b/src/features/UserFavorites/hooks/index.tsx index 6f2ec9d7..fe99a0ee 100644 --- a/src/features/UserFavorites/hooks/index.tsx +++ b/src/features/UserFavorites/hooks/index.tsx @@ -2,16 +2,26 @@ import { useCallback, useState } from 'react' import find from 'lodash/find' +import type { ObjectWithName } from 'features/Name' + import type { UserFavorites } from 'requests' import { modifyUserFavorites, getUserFavorites } from 'requests' import { useToggle } from 'hooks/useToggle' import { ProfileTypes } from 'config' +type ProfileType = ObjectWithName & { + additionalInfo: ObjectWithName & { + id: number, + tournamentId?: number, + }, +} + type Args = Parameters[0] export const useUserFavorites = () => { const [userFavorites, setUserFavorites] = useState([]) + const [playerHighlight, setPlayerHighlight] = useState({} as ProfileType) const { close, @@ -42,6 +52,8 @@ export const useUserFavorites = () => { isInFavorites, isOpen, open, + playerHighlight, + setPlayerHighlight, userFavorites, } } diff --git a/src/libs/index.ts b/src/libs/index.ts index 1ab5d96b..e96e828f 100644 --- a/src/libs/index.ts +++ b/src/libs/index.ts @@ -7,6 +7,7 @@ export { Football } from './objects/Football' export { Hockey } from './objects/Hockey' export { Handball } from './objects/Handball' export { Volleyball } from './objects/Volleyball' +export { Search } from './objects/Search' export { Star } from './objects/Star' export { Dollar } from './objects/Dollar' export { Close } from './objects/Close' diff --git a/src/libs/objects/Search.tsx b/src/libs/objects/Search.tsx new file mode 100644 index 00000000..7697c8de --- /dev/null +++ b/src/libs/objects/Search.tsx @@ -0,0 +1,20 @@ +export const Search = () => ( + + + + +) diff --git a/src/pages/HighlightsPage/components/FormHighlights/hooks.tsx b/src/pages/HighlightsPage/components/FormHighlights/hooks.tsx new file mode 100644 index 00000000..7e5d5206 --- /dev/null +++ b/src/pages/HighlightsPage/components/FormHighlights/hooks.tsx @@ -0,0 +1,18 @@ +import { useEffect, useState } from 'react' +import { getSportList } from 'requests/getSportList' + +export const useHighlightsForm = () => { + const [sports, setSports] = useState() + const players: any = [] + + console.log('sports', sports) + useEffect(() => { + getSportList().then(setSports) + // getTeams().then(teams) + }, []) + return { + players, + sports, + // teams, + } +} diff --git a/src/pages/HighlightsPage/components/FormHighlights/index.tsx b/src/pages/HighlightsPage/components/FormHighlights/index.tsx new file mode 100644 index 00000000..406e349f --- /dev/null +++ b/src/pages/HighlightsPage/components/FormHighlights/index.tsx @@ -0,0 +1,114 @@ +import { Combobox } from 'features/Combobox' +import { Input } from 'features/Common' +import { T9n } from 'features/T9n' +import { useUserFavoritesStore } from 'features/UserFavorites/store' + +import { useHighlightsForm } from './hooks' + +import { + ScWrapper, + ScTitle, + ScText, + ScInputGroup, + ScForm, + ScInfoBlock, +} from './styled' + +const labelWidth = 180 +const wrapperHeight = 50 + +export const FormHighlights = () => { + const { sports } = useHighlightsForm() + const { playerHighlight } = useUserFavoritesStore() + + return ( + + + + + + +
+ +
+
+ + + console.log(123)} + options={sports} + maxLength={500} + withError={false} + wrapperHeight={wrapperHeight} + /> + console.log('lkdsmfkl')} + iconName='Search' + maxLength={500} + withError={false} + wrapperHeight={wrapperHeight} + /> + console.log('lkdsmfkl')} + iconName='Search' + maxLength={500} + withError={false} + wrapperHeight={wrapperHeight} + /> + console.log('lkdsmfkl')} + maxLength={500} + withError={false} + wrapperHeight={wrapperHeight} + // pattern={'1'} + labelAfter='min' + /> + console.log(123)} + options={[]} + maxLength={500} + withError={false} + wrapperHeight={wrapperHeight} + /> + console.log(123)} + options={[]} + maxLength={500} + withError={false} + wrapperHeight={wrapperHeight} + /> + + +
+ ) +} diff --git a/src/pages/HighlightsPage/components/FormHighlights/styled.tsx b/src/pages/HighlightsPage/components/FormHighlights/styled.tsx new file mode 100644 index 00000000..66a3e0db --- /dev/null +++ b/src/pages/HighlightsPage/components/FormHighlights/styled.tsx @@ -0,0 +1,47 @@ +import styled, { css } from 'styled-components/macro' + +import { isMobileDevice } from 'config/userAgent' + +export const ScWrapper = styled.div` + max-width: 560px; + display: flex; + flex-direction: column; + color: #FFFFFF; + padding: 0 40px; +` +export const ScInfoBlock = styled.div` + display: flex; + flex-direction: column; + justify-content: space-between; + height: 186px; +` + +export const ScTitle = styled.span` + font-weight: 700; + font-size: 34px; + line-height: 40px; + /* margin-bottom: 15px; */ +` + +export const ScText = styled.div` + font-weight: 400; + font-size: 16px; + line-height: 28px; +` + +export const ScInputGroup = styled.div` + + .Search__input { + transform: translateY(50%); + } +` +export const ScForm = styled.form` + width: 100%; + max-width: 560px; + display: flex; + flex-direction: column; + ${isMobileDevice + ? css` + ` + : ''}; +` diff --git a/src/pages/HighlightsPage/components/PriceInfo/index.tsx b/src/pages/HighlightsPage/components/PriceInfo/index.tsx new file mode 100644 index 00000000..c0f52823 --- /dev/null +++ b/src/pages/HighlightsPage/components/PriceInfo/index.tsx @@ -0,0 +1,33 @@ +import { ReactNode } from 'react' + +import { T9n } from 'features/T9n' + +import { + ScCurrency, + ScPriceInfo, + ScTitle, + ScPrice, + ScWatchDemo, +} from './styled' + +type PriceInfoType = { + currency?: number, + price?: number, +} + +export const PriceInfo = ({ currency, price }: PriceInfoType) => ( + + + + + + + {currency || '$'} + + {price} + + + + + +) diff --git a/src/pages/HighlightsPage/components/PriceInfo/styled.tsx b/src/pages/HighlightsPage/components/PriceInfo/styled.tsx new file mode 100644 index 00000000..cd657591 --- /dev/null +++ b/src/pages/HighlightsPage/components/PriceInfo/styled.tsx @@ -0,0 +1,43 @@ +import styled, { css } from 'styled-components/macro' + +export const ScPriceInfo = styled.div` + width: 188px; + height: 186px; + border: 1px solid #FFFFFF; + border-radius: 34px; + display: flex; + flex-direction: column; + justify-content: center; + align-content: center; + color: #FFFFFF; + padding: 21px; + + font-weight: 600; + font-size: 20px; + line-height: 28px; + + > * { + margin: 10px 0; + } +` + +export const ScTitle = styled.span` + text-align: center; +` + +export const ScPrice = styled.span` + font-size: 80px; + text-align: center; +` + +export const ScCurrency = styled.span` + font-size: 40px; +` + +export const ScWatchDemo = styled.span` + font-weight: 400; + text-align: center; + text-decoration: underline; + cursor: pointer; + flex-direction: row; +` diff --git a/src/pages/HighlightsPage/index.tsx b/src/pages/HighlightsPage/index.tsx new file mode 100644 index 00000000..f62785ef --- /dev/null +++ b/src/pages/HighlightsPage/index.tsx @@ -0,0 +1,27 @@ +import { PriceInfo } from './components/PriceInfo' +import { FormHighlights } from './components/FormHighlights' + +import { + ScHeader, + ScHeaderLogo, + ScWrapper, + ScWrapperContent, +} from './styled' + +const HighlightsPage = () => { + console.log(123) + + return ( + + + + + + + + + + ) +} + +export default HighlightsPage diff --git a/src/pages/HighlightsPage/styled.tsx b/src/pages/HighlightsPage/styled.tsx new file mode 100644 index 00000000..50e04538 --- /dev/null +++ b/src/pages/HighlightsPage/styled.tsx @@ -0,0 +1,27 @@ +import styled, { css } from 'styled-components/macro' + +import { Logo } from 'features/Logo' + +export const ScHeader = styled.div` + width: 100%; + max-height: 95px; + padding: 32px 36px; + background: linear-gradient(236.13deg, rgba(53, 96, 225, 0.56) -4.49%, rgba(0, 0, 0, 0) 98.29%), #000000; +` + +export const ScHeaderLogo = styled(Logo)` +` + +export const ScWrapper = styled.div` + width: 100%; + height: 100%; + display: flex; + flex-direction: column; + +` + +export const ScWrapperContent = styled.div` + display: flex; + flex-direction: row; + padding: 100px 170px 0px 170px; +`