@meith/theme-clubhouse 0.28.1 → 0.29.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 +4 -4
- package/src/shared.tsx +15 -1
- package/src/slots/member-profile.tsx +17 -2
- package/src/slots/post-bit.tsx +16 -2
- package/src/theme.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meith/theme-clubhouse",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0",
|
|
4
4
|
"description": "A sports club theme for Meith — GAA, soccer, basketball — painted from the club's own two colours.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"access": "public"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@meith/theme-default": "^0.
|
|
24
|
-
"@meith/theme-kit": "^0.
|
|
25
|
-
"@meith/ui": "^0.
|
|
23
|
+
"@meith/theme-default": "^0.29.0",
|
|
24
|
+
"@meith/theme-kit": "^0.29.0",
|
|
25
|
+
"@meith/ui": "^0.29.0"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": "^19.2.0"
|
package/src/shared.tsx
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
CountModel,
|
|
3
|
+
GroupTagModel,
|
|
4
|
+
PrefixModel,
|
|
5
|
+
TimeModel,
|
|
6
|
+
UserRefModel,
|
|
7
|
+
} from '@meith/theme-kit'
|
|
2
8
|
import { Badge, cn } from '@meith/ui'
|
|
3
9
|
|
|
4
10
|
export const PAGE = 'mx-auto w-full max-w-6xl px-4 sm:px-6'
|
|
@@ -215,3 +221,11 @@ export function prefixTone(token: string | null): PrefixTone | 'neutral' {
|
|
|
215
221
|
export function Prefix({ prefix }: { prefix: PrefixModel }) {
|
|
216
222
|
return <Badge tone={prefixTone(prefix.token)}>{prefix.label}</Badge>
|
|
217
223
|
}
|
|
224
|
+
|
|
225
|
+
export function groupTags(
|
|
226
|
+
groups: readonly GroupTagModel[] | undefined,
|
|
227
|
+
title: string | null,
|
|
228
|
+
): readonly GroupTagModel[] {
|
|
229
|
+
if (groups !== undefined && groups.length > 0) return groups
|
|
230
|
+
return title === null ? [] : [{ title }]
|
|
231
|
+
}
|
|
@@ -2,12 +2,23 @@ import type { MemberProfileModel, SlotCopy } from '@meith/theme-kit'
|
|
|
2
2
|
import { fromSlotCopy } from '@meith/theme-kit'
|
|
3
3
|
import { Avatar, Card, CardContent, cn } from '@meith/ui'
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
BUTTON,
|
|
7
|
+
ClubBar,
|
|
8
|
+
groupTags,
|
|
9
|
+
HEADING,
|
|
10
|
+
MICRO,
|
|
11
|
+
NUMERIC,
|
|
12
|
+
PAGE_BODY,
|
|
13
|
+
PanelHead,
|
|
14
|
+
Stamp,
|
|
15
|
+
} from '../shared'
|
|
6
16
|
|
|
7
17
|
export function MemberProfile({
|
|
8
18
|
user,
|
|
9
19
|
avatarUrl,
|
|
10
20
|
title,
|
|
21
|
+
groups,
|
|
11
22
|
joinedAt,
|
|
12
23
|
lastVisitAt,
|
|
13
24
|
postCount,
|
|
@@ -38,7 +49,11 @@ export function MemberProfile({
|
|
|
38
49
|
<h1 className={cn(HEADING, 'text-xl break-words', user.nameClass)}>
|
|
39
50
|
{user.username}
|
|
40
51
|
</h1>
|
|
41
|
-
{title
|
|
52
|
+
{groupTags(groups, title).map((group) => (
|
|
53
|
+
<p key={group.title} className={`${MICRO} mt-0.5`}>
|
|
54
|
+
<span className={group.nameClass ?? undefined}>{group.title}</span>
|
|
55
|
+
</p>
|
|
56
|
+
))}
|
|
42
57
|
</div>
|
|
43
58
|
</div>
|
|
44
59
|
|
package/src/slots/post-bit.tsx
CHANGED
|
@@ -2,7 +2,17 @@ import type { PostBitSlotModel, SlotCopy } from '@meith/theme-kit'
|
|
|
2
2
|
import { fromSlotCopy } from '@meith/theme-kit'
|
|
3
3
|
import { Alert, AlertDescription, AlertTitle, Avatar, Card } from '@meith/ui'
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
groupTags,
|
|
7
|
+
HEADING,
|
|
8
|
+
LINK,
|
|
9
|
+
MICRO,
|
|
10
|
+
MICRO_BARE,
|
|
11
|
+
MUTED_LINK,
|
|
12
|
+
NUMERIC,
|
|
13
|
+
Stamp,
|
|
14
|
+
UserRef,
|
|
15
|
+
} from '../shared'
|
|
6
16
|
|
|
7
17
|
const VISIBILITY_TINT = {
|
|
8
18
|
visible: '',
|
|
@@ -98,7 +108,11 @@ function AuthorBlock({
|
|
|
98
108
|
<UserRef user={author} className={`${HEADING} text-sm`} />
|
|
99
109
|
</p>
|
|
100
110
|
|
|
101
|
-
{author.
|
|
111
|
+
{groupTags(author.groups, author.title).map((group) => (
|
|
112
|
+
<p key={group.title} className={`${MICRO} mt-0.5 truncate`}>
|
|
113
|
+
<span className={group.nameClass ?? undefined}>{group.title}</span>
|
|
114
|
+
</p>
|
|
115
|
+
))}
|
|
102
116
|
|
|
103
117
|
{author.isOnline && (
|
|
104
118
|
<p className="mt-1 flex items-center gap-1.5 text-xs text-moderation-approved">
|
package/src/theme.ts
CHANGED