mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-27 08:00:51 +01:00
Fix Achievements (shut up harmony)
This commit is contained in:
parent
9e3dcc2271
commit
e0b7acd368
@ -43,13 +43,15 @@ export const AchievementsReducer: Reducer<IAchievementsState, IAchievementsActio
|
||||
const categories = (action.payload.categories || state.categories || null);
|
||||
|
||||
let selectedCategoryName = null;
|
||||
let selectedAchievementId = null;
|
||||
|
||||
if(categories.length > 0)
|
||||
{
|
||||
selectedCategoryName = categories[0].name;
|
||||
selectedAchievementId = categories[0].achievements[0].achievementId;
|
||||
}
|
||||
|
||||
return { ...state, categories, selectedCategoryName };
|
||||
return { ...state, categories, selectedCategoryName, selectedAchievementId };
|
||||
}
|
||||
case AchievementsActions.SET_SCORE: {
|
||||
const score = (action.payload.score || state.score || null);
|
||||
|
@ -58,7 +58,7 @@ export const AchievementCategoryView: FC<AchievementCategoryViewProps> = props =
|
||||
<h5 className="m-0 me-2 w-100">{ LocalizeText('quests.' + selectedCategoryName + '.name') }</h5>
|
||||
<div>IMAGE</div>
|
||||
</div>
|
||||
<div className="bg-secondary rounded p-2 mb-3 d-flex gap-2 align-items-center">
|
||||
{ selectedAchievement && <div className="bg-secondary rounded p-2 mb-3 d-flex gap-2 align-items-center">
|
||||
<div className="achievement-image">
|
||||
<BadgeImageView badgeCode={ getAchievementImage(selectedAchievement) } />
|
||||
</div>
|
||||
@ -66,7 +66,7 @@ export const AchievementCategoryView: FC<AchievementCategoryViewProps> = props =
|
||||
<div>{ LocalizeBadgeName(selectedAchievement.badgeId) }</div>
|
||||
<div>{ LocalizeBadgeDescription(selectedAchievement.badgeId) }</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> }
|
||||
<div className="achievements">
|
||||
<div className="row row-cols-4">
|
||||
{ getSelectedCategory().achievements.map((achievement, index) =>
|
||||
|
Loading…
Reference in New Issue
Block a user