fix(refresher): import icons to avoid errors in react and vue (#24525)

resolves #24480
This commit is contained in:
Liam DeBeasi
2022-01-06 16:06:17 -05:00
committed by GitHub
parent 5c54593dde
commit 388622f973

View File

@ -1,4 +1,5 @@
import { Component, ComponentInterface, Element, Host, Prop, h } from '@stencil/core'; import { Component, ComponentInterface, Element, Host, Prop, h } from '@stencil/core';
import { arrowDown, caretBackSharp } from 'ionicons/icons';
import { config } from '../../global/config'; import { config } from '../../global/config';
import { getIonMode } from '../../global/ionic-global'; import { getIonMode } from '../../global/ionic-global';
@ -51,7 +52,7 @@ export class RefresherContent implements ComponentInterface {
componentWillLoad() { componentWillLoad() {
if (this.pullingIcon === undefined) { if (this.pullingIcon === undefined) {
const mode = getIonMode(this); const mode = getIonMode(this);
const overflowRefresher = (this.el.style as any).webkitOverflowScrolling !== undefined ? 'lines' : 'arrow-down'; const overflowRefresher = (this.el.style as any).webkitOverflowScrolling !== undefined ? 'lines' : arrowDown;
this.pullingIcon = config.get( this.pullingIcon = config.get(
'refreshingIcon', 'refreshingIcon',
mode === 'ios' && isPlatform('mobile') ? config.get('spinner', overflowRefresher) : 'circular' mode === 'ios' && isPlatform('mobile') ? config.get('spinner', overflowRefresher) : 'circular'
@ -80,7 +81,7 @@ export class RefresherContent implements ComponentInterface {
<ion-spinner name={this.pullingIcon as SpinnerTypes} paused></ion-spinner> <ion-spinner name={this.pullingIcon as SpinnerTypes} paused></ion-spinner>
{mode === 'md' && this.pullingIcon === 'circular' && {mode === 'md' && this.pullingIcon === 'circular' &&
<div class="arrow-container"> <div class="arrow-container">
<ion-icon name="caret-back-sharp"></ion-icon> <ion-icon icon={caretBackSharp}></ion-icon>
</div> </div>
} }
</div> </div>