File tree 5 files changed +34
-12
lines changed
packages/experiments-realm
5 files changed +34
-12
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "data" : {
3
+ "type" : " card" ,
4
+ "attributes" : {
5
+ "title" : " CrmApp" ,
6
+ "description" : " Catalog entry for CRM App" ,
7
+ "isField" : false ,
8
+ "ref" : {
9
+ "module" : " ../crm-app" ,
10
+ "name" : " CrmApp"
11
+ }
12
+ },
13
+ "meta" : {
14
+ "adoptsFrom" : {
15
+ "module" : " https://cardstack.com/base/catalog-entry" ,
16
+ "name" : " CatalogEntry"
17
+ }
18
+ }
19
+ }
20
+ }
Original file line number Diff line number Diff line change 1
1
import GlimmerComponent from ' @glimmer/component' ;
2
+ import ImageIcon from ' @cardstack/boxel-icons/image' ;
2
3
3
4
interface AccountHeaderArgs {
4
5
Args: {
@@ -15,7 +16,11 @@ interface AccountHeaderArgs {
15
16
class AccountHeader extends GlimmerComponent <AccountHeaderArgs > {
16
17
<template >
17
18
<header class =' account-header' ...attributes >
18
- <img src ={{@ logoURL }} alt ={{@ name }} class =' account-header-logo' />
19
+ {{#if @ logoURL }}
20
+ <img src ={{@ logoURL }} alt ={{@ name }} class =' account-header-logo' />
21
+ {{else }}
22
+ <ImageIcon class =' account-header-logo default-icon-container' />
23
+ {{/if }}
19
24
<div class =' account-header-info' >
20
25
{{#if ( has-block ' name' ) }}
21
26
{{yield to =' name' }}
@@ -40,6 +45,10 @@ class AccountHeader extends GlimmerComponent<AccountHeaderArgs> {
40
45
object-fit : cover ;
41
46
border-radius : var (--boxel-border-radius-xl );
42
47
}
48
+ .default-icon-container {
49
+ background-color : var (--boxel-200 );
50
+ color : var (--boxel-400 );
51
+ }
43
52
.account-header-info {
44
53
min-width : 0 ;
45
54
width : 100% ;
Original file line number Diff line number Diff line change @@ -27,10 +27,6 @@ import { LooseGooseyField } from '../loosey-goosey';
27
27
import { StatusPill } from ' ../components/status-pill' ;
28
28
29
29
class IsolatedTemplate extends Component <typeof Account > {
30
- get logoURL() {
31
- return this .args .model ?.thumbnailURL ;
32
- }
33
-
34
30
get hasCompanyInfo() {
35
31
return this .args .model ?.website || this .args .model ?.headquartersAddress ;
36
32
}
@@ -45,7 +41,7 @@ class IsolatedTemplate extends Component<typeof Account> {
45
41
<template >
46
42
<AccountPageLayout >
47
43
<: header >
48
- <AccountHeader @ logoURL ={{this .logoURL }} @ name ={{@ model.name }} >
44
+ <AccountHeader @ logoURL ={{@ model.thumbnailURL }} @ name ={{@ model.name }} >
49
45
<: name >
50
46
{{#if @ model.name }}
51
47
<h1 class =' account-name' >{{@ model.name }} </h1 >
Original file line number Diff line number Diff line change @@ -634,7 +634,7 @@ class AtomTemplate extends Component<typeof Contact> {
634
634
class =' avatar'
635
635
/>
636
636
{{/if }}
637
- <span class =' name' >{{@ model.name }} </span >
637
+ <span class =' name' >{{this .label }} </span >
638
638
</div >
639
639
<style scoped >
640
640
.contact {
Original file line number Diff line number Diff line change @@ -49,14 +49,11 @@ interface DealSizeSummary {
49
49
50
50
class IsolatedTemplate extends Component <typeof Deal > {
51
51
get logoURL() {
52
+ // We default to account thumbnail
52
53
return (
53
- this .args .model .thumbnailURL ??
54
- this .args .model .account ?.thumbnailURL ??
55
- this .args .model .account ?.company ?.thumbnailURL ??
56
- ' https://picsum.photos/id/237/200/300'
54
+ this .args .model .thumbnailURL ?? this .args .model .account ?.thumbnailURL
57
55
);
58
56
}
59
-
60
57
get primaryContactName() {
61
58
console .log (this .args .fields .account ?.primaryContact );
62
59
return this .args .model .account ?.primaryContact ?.name ;
You can’t perform that action at this time.
0 commit comments