From bc93c0ac0fe30b028b75bf2281145d3f1779b4e4 Mon Sep 17 00:00:00 2001 From: Bill Date: Thu, 15 Apr 2021 23:44:54 -0400 Subject: [PATCH] Update purse --- src/App.tsx | 8 ++++---- src/views/purse/PurseView.tsx | 11 ++++++---- src/views/purse/currency/CurrencyView.scss | 24 +--------------------- src/views/purse/currency/CurrencyView.tsx | 7 ++++--- src/views/right-side/RightSideView.scss | 1 + 5 files changed, 17 insertions(+), 34 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 52576f6a..79ee9e1e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -116,11 +116,11 @@ export function App(): JSX.Element if(!WebGL.isWebGLAvailable()) { dispatchMainEvent(new NitroEvent(Nitro.WEBGL_UNAVAILABLE)); - - return; } - - Nitro.instance.core.configuration.init(); + else + { + Nitro.instance.core.configuration.init(); + } return (
diff --git a/src/views/purse/PurseView.tsx b/src/views/purse/PurseView.tsx index 20801686..3c26b4bc 100644 --- a/src/views/purse/PurseView.tsx +++ b/src/views/purse/PurseView.tsx @@ -1,6 +1,5 @@ import { Map } from 'immutable'; -import { UserCreditsEvent, UserCurrencyEvent, UserCurrencyUpdateEvent } from 'nitro-renderer'; -import { UserCurrencyComposer } from 'nitro-renderer/src/nitro/communication/messages/outgoing/user/inventory/currency/UserCurrencyComposer'; +import { Nitro, UserCreditsEvent, UserCurrencyComposer, UserCurrencyEvent, UserCurrencyUpdateEvent } from 'nitro-renderer'; import { useEffect, useState } from 'react'; import { CreateMessageHook, SendMessageHook } from '../../hooks/messages/message-event'; import { FadeTransition } from '../../transitions/FadeTransition'; @@ -50,12 +49,16 @@ export function PurseView(props: PurseViewProps): JSX.Element SendMessageHook(new UserCurrencyComposer()); }, []); + const displayedCurrencies = Nitro.instance.getConfiguration('system.currency.types', []); + return ( -
-
+
+
{ currencies && currencies.entrySeq().map(([ key, value ]) => { + if(displayedCurrencies.indexOf(parseInt(key)) === -1) return null; + return }) }
diff --git a/src/views/purse/currency/CurrencyView.scss b/src/views/purse/currency/CurrencyView.scss index 796a402a..d011dda4 100644 --- a/src/views/purse/currency/CurrencyView.scss +++ b/src/views/purse/currency/CurrencyView.scss @@ -1,31 +1,9 @@ -.purse-item { +.nitro-purse-item { flex: 46%; - margin-bottom: 3px; - padding: 0.23rem; margin-right: 3px; &:nth-child(2n), &:last-child { margin-right: 0; } - - .item-value { - font-size: $font-size-sm; - padding: 2px 5px; - } - - .item-icon { - position: relative; - width: 25px; - height: 25px; - border-radius: $card-border-radius; - - .currency-icon { - position: absolute; - background-position: center; - background-repeat: no-repeat; - width: 100%; - height: 100%; - } - } } diff --git a/src/views/purse/currency/CurrencyView.tsx b/src/views/purse/currency/CurrencyView.tsx index 04c6a310..98ff77ef 100644 --- a/src/views/purse/currency/CurrencyView.tsx +++ b/src/views/purse/currency/CurrencyView.tsx @@ -1,3 +1,4 @@ +import { CurrencyIcon } from '../../../utils/currency-icon/CurrencyIcon'; import { CurrencyViewProps } from './CurrencyView.types'; export function CurrencyView(props: CurrencyViewProps): JSX.Element @@ -5,9 +6,9 @@ export function CurrencyView(props: CurrencyViewProps): JSX.Element const { type = -1, amount = 0 } = props; return ( -
-
{ amount }
-
{ type }
+
+
{ amount }
+
); } diff --git a/src/views/right-side/RightSideView.scss b/src/views/right-side/RightSideView.scss index 74d6bd35..770354f1 100644 --- a/src/views/right-side/RightSideView.scss +++ b/src/views/right-side/RightSideView.scss @@ -2,5 +2,6 @@ position: absolute; top: 10px; right: 10px; + width: 200px; z-index: $rightside-zindex; }