mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
perf(various): don't use lazy-loaded icon names in components (#24671)
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import { Component, ComponentInterface, Element, Host, Prop, h } from '@stencil/core';
|
||||
import { arrowBackSharp, chevronBack } from 'ionicons/icons';
|
||||
|
||||
import { config } from '../../global/config';
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
@ -83,11 +84,11 @@ export class BackButton implements ComponentInterface, ButtonInterface {
|
||||
|
||||
if (getIonMode(this) === 'ios') {
|
||||
// default ios back button icon
|
||||
return config.get('backButtonIcon', 'chevron-back');
|
||||
return config.get('backButtonIcon', chevronBack);
|
||||
}
|
||||
|
||||
// default md back button icon
|
||||
return config.get('backButtonIcon', 'arrow-back-sharp');
|
||||
return config.get('backButtonIcon', arrowBackSharp);
|
||||
}
|
||||
|
||||
get backButtonText() {
|
||||
|
@ -1,3 +1,5 @@
|
||||
import { arrowBackSharp, chevronBack } from 'ionicons/icons';
|
||||
|
||||
import { newSpecPage } from '@stencil/core/testing';
|
||||
import { BackButton } from "../back-button";
|
||||
import { config } from "../../../global/config";
|
||||
@ -46,12 +48,12 @@ describe('back button', () => {
|
||||
|
||||
it('default icon for ios mode', async () => {
|
||||
const bb = await newBackButton('ios');
|
||||
expect(bb.backButtonIcon).toBe('chevron-back');
|
||||
expect(bb.backButtonIcon).toBe(chevronBack);
|
||||
});
|
||||
|
||||
it('default icon', async () => {
|
||||
const bb = await newBackButton();
|
||||
expect(bb.backButtonIcon).toBe('arrow-back-sharp');
|
||||
expect(bb.backButtonIcon).toBe(arrowBackSharp);
|
||||
});
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user