1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 09:57:02 +01:00

Fixing icon paths to work in github pages (#16005)

This commit is contained in:
George Marshall 2022-09-28 06:49:54 -07:00 committed by GitHub
parent 5d9246d0c3
commit a2232125d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -28,8 +28,8 @@ export const Icon = ({
* the icon component uses mask-image instead of rendering
* the svg directly.
*/
maskImage: `url('/images/icons/icon-${name}.svg`,
WebkitMaskImage: `url('/images/icons/icon-${name}.svg`,
maskImage: `url('./images/icons/icon-${name}.svg`,
WebkitMaskImage: `url('./images/icons/icon-${name}.svg`,
...style,
}}
{...props}

View File

@ -44,16 +44,16 @@ describe('Icon', () => {
);
expect(
window.getComputedStyle(getByTestId('icon-add-square-filled')).maskImage,
).toBe(`url('/images/icons/icon-add-square-filled.svg`);
).toBe(`url('./images/icons/icon-add-square-filled.svg`);
expect(
window.getComputedStyle(getByTestId('icon-bank-filled')).maskImage,
).toBe(`url('/images/icons/icon-bank-filled.svg`);
).toBe(`url('./images/icons/icon-bank-filled.svg`);
expect(
window.getComputedStyle(getByTestId('icon-bookmark-filled')).maskImage,
).toBe(`url('/images/icons/icon-bookmark-filled.svg`);
).toBe(`url('./images/icons/icon-bookmark-filled.svg`);
expect(
window.getComputedStyle(getByTestId('icon-calculator-filled')).maskImage,
).toBe(`url('/images/icons/icon-calculator-filled.svg`);
).toBe(`url('./images/icons/icon-calculator-filled.svg`);
});
it('should render with different size classes', () => {
const { getByTestId } = render(