started bonus rare widget

This commit is contained in:
Dank074 2021-07-24 19:52:54 -05:00
parent 789aa3c183
commit 9594843e2e
3 changed files with 22 additions and 3 deletions

View File

@ -130,3 +130,4 @@
}
@import './views/widgets/promo-article/PromoArticleWidgetView.scss';
@import './views/widgets/bonus-rare/BonusRareWidgetView.scss';

View File

@ -0,0 +1,10 @@
.bonus-rare {
height: 100px;
justify-content: center;
.bonus-bar-container {
height: 30px;
width: 300px;
border: 2px ridge #e2e2e2;
}
}

View File

@ -26,7 +26,15 @@ export const BonusRareWidgetView: FC<BonusRareWidgetViewProps> = props =>
CreateMessageHook(BonusRareInfoMessageEvent, onBonusRareInfoMessageEvent);
if(!productType) return (null);
return (<div className="bonus-rare widget">{productType}</div>);
if (!productType) return (null);
return (
<div className="bonus-rare widget d-flex">
{productType}
<div className="bg-light-dark rounded overflow-hidden position-relative bonus-bar-container">
<div className="d-flex justify-content-center align-items-center w-100 h-100 position-absolute small top-0">{(totalCoinsForBonus - coinsStillRequiredToBuy) + '/' + totalCoinsForBonus}</div>
<div className="small bg-info rounded position-absolute top-0 h-100" style={{ width: ((totalCoinsForBonus - coinsStillRequiredToBuy) / totalCoinsForBonus) * 100 + '%' }}></div>
</div>
</div>
);
}