Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style(frontend): activity incomplete transaction list #3700

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
<script lang="ts">
import { notEmptyString, type Token } from '@dfinity/utils';
import { icTransactionsStore } from '$icp/stores/ic-transactions.store';
import NetworksSwitcher from '$lib/components/networks/NetworksSwitcher.svelte';
import AllTransactionsList from '$lib/components/transactions/AllTransactionsList.svelte';
import MessageBox from '$lib/components/ui/MessageBox.svelte';
import PageTitle from '$lib/components/ui/PageTitle.svelte';
import { enabledNetworkTokens } from '$lib/derived/network-tokens.derived';
import { testnetsEnabled } from '$lib/derived/settings.derived';
import { i18n } from '$lib/stores/i18n.store';
import type { TokenUi } from '$lib/types/token';
import { replacePlaceholders } from '$lib/utils/i18n.utils.js';

let enabledTokensWithoutCanister: Token[];
$: enabledTokensWithoutCanister = $enabledNetworkTokens.filter(
(token: TokenUi) => $icTransactionsStore?.[token.id] === null
);

let tokenList: string;
$: tokenList = enabledTokensWithoutCanister.map((token) => `$${token.symbol}`).join(', ');
peterpeterparker marked this conversation as resolved.
Show resolved Hide resolved
</script>

<div class="flex flex-col gap-5">
Expand All @@ -16,6 +29,14 @@
</div>
{/if}

{#if notEmptyString(tokenList)}
<MessageBox level="light-warning" closableKey="oisy_ic_hide_incomplete_transaction_list">
{replacePlaceholders($i18n.activity.warning.incomplete_transaction_list, {
$token_list: tokenList
})}
</MessageBox>
{/if}

<MessageBox level="plain" closableKey="oisy_ic_hide_bitcoin_activity">
{$i18n.activity.info.btc_transactions}
</MessageBox>
Expand Down
3 changes: 3 additions & 0 deletions src/frontend/src/lib/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,9 @@
},
"info": {
"btc_transactions": "BTC transaction information is obtained from central third parties and should be independently verified."
},
"warning": {
"incomplete_transaction_list": "Transaction list is incomplete because $token_list don't have an Index canister to provide transaction information."
}
}
}
1 change: 1 addition & 0 deletions src/frontend/src/lib/types/i18n.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,7 @@ interface I18nLicense_agreement {
interface I18nActivity {
text: { title: string };
info: { btc_transactions: string };
warning: { incomplete_transaction_list: string };
}

interface I18n {
Expand Down
3 changes: 2 additions & 1 deletion src/frontend/src/lib/utils/info.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ export type HideInfoKey =
| 'oisy_ic_hide_bitcoin_info'
| 'oisy_ic_hide_ethereum_info'
| 'oisy_ic_hide_erc20_info'
| 'oisy_ic_hide_bitcoin_activity';
| 'oisy_ic_hide_bitcoin_activity'
| 'oisy_ic_hide_incomplete_transaction_list';

export const saveHideInfo = (key: HideInfoKey) => {
try {
Expand Down