tangled
alpha
login
or
join now
graham.systems
/
statusphere-react
forked from
samuel.fm/statusphere-react
0
fork
atom
the statusphere demo reworked into a vite/react app in a monorepo
0
fork
atom
overview
issues
pulls
pipelines
Smarter timestamps
Paul Frazee
2 years ago
1fc19212
c42160c6
+6
-1
1 changed file
expand all
collapse all
unified
split
src
pages
home.ts
+6
-1
src/pages/home.ts
···
3
import { html } from '../view'
4
import { shell } from './shell'
5
0
0
6
const STATUS_OPTIONS = [
7
'๐',
8
'๐',
···
89
</div>
90
${statuses.map((status, i) => {
91
const handle = didHandleMap[status.authorDid] || status.authorDid
0
92
return html`
93
<div class=${i === 0 ? 'status-line no-line' : 'status-line'}>
94
<div>
···
96
</div>
97
<div class="desc">
98
<a class="author" href=${toBskyLink(handle)}>@${handle}</a>
99
-
is feeling ${status.status} on ${ts(status)}
0
0
100
</div>
101
</div>
102
`
···
3
import { html } from '../view'
4
import { shell } from './shell'
5
6
+
const TODAY = new Date().toDateString()
7
+
8
const STATUS_OPTIONS = [
9
'๐',
10
'๐',
···
91
</div>
92
${statuses.map((status, i) => {
93
const handle = didHandleMap[status.authorDid] || status.authorDid
94
+
const date = ts(status)
95
return html`
96
<div class=${i === 0 ? 'status-line no-line' : 'status-line'}>
97
<div>
···
99
</div>
100
<div class="desc">
101
<a class="author" href=${toBskyLink(handle)}>@${handle}</a>
102
+
${date === TODAY
103
+
? `is feeling ${status.status} today`
104
+
: `was feeling ${status.status} on ${date}`}
105
</div>
106
</div>
107
`