forked from cardstack/boxel
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathauthor.gts
31 lines (29 loc) · 950 Bytes
/
author.gts
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
import StringCard from 'https://cardstack.com/base/string';
import TextAreaCard from 'https://cardstack.com/base/text-area';
import {
Component,
CardDef,
field,
contains,
} from 'https://cardstack.com/base/card-api';
import { GridContainer } from '@cardstack/boxel-ui/components';
export class Author extends CardDef {
static displayName = 'Author Bio';
@field firstName = contains(StringCard);
@field lastName = contains(StringCard);
@field title = contains(StringCard, {
computeVia: function (this: Author) {
return [this.firstName, this.lastName].filter(Boolean).join(' ');
},
});
@field photo = contains(StringCard); // TODO: image card
@field body = contains(TextAreaCard); // TODO: markdown card
static embedded = class Embedded extends Component<typeof this> {
<template>
<GridContainer>
<@fields.firstName />
<@fields.lastName />
</GridContainer>
</template>
};
}