blob: b235652cbfc8d08f0695920c1251a76a3b95bd4a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
<script lang="ts">
import type { Lockup } from '@jet-app/app-store/api/models';
import LineClamp from '@amp/web-app-components/src/components/LineClamp/LineClamp.svelte';
import AppIcon, { type AppIconProfile } from '~/components/AppIcon.svelte';
import LinkWrapper from '~/components/LinkWrapper.svelte';
import { getI18n } from '~/stores/i18n';
export let item: Lockup;
/**
* Controls the `get-button` variant class that is applied to the "View" button
*
* @default "gray"
*/
export let buttonVariant: 'gray' | 'blue' | 'transparent' = 'gray';
export let shouldShowLaunchNativeButton: boolean = false;
export let titleLineCount: number = 2;
export let appIconProfile: AppIconProfile = 'app-icon-small';
const i18n = getI18n();
</script>
<div class="small-lockup-item">
<LinkWrapper
action={item.clickAction}
label={`${$i18n.t('ASE.Web.AppStore.View')} ${
item.title ? item.title : null
}`}
>
{#if item.icon}
<div class="app-icon-container">
<AppIcon icon={item.icon} profile={appIconProfile} />
</div>
{/if}
<div class="metadata-container">
{#if item.heading}
<LineClamp clamp={1}>
<h4 dir="auto">{item.heading}</h4>
</LineClamp>
{/if}
{#if item.title}
<LineClamp clamp={titleLineCount}>
<h3 dir="auto">{item.title}</h3>
</LineClamp>
{/if}
{#if item.subtitle}
<LineClamp clamp={1}>
<p dir="auto">{item.subtitle}</p>
</LineClamp>
{/if}
</div>
<div class="button-container" aria-hidden="true">
{#if shouldShowLaunchNativeButton && $$slots['launch-native-button']}
<slot name="launch-native-button" />
{:else}
<span class="get-button {buttonVariant}">
{$i18n.t('ASE.Web.AppStore.View')}
</span>
{/if}
</div>
</LinkWrapper>
</div>
<style>
.small-lockup-item,
.small-lockup-item :global(a) {
display: flex;
align-items: center;
width: 100%;
}
.app-icon-container {
flex-shrink: 0;
margin-inline-end: 16px;
}
.metadata-container {
margin-inline-end: 16px;
}
h3 {
color: var(--title-color);
font: var(--title-3-emphasized);
}
h4 {
color: var(--eyebrow-color, var(--systemSecondary));
font: var(--subhead-emphasized);
text-transform: uppercase;
mix-blend-mode: var(--eyebrow-blend-mode);
}
p {
font: var(--callout);
color: var(--subtitle-color, var(--systemSecondary));
mix-blend-mode: var(--subtitle-blend-mode);
}
.button-container {
margin-inline-start: auto;
margin-inline-end: var(--margin-inline-end, 0);
mix-blend-mode: var(--button-blend-mode);
flex-shrink: 0;
}
</style>
|