@social-mail/social-mail-client 1.2.43 → 1.2.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,6 +11,56 @@ import InfiniteRepeater from "../../common/controls/repeater/InfiniteRepeater";
11
11
  import BlogService from "./BlogService";
12
12
  import Pack from "@web-atoms/core/dist/Pack";
13
13
  import { renderMail } from "../../web/page/mails/service/ConversationService";
14
+ import { DateFormats } from "../../common/date/DateFormats";
15
+ import styled from "@web-atoms/core/dist/style/styled";
16
+ import LimitedText from "@web-atoms/web-controls/dist/basic/LimitedText";
17
+
18
+ styled.css `
19
+
20
+ box-sizing: border-box;
21
+
22
+ & > header {
23
+
24
+ }
25
+
26
+ & > section {
27
+ & [data-element=blog-item] {
28
+ margin: 10px;
29
+ border: solid 1px lightgray;
30
+ border-radius: 10px;
31
+ display: grid;
32
+ grid-template-columns: 1fr auto;
33
+ grid-template-rows: auto 1fr;
34
+
35
+ background-color: gray;
36
+
37
+ & > h4 {
38
+ grid-row: 1;
39
+ grid-column: 1;
40
+ margin-block-start: 0;
41
+ margin-block-end: 0;
42
+ padding: 10px;
43
+ }
44
+
45
+ & > h6 {
46
+ grid-row: 1;
47
+ grid-column: 2;
48
+ margin-block-start: 0;
49
+ margin-block-end: 0;
50
+ padding: 10px;
51
+ }
52
+ & > section {
53
+ padding: 10px;
54
+ border-bottom-left-radius: 10px;
55
+ border-bottom-right-radius: 10px;
56
+ grid-row: 2;
57
+ grid-column: 1 / span 2;
58
+ background-color: canvas;
59
+ }
60
+ }
61
+ }
62
+
63
+ `.installGlobal("[data-blog-list=blog-list]");
14
64
 
15
65
  @Pack
16
66
  export default class ChannelView extends AtomControl {
@@ -33,6 +83,8 @@ export default class ChannelView extends AtomControl {
33
83
 
34
84
  const { channelID, emailAddress } = (window as any).socialMail ?? {};
35
85
 
86
+ this.element.setAttribute("data-blog-list", "blog-list");
87
+
36
88
  this.channelID = channelID || (await this.blogService.getChannelID(emailAddress));
37
89
 
38
90
  this.renderer = <div data-layout="flex-center">
@@ -59,9 +111,17 @@ export default class ChannelView extends AtomControl {
59
111
  })
60
112
  )}
61
113
  itemRenderer={(email: IEmail) => {
62
- return <div>
63
- <div { ... renderMail({ email })}></div>
64
- </div>;
114
+ return <section data-element="blog-item">
115
+ <h4 data-element="title" text={email.subject}/>
116
+ <h6 data-element="date" text={DateFormats.relative.short(email.dateSent)}/>
117
+ <h6 text={email.senderName}/>
118
+ <section
119
+ data-element="content">
120
+ <LimitedText height={200}>
121
+ <section { ... renderMail({ email })}/>
122
+ </LimitedText>
123
+ </section>
124
+ </section>;
65
125
  }}
66
126
  />
67
127
  </section>