@meith/theme-midnight 0.7.0 → 0.9.0
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.
- package/package.json +3 -3
- package/src/copy.ts +186 -0
- package/src/index.ts +4 -4
- package/src/messages/en.json +90 -0
- package/src/messages/index.ts +5 -0
- package/src/slots/announcement.tsx +14 -4
- package/src/slots/board-index.tsx +10 -4
- package/src/slots/board-stats.tsx +16 -12
- package/src/slots/category-block.tsx +13 -6
- package/src/slots/footer.tsx +14 -3
- package/src/slots/forum-display.tsx +25 -8
- package/src/slots/forum-row.tsx +8 -6
- package/src/slots/header.tsx +43 -10
- package/src/slots/latest-posts.tsx +8 -5
- package/src/slots/latest-threads.tsx +12 -5
- package/src/slots/member-profile.tsx +13 -9
- package/src/slots/navigation.tsx +6 -3
- package/src/slots/notice.tsx +11 -5
- package/src/slots/pagination.tsx +18 -7
- package/src/slots/post-actions.tsx +17 -10
- package/src/slots/post-bit.tsx +29 -16
- package/src/slots/shell.tsx +6 -3
- package/src/slots/subforum-list.tsx +10 -4
- package/src/slots/thread-row.tsx +18 -9
- package/src/slots/thread-view.tsx +18 -5
- package/src/slots/user-panel.tsx +12 -9
- package/src/slots/who-is-online.tsx +17 -12
- package/src/theme.ts +53 -1
|
@@ -1,52 +1,57 @@
|
|
|
1
|
-
import type { WhoIsOnlineModel } from '@meith/theme-kit'
|
|
1
|
+
import type { SlotCopy, WhoIsOnlineModel } from '@meith/theme-kit'
|
|
2
|
+
import { fromSlotCopy } from '@meith/theme-kit'
|
|
2
3
|
|
|
3
4
|
import { UserRef } from '../shared'
|
|
4
5
|
|
|
5
6
|
export function WhoIsOnline({
|
|
6
7
|
guestCount,
|
|
7
8
|
members,
|
|
9
|
+
memberCount,
|
|
8
10
|
total,
|
|
9
11
|
recordCount,
|
|
10
12
|
recordAt,
|
|
11
13
|
fullListHref,
|
|
12
|
-
|
|
14
|
+
copy,
|
|
15
|
+
}: WhoIsOnlineModel & { copy: SlotCopy }) {
|
|
16
|
+
const c = (key: string) => fromSlotCopy(copy, `midnight.whoIsOnline.${key}`)
|
|
17
|
+
|
|
13
18
|
return (
|
|
14
19
|
<section aria-labelledby="who-is-online-heading" className="border border-border">
|
|
15
20
|
<h2
|
|
16
21
|
id="who-is-online-heading"
|
|
17
22
|
className="border-b border-border bg-secondary px-3 py-1 font-mono text-xs uppercase tracking-wide"
|
|
18
23
|
>
|
|
19
|
-
|
|
24
|
+
{c('onlineNow')} {total.label}
|
|
20
25
|
</h2>
|
|
21
26
|
<p className="px-3 py-2 text-xs">
|
|
22
|
-
{
|
|
23
|
-
<span className="text-muted-foreground">
|
|
27
|
+
{memberCount.value === 0 ? (
|
|
28
|
+
<span className="text-muted-foreground">{c('noMembers')}</span>
|
|
24
29
|
) : (
|
|
25
30
|
members.map((member, index) => (
|
|
26
31
|
<span key={member.username}>
|
|
27
32
|
{index > 0 && ', '}
|
|
28
33
|
<UserRef user={member} className="text-primary hover:underline" />
|
|
29
34
|
{member.isInvisible && (
|
|
30
|
-
<span className="ml-1 font-mono text-muted-foreground">(hidden)</span>
|
|
35
|
+
<span className="ml-1 font-mono text-muted-foreground">{c('hidden')}</span>
|
|
31
36
|
)}
|
|
32
37
|
</span>
|
|
33
38
|
))
|
|
34
39
|
)}
|
|
35
40
|
<span className="text-muted-foreground">
|
|
36
41
|
{' · '}
|
|
37
|
-
{guestCount} guests
|
|
42
|
+
{guestCount.label} {c('guests')}
|
|
38
43
|
</span>
|
|
39
44
|
</p>
|
|
40
45
|
<p className="border-t border-border px-3 py-1 font-mono text-xs text-muted-foreground">
|
|
41
46
|
<a href={fullListHref} className="hover:text-foreground">
|
|
42
|
-
|
|
47
|
+
{c('fullList')}
|
|
43
48
|
</a>
|
|
44
|
-
{' ·
|
|
45
|
-
{recordCount}
|
|
49
|
+
{' · '}
|
|
50
|
+
{c('record')} {recordCount.label}
|
|
46
51
|
{recordAt !== null && (
|
|
47
52
|
<>
|
|
48
|
-
{'
|
|
49
|
-
<time dateTime={recordAt.iso}>{recordAt.label}</time>
|
|
53
|
+
{' '}
|
|
54
|
+
{c('on')} <time dateTime={recordAt.iso}>{recordAt.label}</time>
|
|
50
55
|
</>
|
|
51
56
|
)}
|
|
52
57
|
</p>
|
package/src/theme.ts
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
import { defaultTheme } from '@meith/theme-default'
|
|
2
2
|
import { defineTheme } from '@meith/theme-kit'
|
|
3
3
|
|
|
4
|
+
import {
|
|
5
|
+
announcementCopy,
|
|
6
|
+
boardIndexCopy,
|
|
7
|
+
boardStatsCopy,
|
|
8
|
+
categoryBlockCopy,
|
|
9
|
+
footerCopy,
|
|
10
|
+
forumDisplayCopy,
|
|
11
|
+
forumRowCopy,
|
|
12
|
+
headerCopy,
|
|
13
|
+
latestPostsCopy,
|
|
14
|
+
latestThreadsCopy,
|
|
15
|
+
memberProfileCopy,
|
|
16
|
+
navigationCopy,
|
|
17
|
+
noticeCopy,
|
|
18
|
+
paginationCopy,
|
|
19
|
+
postActionsCopy,
|
|
20
|
+
postBitCopy,
|
|
21
|
+
shellCopy,
|
|
22
|
+
subforumListCopy,
|
|
23
|
+
threadRowCopy,
|
|
24
|
+
threadViewCopy,
|
|
25
|
+
userPanelCopy,
|
|
26
|
+
whoIsOnlineCopy,
|
|
27
|
+
} from './copy'
|
|
28
|
+
import { Announcement } from './slots/announcement'
|
|
4
29
|
import { BoardIndex } from './slots/board-index'
|
|
5
30
|
import { BoardStats } from './slots/board-stats'
|
|
6
31
|
import { CategoryBlock } from './slots/category-block'
|
|
@@ -13,7 +38,6 @@ import { LatestThreads } from './slots/latest-threads'
|
|
|
13
38
|
import { MemberProfile } from './slots/member-profile'
|
|
14
39
|
import { Navigation } from './slots/navigation'
|
|
15
40
|
import { Notice } from './slots/notice'
|
|
16
|
-
import { Announcement } from './slots/announcement'
|
|
17
41
|
import { Pagination } from './slots/pagination'
|
|
18
42
|
import { PostActions } from './slots/post-actions'
|
|
19
43
|
import { PostBit } from './slots/post-bit'
|
|
@@ -56,4 +80,32 @@ export const midnightTheme = defineTheme({
|
|
|
56
80
|
|
|
57
81
|
MemberProfile,
|
|
58
82
|
},
|
|
83
|
+
copy: {
|
|
84
|
+
Shell: shellCopy,
|
|
85
|
+
Header: headerCopy,
|
|
86
|
+
UserPanel: userPanelCopy,
|
|
87
|
+
Navigation: navigationCopy,
|
|
88
|
+
Footer: footerCopy,
|
|
89
|
+
Notice: noticeCopy,
|
|
90
|
+
Announcement: announcementCopy,
|
|
91
|
+
|
|
92
|
+
BoardIndex: boardIndexCopy,
|
|
93
|
+
CategoryBlock: categoryBlockCopy,
|
|
94
|
+
ForumRow: forumRowCopy,
|
|
95
|
+
BoardStats: boardStatsCopy,
|
|
96
|
+
WhoIsOnline: whoIsOnlineCopy,
|
|
97
|
+
LatestThreads: latestThreadsCopy,
|
|
98
|
+
LatestPosts: latestPostsCopy,
|
|
99
|
+
|
|
100
|
+
ForumDisplay: forumDisplayCopy,
|
|
101
|
+
ThreadRow: threadRowCopy,
|
|
102
|
+
SubforumList: subforumListCopy,
|
|
103
|
+
Pagination: paginationCopy,
|
|
104
|
+
|
|
105
|
+
ThreadView: threadViewCopy,
|
|
106
|
+
PostBit: postBitCopy,
|
|
107
|
+
PostActions: postActionsCopy,
|
|
108
|
+
|
|
109
|
+
MemberProfile: memberProfileCopy,
|
|
110
|
+
},
|
|
59
111
|
})
|