Add membership card component (#2507)
* Add membership card component * Update changelog --------- Co-authored-by: Thomas <4159106+dtslvr@users.noreply.github.com>pull/2514/head
parent
29028a81f5
commit
f66edf8de0
@ -1,4 +1,8 @@
|
||||
<span class="align-items-center d-flex"
|
||||
><span class="d-inline-block logo mr-1"></span>
|
||||
><span
|
||||
class="d-inline-block logo"
|
||||
[ngClass]="{ 'mr-1': showLabel }"
|
||||
[ngStyle]="{ 'background-color': color }"
|
||||
></span>
|
||||
<span *ngIf="showLabel" class="label">{{ label ?? 'Ghostfolio' }}</span></span
|
||||
>
|
||||
|
@ -0,0 +1 @@
|
||||
export * from './membership-card.module';
|
@ -0,0 +1,25 @@
|
||||
<a
|
||||
class="card-item d-flex flex-column justify-content-between p-4"
|
||||
[ngClass]="{ premium: name === 'Premium' }"
|
||||
[routerLink]="routerLinkPricing"
|
||||
>
|
||||
<div class="d-flex justify-content-end">
|
||||
<gf-logo
|
||||
color="rgba(255, 255, 255, 1)"
|
||||
size="large"
|
||||
[showLabel]="false"
|
||||
></gf-logo>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<div class="card-item-heading mb-1 text-muted" i18n>Membership</div>
|
||||
<div class="card-item-name line-height-1 text-truncate">{{ name }}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="card-item-heading mb-1 text-muted" i18n>Valid until</div>
|
||||
<div class="card-item-name line-height-1 text-truncate">
|
||||
{{ expiresAt }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
@ -0,0 +1,24 @@
|
||||
:host {
|
||||
display: block;
|
||||
max-width: 25rem;
|
||||
|
||||
.card-item {
|
||||
aspect-ratio: 1.586;
|
||||
background-color: #343a40 !important;
|
||||
border-radius: 1rem;
|
||||
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
|
||||
|
||||
&.premium {
|
||||
background-color: #1d2124 !important;
|
||||
}
|
||||
|
||||
.card-item-heading {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.card-item-name {
|
||||
color: rgba(var(--light-primary-text));
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
selector: 'gf-membership-card',
|
||||
styleUrls: ['./membership-card.component.scss'],
|
||||
templateUrl: './membership-card.component.html'
|
||||
})
|
||||
export class MembershipCardComponent {
|
||||
@Input() public expiresAt: string;
|
||||
@Input() public name: string;
|
||||
|
||||
public routerLinkPricing = ['/' + $localize`pricing`];
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { GfLogoModule } from '@ghostfolio/ui/logo';
|
||||
|
||||
import { MembershipCardComponent } from './membership-card.component';
|
||||
|
||||
@NgModule({
|
||||
declarations: [MembershipCardComponent],
|
||||
exports: [MembershipCardComponent],
|
||||
imports: [CommonModule, GfLogoModule, RouterModule],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
})
|
||||
export class GfMembershipCardModule {}
|
Loading…
Reference in new issue