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
3
import { html } from '../view'
4
4
import { shell } from './shell'
5
5
6
6
+
const TODAY = new Date().toDateString()
7
7
+
6
8
const STATUS_OPTIONS = [
7
9
'👍',
8
10
'👎',
···
89
91
</div>
90
92
${statuses.map((status, i) => {
91
93
const handle = didHandleMap[status.authorDid] || status.authorDid
94
94
+
const date = ts(status)
92
95
return html`
93
96
<div class=${i === 0 ? 'status-line no-line' : 'status-line'}>
94
97
<div>
···
96
99
</div>
97
100
<div class="desc">
98
101
<a class="author" href=${toBskyLink(handle)}>@${handle}</a>
99
99
-
is feeling ${status.status} on ${ts(status)}
102
102
+
${date === TODAY
103
103
+
? `is feeling ${status.status} today`
104
104
+
: `was feeling ${status.status} on ${date}`}
100
105
</div>
101
106
</div>
102
107
`