From 9e3dcc2271dc72ccb406e5c73eecd8acc92b094b Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Sat, 18 Sep 2021 14:37:14 -0300 Subject: [PATCH] Achievements updates --- src/views/achievements/AchievementsView.scss | 29 ++++++++++++++----- src/views/achievements/AchievementsView.tsx | 2 +- .../AchievementCategoryListItemView.tsx | 11 ++++--- .../category-list/AchievementsListView.tsx | 7 ++--- .../category/AchievementCategoryView.tsx | 16 ++++++---- 5 files changed, 43 insertions(+), 22 deletions(-) diff --git a/src/views/achievements/AchievementsView.scss b/src/views/achievements/AchievementsView.scss index 00014327..fa6343fb 100644 --- a/src/views/achievements/AchievementsView.scss +++ b/src/views/achievements/AchievementsView.scss @@ -1,24 +1,28 @@ .nitro-achievements { width: 650px; - - .content-area { - min-height: 376px; - height: 376px; - } - + .score { border-color: $grid-border-color !important; background-color: $grid-bg-color; } .category { + border-color: $grid-border-color !important; + background-color: $grid-bg-color; + cursor: pointer; + + &.active { + border-color: $grid-active-border-color !important; + background-color: $grid-active-bg-color; + } + .category-score { margin-top: 43.5px; } } .achievements { - height: 230px; + height: 152px; overflow-y: auto; overflow-x: hidden; @@ -44,4 +48,15 @@ } } } + + .achievement-image { + height: 80px; + width: 80px; + + .badge-image { + width: 80px; + height: 80px; + background-size: contain; + } + } } diff --git a/src/views/achievements/AchievementsView.tsx b/src/views/achievements/AchievementsView.tsx index 38cdcf6c..48bb619b 100644 --- a/src/views/achievements/AchievementsView.tsx +++ b/src/views/achievements/AchievementsView.tsx @@ -40,7 +40,7 @@ export const AchievementsView: FC = props => { isVisible && - + setIsVisible(false) } />
diff --git a/src/views/achievements/views/category-list-item/AchievementCategoryListItemView.tsx b/src/views/achievements/views/category-list-item/AchievementCategoryListItemView.tsx index 21ebb6a7..ddc6ed24 100644 --- a/src/views/achievements/views/category-list-item/AchievementCategoryListItemView.tsx +++ b/src/views/achievements/views/category-list-item/AchievementCategoryListItemView.tsx @@ -1,6 +1,6 @@ +import classNames from 'classnames'; import { FC, useCallback, useMemo } from 'react'; import { GetConfiguration } from '../../../../api'; -import { NitroCardGridItemView } from '../../../../layout/card/grid/item/NitroCardGridItemView'; import { useAchievementsContext } from '../../context/AchievementsContext'; import { AchievementsActions } from '../../reducers/AchievementsReducer'; import { AchievementCategoryListItemViewProps } from './AchievementCategoryListItemView.types'; @@ -58,8 +58,11 @@ export const AchievementCategoryListItemView: FC selectCategory(category.name) }> -
{ getCategoryProgress }
- +
+
selectCategory(category.name) }> + +
{ getCategoryProgress }
+
+
); } diff --git a/src/views/achievements/views/category-list/AchievementsListView.tsx b/src/views/achievements/views/category-list/AchievementsListView.tsx index 216a3c3c..2ca173c7 100644 --- a/src/views/achievements/views/category-list/AchievementsListView.tsx +++ b/src/views/achievements/views/category-list/AchievementsListView.tsx @@ -1,5 +1,4 @@ import { FC } from 'react'; -import { NitroCardGridView } from '../../../../layout/card/grid/NitroCardGridView'; import { useAchievementsContext } from '../../context/AchievementsContext'; import { AchievementCategoryListItemView } from '../category-list-item/AchievementCategoryListItemView'; @@ -9,11 +8,11 @@ export const AchievementsListView: FC<{}> = props => const { categories = null, selectedCategoryName = null } = achievementsState; return ( - +
{ categories && categories.map((category, index) => { - return ; + return ; }) } - +
); }; diff --git a/src/views/achievements/views/category/AchievementCategoryView.tsx b/src/views/achievements/views/category/AchievementCategoryView.tsx index 050d6a64..8d59bba5 100644 --- a/src/views/achievements/views/category/AchievementCategoryView.tsx +++ b/src/views/achievements/views/category/AchievementCategoryView.tsx @@ -1,7 +1,7 @@ import { AchievementData } from '@nitrots/nitro-renderer'; import classNames from 'classnames'; -import { FC, useCallback } from 'react'; -import { LocalizeText } from '../../../../api'; +import { FC, useCallback, useMemo } from 'react'; +import { LocalizeBadgeDescription, LocalizeBadgeName, LocalizeText } from '../../../../api'; import { BadgeImageView } from '../../../shared/badge-image/BadgeImageView'; import { useAchievementsContext } from '../../context/AchievementsContext'; import { AchievementsActions } from '../../reducers/AchievementsReducer'; @@ -34,7 +34,7 @@ export const AchievementCategoryView: FC = props = return badgeId; }, []); - const getSelectedAchievement = useCallback(() => + const selectedAchievement = useMemo(() => { if(!getSelectedCategory()) return null; @@ -54,13 +54,17 @@ export const AchievementCategoryView: FC = props = return (
-
+
{ LocalizeText('quests.' + selectedCategoryName + '.name') }
IMAGE
-
+
+
+ +
- +
{ LocalizeBadgeName(selectedAchievement.badgeId) }
+
{ LocalizeBadgeDescription(selectedAchievement.badgeId) }