From 5b8b57695019dd8eb5874e69cf10ba19cf75b39a Mon Sep 17 00:00:00 2001 From: Bill Date: Thu, 7 Oct 2021 01:43:01 -0400 Subject: [PATCH] Update exchange credit widget --- .../exchange-credit/exchange-credit-image.png | Bin 0 -> 9507 bytes .../FurnitureExchangeCreditView.scss | 7 ++- .../FurnitureExchangeCreditView.tsx | 54 +++++++++++------- 3 files changed, 39 insertions(+), 22 deletions(-) create mode 100644 src/assets/images/room-widgets/exchange-credit/exchange-credit-image.png diff --git a/src/assets/images/room-widgets/exchange-credit/exchange-credit-image.png b/src/assets/images/room-widgets/exchange-credit/exchange-credit-image.png new file mode 100644 index 0000000000000000000000000000000000000000..eef5da6cb5e1bcc91db1e615b5600064da805d73 GIT binary patch literal 9507 zcmV+;CEVJHP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>DB)CaLK~#8N?VSsh z7R8mv>oce`_yollphn{Z6qSc!+{i?TMB|<$qwxji?4J0@uEgMD<0fJ>8c6n-1SCFo zeV?3&YkVe~7(@d)U<~LCs3>5JBr1?7ilUJrtI~Ua_tx#M?_=hh8Tba14gWbc-Bn#( zU48#`A64Bw6E@?o7p1tZ8S3ilvbY=8u3cO6_BUe#0Wpgo?3HD&57v|twHaN<7I9ls zEPnD2anArro?_8vbOJRsI|%>M3wPE=VPQq{TjAE(?}r6H?HLXnwwDxUp}zl;&E~F? zsJZ5xG~(URC~3k4J4?CE;}MEL(Y4cJAnH)vr*NhS!AKUT3peYaca@nh^A*V!AMG zn64Eqt2J69f>TJ@#3^rt`S;hW9|GT={QBnTZBwAo9Mcrn9L=p)+$H$C4JAoW}A6(l-96y|(|} z(B*kfNq%&;FZj}k9_wk+i89Awo?~+wlW(KUahU5kd>@kTO(v}D=R|fd=vZgchl(!Q zc?d`&FOS9;?E_dl6R>uMPXWv0+L}jjX&GRpAd{Z~L-*42&>Xr%q&K9owLAQf3Viga zPih8Gz(pRK`Kab^{Ev&nJr6$-zHsaj;he8urDcL@{cs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uf*W_*r+ z>dxAjzj?zxWrq$rNPLbx6-5gu)62Vb@|Fug5*Q|$<<)BKdpgrldDzl1npq0EMf?c9 ziAgFZ4Zp;kh%0hY)f&NfpOjxxkjZ@J^!-YqM-LmtEawmr-ejviRr?7sEZy)F6~v{R zvcUpa?&qx=A~!%lK*JSJHuIoBLEnTNwPKMZ-{;(vr0*Fy3=Dg)w2`3wS_3khzx4?* zX%ZAL=YbeEPng5)r3|0N)mN_#VOue-Xw>#RHjuJKV$KLS@PC3%X$@a^Gs6AT`Gg$M zJYm9wFlmzgeKlWG^Vg$1ly+04{zP!`6iBjt^)qZWXZ-|DQq&r*iLO^H+peeC@$Bm8 zRHY4o5_E+S^sEr%i>1Iv9nsq|8DF|GA#wT+_2#sh51lUoMMQ_hL=2Ui&o!ii7@*{U zkt0WjQKRh9fx}6eHEWh0XA8VuZt9c~*|X{mU!sZvl?gjj7wH+yPPQR?*k9m>$eco1x;Zx0NAfNF`$;@fQ=F2ra(#*K&wDLs03}1l9M5X z=8sKlWEt8;w>JJa04K{y0+^^usCHnw^N6*EeziSpa&oxAxVzCeR?D_J1FmO&wQKX0 zzX@=2UHLa()ljrGc%$3u0`RMPt$4l8P7yW;m5&TI3G@Z^8h~Y&B`xtkTx}Y(h^Dmr zp2FWcYB};Y=_vj%@L|}?T1Iq#?a|?8{QpD<{|8w8gc)u@8OHzs002ovPDHLkV1jGp B4|V_m literal 0 HcmV?d00001 diff --git a/src/views/room/widgets/furniture/exchange-credit/FurnitureExchangeCreditView.scss b/src/views/room/widgets/furniture/exchange-credit/FurnitureExchangeCreditView.scss index 34b1b665..db574026 100644 --- a/src/views/room/widgets/furniture/exchange-credit/FurnitureExchangeCreditView.scss +++ b/src/views/room/widgets/furniture/exchange-credit/FurnitureExchangeCreditView.scss @@ -1,3 +1,8 @@ .nitro-exchange-credit { - width: 290px; + + .exchange-image { + background-image: url('../../../../../assets/images/room-widgets/exchange-credit/exchange-credit-image.png'); + width: 103px; + height: 103px; + } } diff --git a/src/views/room/widgets/furniture/exchange-credit/FurnitureExchangeCreditView.tsx b/src/views/room/widgets/furniture/exchange-credit/FurnitureExchangeCreditView.tsx index e8f6387b..d1078f66 100644 --- a/src/views/room/widgets/furniture/exchange-credit/FurnitureExchangeCreditView.tsx +++ b/src/views/room/widgets/furniture/exchange-credit/FurnitureExchangeCreditView.tsx @@ -2,7 +2,8 @@ import { FC, useCallback, useState } from 'react'; import { LocalizeText, RoomWidgetCreditFurniRedeemMessage, RoomWidgetUpdateCreditFurniEvent } from '../../../../../api'; import { BatchUpdates } from '../../../../../hooks'; import { CreateEventDispatcherHook } from '../../../../../hooks/events/event-dispatcher.base'; -import { NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../../../../layout'; +import { NitroCardContentView, NitroCardHeaderView, NitroCardView, NitroLayoutButton, NitroLayoutFlexColumn, NitroLayoutGrid, NitroLayoutGridColumn } from '../../../../../layout'; +import { NitroLayoutBase } from '../../../../../layout/base'; import { useRoomContext } from '../../../context/RoomContext'; export const FurnitureExchangeCreditView: FC<{}> = props => @@ -19,35 +20,46 @@ export const FurnitureExchangeCreditView: FC<{}> = props => CreateEventDispatcherHook(RoomWidgetUpdateCreditFurniEvent.CREDIT_FURNI_UPDATE, eventDispatcher, onRoomWidgetUpdateCreditFurniEvent); - const processAction = useCallback((type: string, value: string = null) => + const close = useCallback(() => { - switch(type) + BatchUpdates(() => { - case 'close': - BatchUpdates(() => - { - setObjectId(-1); - setValue(0); - }); - return; - case 'redeem': - widgetHandler.processWidgetMessage(new RoomWidgetCreditFurniRedeemMessage(RoomWidgetCreditFurniRedeemMessage.REDEEM, objectId)); + setObjectId(-1); + setValue(0); + }); + }, []); - processAction('close'); - return; - } - }, [ widgetHandler, objectId ]); + const redeem = useCallback(() => + { + widgetHandler.processWidgetMessage(new RoomWidgetCreditFurniRedeemMessage(RoomWidgetCreditFurniRedeemMessage.REDEEM, objectId)); + + close(); + }, [ widgetHandler, objectId, close ]); if(objectId === -1) return null; return ( - processAction('close') } /> + -
- { LocalizeText('widgets.furniture.credit.redeem.value', [ 'value' ], [ value.toString() ]) } -
- + + + + + + + + { LocalizeText('creditfurni.description', [ 'credits' ], [ value.toString() ]) } + + + { LocalizeText('creditfurni.prompt') } + + + + { LocalizeText('catalog.redeem.dialog.button.exchange') } + + +
);