fix(#258): change link for aws logo
parent
3474509c25
commit
5b9130eb11
@ -1,37 +1,18 @@ |
||||
import { |
||||
SportTypes, |
||||
ProfileTypes, |
||||
PROFILE_NAMES, |
||||
API_ROOT, |
||||
ProfileTypes, |
||||
SportTypes, |
||||
URL_AWS, |
||||
} from 'config' |
||||
|
||||
const IMAGES_URLS = { |
||||
[SportTypes.BASKETBALL]: 'https://basketball.instatscout.com/images', |
||||
[SportTypes.BOXING]: 'https://boxing.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 = { |
||||
awsInError?: boolean, |
||||
id: number, |
||||
profileType: ProfileTypes, |
||||
size?: number, |
||||
sportType: SportTypes, |
||||
} |
||||
|
||||
export const getProfileLogo = ({ |
||||
awsInError, |
||||
id, |
||||
profileType, |
||||
size = 180, |
||||
sportType, |
||||
}: GetLogoArgs) => { |
||||
if (awsInError) { |
||||
return `${IMAGES_URLS[sportType]}/${PROFILE_NAMES[profileType]}/${size}/${id}.png` |
||||
} |
||||
return `${API_ROOT}/v1/${PROFILE_NAMES[profileType]}/${sportType}/${id}/media` |
||||
} |
||||
}: GetLogoArgs) => `${URL_AWS}/media/${PROFILE_NAMES[profileType]}/${sportType}/${id}/${profileType === ProfileTypes.PLAYERS ? 'photo.png' : 'logo.jpg'}` |
||||
|
||||
Loading…
Reference in new issue