Merge branch 'develop' into 'devops-staging'

Bug Fix

See merge request empatnusabangsa/ppob/ppob-frontend!151
This commit is contained in:
ajat sudrajat 2022-02-06 05:52:15 +00:00
commit 88fcb2ba40

View File

@ -1,4 +1,4 @@
import React, { useState,useEffect ,useContext} from "react"; import React, { useState, useEffect, useContext } from "react";
import { Button, Drawer, Layout, Menu, Popover, Typography, Card } from "antd"; import { Button, Drawer, Layout, Menu, Popover, Typography, Card } from "antd";
import { MenuList } from "./MenuList"; import { MenuList } from "./MenuList";
import { Link, useHistory } from "react-router-dom"; import { Link, useHistory } from "react-router-dom";
@ -47,14 +47,7 @@ export const DesktopLayout = observer(() => {
useEffect(() => { useEffect(() => {
(async () => { (async () => {
modalLoader.setLoading(true); modalLoader.setLoading(true);
await Promise.allSettled([store.authentication.getProfile()]);
await Promise.allSettled([
store.authentication.getProfile(),
store.transaction.getDataHistoryTransaction(),
]);
await store.transaction.getDataHistoryTopUpProfile(
store.authentication.profileData?.id
);
modalLoader.setLoading(false); modalLoader.setLoading(false);
})(); })();
}, []); }, []);
@ -387,7 +380,6 @@ export const DesktopLayout = observer(() => {
> >
{store.ui.mediaQuery.isMobile && ( {store.ui.mediaQuery.isMobile && (
<div <div
className={store.ui.mediaQuery.isMobile ? "shadow" : null}
style={{ style={{
top: 0, top: 0,
left: 0, left: 0,
@ -513,10 +505,12 @@ export const DesktopLayout = observer(() => {
visible={clicked} visible={clicked}
onVisibleChange={() => setClicked(!clicked)} onVisibleChange={() => setClicked(!clicked)}
> >
{new Intl.NumberFormat("id-ID", { {store.authentication.userData.role !== "Admin" &&
style: "currency", new Intl.NumberFormat("id-ID", {
currency: "IDR", style: "currency",
}).format(store.authentication.profileData?.wallet || 0)} currency: "IDR",
}).format(store.authentication.profileData?.wallet || 0)}
<Button <Button
size={"default"} size={"default"}
type={store.ui.mediaQuery.isDesktop ? "" : "link"} type={store.ui.mediaQuery.isDesktop ? "" : "link"}
@ -570,28 +564,30 @@ export const DesktopLayout = observer(() => {
width: "100%", width: "100%",
}} }}
></div> ></div>
<Card {store.authentication.userData.role !== "Admin" && (
size="small" <Card
title={ size="small"
<span title={
style={{ <span
fontStyle: "bold", style={{
textAlign: "center", fontStyle: "bold",
}} textAlign: "center",
> }}
Saldo :{" "} >
{new Intl.NumberFormat("id-ID", { Saldo :{" "}
style: "currency", {new Intl.NumberFormat("id-ID", {
currency: "IDR", style: "currency",
}).format(store.authentication.profileData?.wallet || 0)} currency: "IDR",
</span> }).format(store.authentication.profileData?.wallet || 0)}
} </span>
style={{ }
marginRight: 10, style={{
width: 210, marginRight: 10,
height: 31, width: 210,
}} height: 31,
></Card> }}
></Card>
)}
<Popover <Popover
className={store.ui.mediaQuery.isDesktop ? "shadow" : null} className={store.ui.mediaQuery.isDesktop ? "shadow" : null}
autoAdjustOverflow={true} autoAdjustOverflow={true}