Skip to content

Commit

Permalink
refactor: hide dex filter on AE asset page
Browse files Browse the repository at this point in the history
  • Loading branch information
CedrikNikita committed May 13, 2024
1 parent bd88b60 commit a0405e2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 3 additions & 1 deletion src/popup/components/AccountDetailsBase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@

<TransactionAndTokenFilter
:key="routeName!"
:show-all-filter-options="activeAccount.protocol === PROTOCOLS.aeternity"
:show-filters="isScrollEnabled"
/>
</div>
Expand Down Expand Up @@ -81,7 +82,7 @@ import {
ref,
} from 'vue';
import { useRoute } from 'vue-router';
import { IS_MOBILE_APP, IS_FIREFOX } from '@/constants';
import { IS_MOBILE_APP, IS_FIREFOX, PROTOCOLS } from '@/constants';
import {
useAccounts,
Expand Down Expand Up @@ -185,6 +186,7 @@ export default defineComponent({
fadeAnimation,
IS_FIREFOX,
INITIAL_TABS_HEIGHT,
PROTOCOLS,
};
},
});
Expand Down
3 changes: 2 additions & 1 deletion src/popup/components/TransactionAndTokenFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
v-if="!hideFilterButton"
v-model="displayMode"
class="filters"
:filters="isActiveAccountAe ? filtersConfigAe : filtersConfig"
:filters="showAllFilterOptions ? filtersConfigAe : filtersConfig"
:scroll-top-threshold="scrollTopThreshold"
/>
</div>
Expand Down Expand Up @@ -60,6 +60,7 @@ export default defineComponent({
},
props: {
showFilters: Boolean,
showAllFilterOptions: Boolean,
},
setup(props) {
const route = useRoute();
Expand Down
15 changes: 8 additions & 7 deletions src/popup/pages/Assets/AssetDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
:token-contract-id="fungibleToken?.contractId"
/>
<BtnBox
v-if="isAe && isNodeMainnet && UNFINISHED_FEATURES"
v-if="isAeCoin && isNodeMainnet && UNFINISHED_FEATURES"
:text="$t('common.buy')"
:icon="BuyIcon"
:href="activeAccountSimplexLink"
/>
<BtnBox
v-else-if="isAe && isNodeTestnet"
v-else-if="isAeCoin && isNodeTestnet"
:text="$t('common.faucet')"
:icon="FaucetIcon"
:href="activeAccountFaucetUrl"
Expand Down Expand Up @@ -73,6 +73,7 @@
<TransactionAndTokenFilter
:key="routeName?.toString()"
:show-filters="showFilterBar"
:show-all-filter-options="!isAeCoin && currentActiveProtocol === PROTOCOLS.aeternity"
/>
</div>
</div>
Expand Down Expand Up @@ -218,7 +219,7 @@ export default defineComponent({
].includes(name.toString()),
);
const contractId = route.params.id as AssetContractId;
const isAe = contractId === AE_CONTRACT_ID;
const isAeCoin = contractId === AE_CONTRACT_ID;
const detailsRouteName = isCoin ? ROUTE_COIN_DETAILS : ROUTE_TOKEN_DETAILS;
const transactionRouteName = isCoin ? ROUTE_COIN : ROUTE_TOKEN;
Expand Down Expand Up @@ -253,10 +254,10 @@ export default defineComponent({
const routeName = computed(() => route.name);
const showFilterBar = computed(() => !!route?.meta?.showFilterBar);
const activeAccountFaucetUrl = computed(
() => (isAe) ? buildAeFaucetUrl(currentActiveAddress.value) : null,
() => (isAeCoin) ? buildAeFaucetUrl(currentActiveAddress.value) : null,
);
const activeAccountSimplexLink = computed(
() => (isAe) ? buildSimplexLink(currentActiveAddress.value) : null,
() => (isAeCoin) ? buildSimplexLink(currentActiveAddress.value) : null,
);
const assetData = computed((): IToken | undefined => {
Expand Down Expand Up @@ -356,7 +357,7 @@ export default defineComponent({
}
onMounted(async () => {
if (isContract(contractId) && !isAe) {
if (isContract(contractId) && !isAeCoin) {
setLoaderVisible(true);
await getAeSdk();
tokenPairs.value = await getContractTokenPairs(contractId as Encoded.ContractAddress);
Expand Down Expand Up @@ -401,7 +402,7 @@ export default defineComponent({
currentActiveProtocol,
stickyTabsWrapperEl,
fungibleToken,
isAe,
isAeCoin,
isCoin,
isNodeMainnet,
isNodeTestnet,
Expand Down

0 comments on commit a0405e2

Please sign in to comment.