-
+ if (getHistoryState.state === RequestState.SUCCESS) {
+ setHistorySegments(createSegments(getHistoryState.data));
+ }
+ }, [
+ getHistoryState.state,
+ getHistoryState.data,
+ publicKey,
+ networkDetails,
+ isHideDustEnabled,
+ ]);
+
+ const isLoaderShowing =
+ getHistoryState.state === RequestState.IDLE ||
+ getHistoryState.state === RequestState.LOADING;
+
+ if (isDetailViewShowing) {
+ return
;
+ }
+
+ if (isLoaderShowing) {
+ return
;
+ }
+
+ const hasEmptyHistory = !getHistoryState?.data?.length;
+
+ return (
+
+
+
+
+ {Object.values(SELECTOR_OPTIONS).map((option) => (
+
setSelectedSegment(option)}
+ >
+ {t(option)}
- ) : (
- <>
-
-
- {Object.values(SELECTOR_OPTIONS).map((option) => (
-
setSelectedSegment(option)}
- >
- {t(option)}
-
- ))}
-
-
- {historySegments?.[SELECTOR_OPTIONS[selectedSegment]].length ? (
-
- <>
- {historySegments[SELECTOR_OPTIONS[selectedSegment]].map(
- (operation: HistoryItemOperation) => (
-
- ),
- )}
- >
-
- ) : (
-
- {isAccountHistoryLoading
- ? null
- : t("No transactions to show")}
-
+ ))}
+
+
+ {historySegments?.[SELECTOR_OPTIONS[selectedSegment]].length ? (
+
+ <>
+ {historySegments[SELECTOR_OPTIONS[selectedSegment]].map(
+ (operation: HistoryItemOperation) => (
+
+ ),
)}
-
- >
+ >
+
+ ) : (
+
{hasEmptyHistory ? t("No transactions to show") : null}
)}
-
- >
+
+
);
};
diff --git a/extension/src/popup/views/AccountHistory/styles.scss b/extension/src/popup/views/AccountHistory/styles.scss
index 2512fd7a47..558d05c825 100644
--- a/extension/src/popup/views/AccountHistory/styles.scss
+++ b/extension/src/popup/views/AccountHistory/styles.scss
@@ -1,17 +1,4 @@
.AccountHistory {
- &__loader {
- height: 100%;
- width: 100%;
- z-index: calc(var(--back--button-z-index) + 1);
- position: absolute;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- top: 0;
- left: 0;
- }
-
&__header {
font-size: 1.25rem;
margin-bottom: 1.5rem;