Boosts: Add giveaway boost type icon (#4593)
This commit is contained in:
parent
a1d004d209
commit
ea17b2e73e
@ -3,7 +3,7 @@ import React, {
|
|||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getActions, withGlobal } from '../../../global';
|
import { getActions, withGlobal } from '../../../global';
|
||||||
|
|
||||||
import type { ApiBoostStatistics, ApiPrepaidGiveaway } from '../../../api/types';
|
import type { ApiBoost, ApiBoostStatistics, ApiPrepaidGiveaway } from '../../../api/types';
|
||||||
import type { TabState } from '../../../global/types';
|
import type { TabState } from '../../../global/types';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@ -163,7 +163,7 @@ const BoostStatistics = ({
|
|||||||
</div>
|
</div>
|
||||||
));
|
));
|
||||||
|
|
||||||
const renderBoostTypeIcon = useLastCallback((boost) => {
|
const renderBoostTypeIcon = useLastCallback((boost: ApiBoost) => {
|
||||||
if (!boost.isFromGiveaway && !boost.isGift) {
|
if (!boost.isFromGiveaway && !boost.isGift) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
@ -171,12 +171,12 @@ const BoostStatistics = ({
|
|||||||
return (
|
return (
|
||||||
<div className={styles.quantity}>
|
<div className={styles.quantity}>
|
||||||
<div className={buildClassName(styles.floatingBadge,
|
<div className={buildClassName(styles.floatingBadge,
|
||||||
!boost.giveaway && styles.floatingBadgeWarning,
|
!boost.isFromGiveaway && styles.floatingBadgeWarning,
|
||||||
styles.floatingBadgeButtonColor,
|
styles.floatingBadgeButtonColor,
|
||||||
styles.floatingBadgeButton)}
|
styles.floatingBadgeButton)}
|
||||||
>
|
>
|
||||||
<Icon name="gift" className={styles.floatingBadgeIcon} />
|
<Icon name="gift" className={styles.floatingBadgeIcon} />
|
||||||
<div className={styles.floatingBadgeValue}>{lang(boost.giveaway
|
<div className={styles.floatingBadgeValue}>{lang(boost.isFromGiveaway
|
||||||
? 'lng_prizes_results_link' : 'BoostingGift')}
|
? 'lng_prizes_results_link' : 'BoostingGift')}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user