Skip to content

Commit 4e75a90

Browse files
committed
fix: improve Ostium vault actions on mobile
1 parent 74f2ba0 commit 4e75a90

2 files changed

Lines changed: 34 additions & 2 deletions

File tree

src/routes/vaults/[vault=slug]/VaultPageHeader.svelte

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
if (hasSupportedProtocol(vault)) return getVaultProtocolDisplayName(vault);
1616
if (vault.link) return new URL(vault.link).host;
1717
});
18+
let hideCtaOnMobile = $derived(externalSiteName === 'Ostium');
1819
</script>
1920

2021
<PageHeader>
@@ -25,10 +26,10 @@
2526
{/snippet}
2627

2728
{#snippet cta()}
28-
<span class="cta-actions">
29+
<span class="cta-actions" class:mobile-hidden={hideCtaOnMobile}>
2930
{#if vault.link}
3031
<Button href={vault.link} target="_blank" rel="noreferrer">
31-
View on {externalSiteName}
32+
{externalSiteName === 'Ostium' ? 'Open vault on Ostium' : `View on ${externalSiteName}`}
3233
</Button>
3334
{/if}
3435
<UpdateInfoButton size="md" />
@@ -46,6 +47,12 @@
4647
flex-wrap: wrap;
4748
align-items: center;
4849
gap: 0.75rem;
50+
51+
&.mobile-hidden {
52+
@media (--viewport-sm-down) {
53+
display: none;
54+
}
55+
}
4956
}
5057
5158
.vault-description {

src/routes/vaults/[vault=slug]/VaultTechnicalDetailsTable.svelte

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import type { VaultInfo } from '$lib/top-vaults/schemas';
33
import type { Chain } from '$lib/helpers/chain';
44
import { getExplorerUrl } from '$lib/helpers/chain';
5+
import Button from '$lib/components/Button.svelte';
56
import MetricsBox from '$lib/components/MetricsBox.svelte';
67
import { CopyWidget, HashAddress, Timestamp, Tooltip } from '$lib/components';
78
import { formatAmount, formatDollar, notFilledMarker } from '$lib/helpers/formatters';
@@ -57,6 +58,9 @@
5758
let denominationLogoUrl = $derived(getVaultDenominationLogoUrl(vault, denominationSlug));
5859
let denominationHref = $derived(stablecoinMetadata ? getStablecoinDetailsHref(denominationSlug) : undefined);
5960
let showExchangeRateRow = $derived(vault.protocol_slug !== 'kinexys');
61+
let mobileOstiumHref = $derived(
62+
getVaultProtocolDisplayName(vault) === 'Ostium' ? (vault.link ?? undefined) : undefined
63+
);
6064
let exchangeRateFetchedAt = $derived(
6165
vault.denomination_token_rate?.usd_rate_fetched_at ??
6266
vault.denomination_token_rate?.source_currency_usd_rate_fetched_at ??
@@ -353,13 +357,34 @@
353357
</tbody>
354358
</table>
355359
</div>
360+
361+
{#if mobileOstiumHref}
362+
<div class="mobile-ostium-link">
363+
<Button class="mobile-ostium-button" href={mobileOstiumHref} target="_blank" rel="noreferrer"
364+
>Open vault on Ostium</Button
365+
>
366+
</div>
367+
{/if}
356368
</MetricsBox>
357369

358370
<style>
359371
.table-wrapper {
360372
overflow-x: auto;
361373
}
362374
375+
.mobile-ostium-link {
376+
display: none;
377+
margin-top: 1rem;
378+
379+
@media (--viewport-sm-down) {
380+
display: block;
381+
}
382+
383+
:global(.mobile-ostium-button) {
384+
--button-width: 100%;
385+
}
386+
}
387+
363388
.details-table {
364389
width: 100%;
365390
border-collapse: collapse;

0 commit comments

Comments
 (0)