Ghost/ghost/admin/app/components/dashboard/dashboard-v5.js
James Morris f9231afa2a Further refinements to the new empty state for 0 members in new Dashboard
refs: https://github.com/TryGhost/Team/issues/1594

- this much more matches the style of the design
- it now covers the anchor and engagement charts
- has better fake data for all charts under the notice
- tweaked things for this in dark mode
2022-05-10 17:39:36 +01:00

37 lines
910 B
JavaScript

import Component from '@glimmer/component';
import {action} from '@ember/object';
import {inject as service} from '@ember/service';
export default class DashboardDashboardV5Component extends Component {
@service dashboardStats;
@action
onInsert() {
this.dashboardStats.loadSiteStatus();
}
get isLoading() {
return this.dashboardStats.siteStatus === null;
}
get totalMembers() {
return this.dashboardStats.memberCounts?.total ?? 0;
}
get isTotalMembersZero() {
return this.dashboardStats.memberCounts && this.totalMembers === 0;
}
get hasPaidTiers() {
return this.dashboardStats.siteStatus?.hasPaidTiers;
}
get areNewslettersEnabled() {
return this.dashboardStats.siteStatus?.newslettersEnabled;
}
get areMembersEnabled() {
return this.dashboardStats.siteStatus?.membersEnabled;
}
}