Fix icon fetching
Reviewed By: nikoant Differential Revision: D28505372 fbshipit-source-id: e0b001ae56cd9014bd830630ae354ad4d76c2588
This commit is contained in:
committed by
Facebook GitHub Bot
parent
d8539102d9
commit
6e206fc054
@@ -23,13 +23,13 @@ test('outline icons get correct local path', () => {
|
||||
test('filled icons get correct URL', () => {
|
||||
const iconUrl = buildIconURL('star', 12, 2);
|
||||
expect(iconUrl).toBe(
|
||||
'https://external.xx.fbcdn.net/assets/?name=star&variant=filled&size=12&set=facebook_icons&density=2x',
|
||||
'https://facebook.com/assets/?name=star&variant=filled&size=12&set=facebook_icons&density=2x',
|
||||
);
|
||||
});
|
||||
|
||||
test('outline icons get correct URL', () => {
|
||||
const iconUrl = buildIconURL('star-outline', 12, 2);
|
||||
expect(iconUrl).toBe(
|
||||
'https://external.xx.fbcdn.net/assets/?name=star&variant=outline&size=12&set=facebook_icons&density=2x',
|
||||
'https://facebook.com/assets/?name=star&variant=outline&size=12&set=facebook_icons&density=2x',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -69,7 +69,7 @@ export function buildLocalIconURL(name: string, size: number, density: number) {
|
||||
export function buildIconURL(name: string, size: number, density: number) {
|
||||
const icon = getIconPartsFromName(name);
|
||||
// eslint-disable-next-line prettier/prettier
|
||||
const url = `https://external.xx.fbcdn.net/assets/?name=${
|
||||
const url = `https://facebook.com/assets/?name=${
|
||||
icon.trimmedName
|
||||
}&variant=${
|
||||
icon.variant
|
||||
|
||||
Reference in New Issue
Block a user