You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
956 B
34 lines
956 B
import {
|
|
SportTypes,
|
|
ProfileTypes,
|
|
PROFILE_NAMES,
|
|
} from 'config'
|
|
|
|
const IMAGES_URLS = {
|
|
[SportTypes.BASKETBALL]: 'https://basketball.instatscout.com/images',
|
|
[SportTypes.FOOTBALL]: 'https://instatscout.com/images',
|
|
[SportTypes.HOCKEY]: 'https://hockey.instatscout.com/images',
|
|
[SportTypes.HANDBALL]: 'https://handball.instatscout.com/images',
|
|
[SportTypes.STREETBALL]: 'https://streetball.instatscout.com/images',
|
|
[SportTypes.VOLLEYBALL]: 'https://volleyball.instatscout.com/images',
|
|
}
|
|
|
|
type GetLogoArgs = {
|
|
id: number,
|
|
profileType: ProfileTypes,
|
|
size?: number,
|
|
sportType: SportTypes,
|
|
}
|
|
|
|
export const getProfileLogo = ({
|
|
id,
|
|
profileType,
|
|
size = 180,
|
|
sportType,
|
|
}: GetLogoArgs) => {
|
|
const content = sportType === SportTypes.BOXING
|
|
? `https://images.insports.tv/${sportType}/${PROFILE_NAMES[profileType]}/${id}.png`
|
|
: `${IMAGES_URLS[sportType]}/${PROFILE_NAMES[profileType]}/${size}/${id}.png`
|
|
|
|
return content
|
|
}
|
|
|