Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into march-madness
Browse files Browse the repository at this point in the history
  • Loading branch information
lotinasa committed Mar 8, 2023
2 parents 63e2d48 + cd7a37a commit 46c9bd9
Show file tree
Hide file tree
Showing 127 changed files with 426 additions and 133 deletions.
Binary file added public/logos/Tennis/Husler.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logos/Tennis/adrian-mannarino.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logos/Tennis/albert-ramos-vinolas.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logos/Tennis/alex-de-minaur.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logos/Tennis/alex-molcan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logos/Tennis/alexander-bublik.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logos/Tennis/alexander-zverev.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logos/Tennis/alexei-popyrin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logos/Tennis/andrey-rublev.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logos/Tennis/andy-murray.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logos/Tennis/arthur-rinderknech.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logos/Tennis/atp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logos/Tennis/ben-shelton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logos/Tennis/benjamin-bonzi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logos/Tennis/bernabe-zapata-miralles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logos/Tennis/borna-coric.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logos/Tennis/botic-van-de-zandschulp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logos/Tennis/brandon-nakashima.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logos/Tennis/cameron-norrie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logos/Tennis/carlos-alcaraz.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logos/Tennis/casper-ruud.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logos/Tennis/christopher-o'connell.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logos/Tennis/constant-lestienne.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logos/Tennis/corentin-moutet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logos/Tennis/cristian-garin.png
Binary file added public/logos/Tennis/daniel-altmaier.png
Binary file added public/logos/Tennis/daniel-elahi-galan.png
Binary file added public/logos/Tennis/daniel-evans.png
Binary file added public/logos/Tennis/daniil-medvedev.png
Binary file added public/logos/Tennis/david-goffin.png
Binary file added public/logos/Tennis/denis-kudla.png
Binary file added public/logos/Tennis/denis-shapovalov.png
Binary file added public/logos/Tennis/diego-schwartzman.png
Binary file added public/logos/Tennis/dominic-thiem.png
Binary file added public/logos/Tennis/dusan-lajovic.png
Binary file added public/logos/Tennis/emil-ruusuvuori.png
Binary file added public/logos/Tennis/emilio-gomez.png
Binary file added public/logos/Tennis/fabio-fognini.png
Binary file added public/logos/Tennis/facundo-bagnis.png
Binary file added public/logos/Tennis/federico-coria.png
Binary file added public/logos/Tennis/felix-auger-aliassime.png
Binary file added public/logos/Tennis/filip-krajinovic.png
Binary file added public/logos/Tennis/frances-tiafoe.png
Binary file added public/logos/Tennis/francisco-cerundolo.png
Binary file added public/logos/Tennis/gregoire-barrere.png
Binary file added public/logos/Tennis/grigor-dimitrov.png
Binary file added public/logos/Tennis/holger-rune.png
Binary file added public/logos/Tennis/hubert-hurkacz.png
Binary file added public/logos/Tennis/hugo-dellien.png
Binary file added public/logos/Tennis/ilya-ivashka.png
Binary file added public/logos/Tennis/j.-j.-wolf.png
Binary file added public/logos/Tennis/jack-draper.png
Binary file added public/logos/Tennis/jannik-sinner.png
Binary file added public/logos/Tennis/jason-kubler.png
Binary file added public/logos/Tennis/jaume-munar.png
Binary file added public/logos/Tennis/jenson-brooksby.png
Binary file added public/logos/Tennis/jiri-lehecka.png
Binary file added public/logos/Tennis/john-isner.png
Binary file added public/logos/Tennis/jordan-thompson.png
Binary file added public/logos/Tennis/juan-pablo-varillas.png
Binary file added public/logos/Tennis/karen-khachanov.png
Binary file added public/logos/Tennis/laslo-djere.png
Binary file added public/logos/Tennis/lorenzo-musetti.png
Binary file added public/logos/Tennis/lorenzo-sonego.png
Binary file added public/logos/Tennis/mackenzie-mcDonald.png
Binary file added public/logos/Tennis/marco-cecchinato.png
Binary file added public/logos/Tennis/marcos-giron.png
Binary file added public/logos/Tennis/marin-cilic.png
Binary file added public/logos/Tennis/marton-fucsovics.png
Binary file added public/logos/Tennis/matteo-berrettini.png
Binary file added public/logos/Tennis/maxime-cressy.png
Binary file added public/logos/Tennis/michael-mmoh.png
Binary file added public/logos/Tennis/mikael-ymer.png
Binary file added public/logos/Tennis/miomir-kecmanovic.png
Binary file added public/logos/Tennis/nick-kyrgios.png
Binary file added public/logos/Tennis/nicolas-jarry.png
Binary file added public/logos/Tennis/novak-djokovic.png
Binary file added public/logos/Tennis/nuno-borges.png
Binary file added public/logos/Tennis/oscar-otte.png
Binary file added public/logos/Tennis/pablo-carreno-busta.png
Binary file added public/logos/Tennis/pedro-cachin.png
Binary file added public/logos/Tennis/quentin-halys.png
Binary file added public/logos/Tennis/rafael-nadal.png
Binary file added public/logos/Tennis/richard-gasquet.png
Binary file added public/logos/Tennis/roberto-bautista-agut.png
Binary file added public/logos/Tennis/roberto-carballes-baena.png
Binary file added public/logos/Tennis/sebastian-baez.png
Binary file added public/logos/Tennis/sebastian-korda.png
Binary file added public/logos/Tennis/soonwoo-kwon.png
Binary file added public/logos/Tennis/stan-wawrinka.png
Binary file added public/logos/Tennis/stefanos-tsitsipas.png
Binary file added public/logos/Tennis/tallon-griekspoor.png
Binary file added public/logos/Tennis/taylor-fritz.png
Binary file added public/logos/Tennis/thiago-monteiro.png
Binary file added public/logos/Tennis/tomas-martin-etcheverry.png
Binary file added public/logos/Tennis/tommy-paul.png
Binary file added public/logos/Tennis/ugo-humbert.png
Binary file added public/logos/Tennis/yibing-wu.png
Binary file added public/logos/Tennis/yoshihito-nishioka.png
Binary file added public/logos/Tennis/zhizhen-zhang.png
Binary file modified src/assets/fonts/LeagueIcons/LeagueIcons.ttf
Binary file not shown.
26 changes: 26 additions & 0 deletions src/assets/images/banner/10.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"image": "instant-payouts.jpg",
"url": ""
},
{
"image": "easy-as-connect-wallet.jpg",
"url": ""
},
{
"image": "vaults.jpg",
"url": "https://overtimemarkets.xyz/#/vaults"
},
{
"image": "refer-friends.jpg",
"url": "https://overtimemarkets.xyz/#/referral"
},
{
"image": "stake-thales.jpg",
"url": "https://thalesmarket.io/token"
},
{
"image": "parlay-leaderboard.jpg",
"url": "https://overtimemarkets.xyz/#/parlay-leaderboard"
}
]
26 changes: 26 additions & 0 deletions src/assets/images/banner/420.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"image": "instant-payouts.jpg",
"url": ""
},
{
"image": "easy-as-connect-wallet.jpg",
"url": ""
},
{
"image": "vaults.jpg",
"url": "https://overtimemarkets.xyz/#/vaults"
},
{
"image": "refer-friends.jpg",
"url": "https://overtimemarkets.xyz/#/referral"
},
{
"image": "stake-thales.jpg",
"url": "https://thalesmarket.io/token"
},
{
"image": "parlay-leaderboard.jpg",
"url": "https://overtimemarkets.xyz/#/parlay-leaderboard"
}
]
26 changes: 26 additions & 0 deletions src/assets/images/banner/42161.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"image": "arbitrum.png",
"url": ""
},
{
"image": "instant-payouts.jpg",
"url": ""
},
{
"image": "easy-as-connect-wallet.jpg",
"url": ""
},
{
"image": "refer-friends.jpg",
"url": "https://overtimemarkets.xyz/#/referral"
},
{
"image": "stake-thales.jpg",
"url": "https://thalesmarket.io/token"
},
{
"image": "parlay-leaderboard.jpg",
"url": "https://overtimemarkets.xyz/#/parlay-leaderboard"
}
]
Binary file added src/assets/images/banner/arbitrum.png
Binary file added src/assets/images/banner/instant-payouts.jpg
Binary file added src/assets/images/banner/parlay-leaderboard.jpg
Binary file added src/assets/images/banner/refer-friends.jpg
Binary file added src/assets/images/banner/stake-thales.jpg
Binary file added src/assets/images/banner/vaults.jpg
63 changes: 18 additions & 45 deletions src/components/BannerCarousel/BannerCarousel.tsx
Original file line number Diff line number Diff line change
@@ -1,53 +1,24 @@
import React, { useCallback, useEffect, useState } from 'react';
import React, { useMemo } from 'react';
import styled from 'styled-components';
import 'react-responsive-carousel/lib/styles/carousel.min.css';
import { Carousel } from 'react-responsive-carousel';
import { Banner, useBannersQuery } from 'queries/banners/useBannersQuery';
import { useSelector } from 'react-redux';
import { RootState } from 'redux/rootReducer';
import { getNetworkId } from 'redux/modules/wallet';

const BannerCarousel: React.FC = () => {
const [urlMap, setUrlMap] = useState<Record<number, string>>({});
const [imageCount, setImageCount] = useState<number>(0);
const networkId = useSelector((state: RootState) => getNetworkId(state));

useEffect(() => {
const fetchData = async () => {
try {
const response = await fetch(`https://api.thalesmarket.io/banner-image-count`);
if (response) {
const json = await response.json();
setImageCount(json.count);
}
} catch (e) {}
};
fetchData();
}, []);
const bannersQuery = useBannersQuery(networkId);

useEffect(() => {
const map = {} as Record<number, string>;
const fetchData = async () => {
for (let i = 1; i <= imageCount; i++) {
try {
const response = await fetch(`https://api.thalesmarket.io/banner-json/${i}`);
if (response) {
const json = await response.json();
map[i] = json.url;
}
} catch (e) {}
}
setUrlMap(map);
};
fetchData();
}, [imageCount]);

const getStyledDivs = useCallback(() => {
const divList = [];
for (let i = 1; i <= imageCount; i++) {
divList.push(<StyledDiv key={i} hasHref={!!urlMap[i]} index={i} />);
}
return divList;
}, [imageCount, urlMap]);
const banners: Banner[] = useMemo(() => {
return bannersQuery.isSuccess && bannersQuery.data ? bannersQuery.data : [];
}, [bannersQuery.isSuccess, bannersQuery.data]);

return (
<Container>
{!!imageCount && (
{banners.length > 0 && (
<Carousel
transitionTime={1000}
interval={10000}
Expand All @@ -58,12 +29,14 @@ const BannerCarousel: React.FC = () => {
dynamicHeight={true}
autoPlay={true}
onClickItem={(index) => {
if (urlMap[index + 1]) {
window.open(urlMap[index + 1]);
if (banners[index].url !== '') {
window.open(banners[index].url);
}
}}
>
{getStyledDivs()}
{banners.map((banner: Banner) => (
<StyledDiv key={banner.image} hasHref={banner.url !== ''} image={banner.image} />
))}
</Carousel>
)}
</Container>
Expand All @@ -85,12 +58,12 @@ const Container = styled.div`
}
`;

const StyledDiv = styled.div<{ index: number; hasHref?: boolean }>`
const StyledDiv = styled.div<{ image: string; hasHref: boolean }>`
max-width: 100%;
width: 1700px;
height: 165px;
margin: -1px;
background-image: ${(props) => `url(https://api.thalesmarket.io/banner-image/${props.index})`};
background-image: ${(props) => `url(${props.image})`};
cursor: ${(props) => (props.hasHref ? 'pointer' : 'default')};
background-position: center;
`;
Expand Down
3 changes: 2 additions & 1 deletion src/constants/markets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export enum SportFilterEnum {
Baseball = 'Baseball',
Hockey = 'Hockey',
UFC = 'UFC',
Motosport = 'Motosport',
Tennis = 'Tennis',
// Motosport = 'Motosport',
}

export const COLLATERALS = [
Expand Down
7 changes: 7 additions & 0 deletions src/constants/queryKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ export const QUERY_KEYS = {
ParlayAmmData: (networkId: NetworkId) => ['parlayAmmData', networkId],
Market: (marketAddress: string, networkId: NetworkId) => ['market', marketAddress, networkId],
LiveResult: (marketId: string) => ['liveResult', marketId],
EnetpulseLiveResult: (marketId: string, gameDate: string, sportTag: number) => [
'enetpulseLiveResult',
marketId,
gameDate,
sportTag,
],
ChildMarkets: (marketAddress: string, networkId: NetworkId) => ['childMarkets', marketAddress, networkId],
PositionDetails: (
marketAddress: string,
Expand Down Expand Up @@ -109,6 +115,7 @@ export const QUERY_KEYS = {
Tokens: () => ['bungee', 'tokens'],
},
MarchMadness: (walletAddress: string, networkId: NetworkId) => ['marchMadness', walletAddress, networkId],
Banners: (networkId: NetworkId) => ['banners', networkId],
};

export default QUERY_KEYS;
46 changes: 44 additions & 2 deletions src/constants/tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,24 @@ export const TAGS_LIST: Tags = [
hidden: false,
priority: 702,
},
{
id: 9153,
label: 'Tennis',
logo: `/logos/Tennis/atp.png`,
logoClass: 'icon-league league--atp',
favourite: false,
hidden: false,
priority: 602,
},
{
id: 9156,
label: 'Tennis',
logo: `/logos/Tennis/atp.png`,
logoClass: 'icon-league league--atp',
favourite: false,
hidden: false,
priority: 603,
},
];

export const SPORTS_MAP: SportsMap = {
Expand All @@ -195,9 +213,24 @@ export const SPORTS_MAP: SportsMap = {
9019: 'Soccer',
9100: 'Motosport',
9101: 'Motosport',
9153: 'Tennis',
9156: 'Tennis',
};

export const TAGS_OF_MARKETS_WITHOUT_DRAW_ODDS = [9001, 9002, 9003, 9004, 9005, 9006, 9008, 9007, 9100, 9101];
export const TAGS_OF_MARKETS_WITHOUT_DRAW_ODDS = [
9001,
9002,
9003,
9004,
9005,
9006,
9008,
9007,
9100,
9101,
9153,
9156,
];

export const SPORTS_TAGS_MAP: SportsTagsMap = {
Football: [9001, 9002],
Expand All @@ -207,6 +240,7 @@ export const SPORTS_TAGS_MAP: SportsTagsMap = {
Soccer: [9010, 9011, 9012, 9013, 9014, 9015, 9016, 9017, 9018, 9019],
UFC: [9007],
Motosport: [9100, 9101],
Tennis: [9153, 9156],
};

export enum TAGS_FLAGS {
Expand All @@ -231,10 +265,12 @@ export enum TAGS_FLAGS {
MOTOGP = 9101,
}

export const ENETPULSE_SPORTS = [9153, 9156];

export const MLS_TAG = 9010;
export const FIFA_WC_TAG = 9018;

export const PERSON_COMPETITIONS = [9007, 9100, 9101];
export const PERSON_COMPETITIONS = [9007, 9100, 9101, 9153, 9156];

export enum BetType {
WINNER = 0,
Expand Down Expand Up @@ -277,6 +313,8 @@ export const SCORING_MAP: SportsMap = {
9019: 'goals',
9100: '',
9101: '',
9153: 'gems',
9156: 'gems',
};

export const MATCH_RESOLVE_MAP: SportsMap = {
Expand All @@ -300,6 +338,8 @@ export const MATCH_RESOLVE_MAP: SportsMap = {
9019: 'regular',
9100: '',
9101: '',
9153: '',
9156: '',
};

export const SPORT_PERIODS_MAP: SportsMap = {
Expand All @@ -321,4 +361,6 @@ export const SPORT_PERIODS_MAP: SportsMap = {
9017: 'half',
9018: 'half',
9019: 'half',
9153: 'set',
9156: 'set',
};
Loading

0 comments on commit 46c9bd9

Please sign in to comment.