@meith/theme-raidframe 0.32.0 → 0.33.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meith/theme-raidframe",
3
- "version": "0.32.0",
3
+ "version": "0.33.0",
4
4
  "description": "A gaming theme for Meith — guild, raid and match boards — built on the default theme's slots.",
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.32.0",
24
- "@meith/theme-kit": "^0.32.0",
25
- "@meith/ui": "^0.32.0"
23
+ "@meith/theme-default": "^0.33.0",
24
+ "@meith/theme-kit": "^0.33.0",
25
+ "@meith/ui": "^0.33.0"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "react": "^19.2.0"
package/src/shared.tsx CHANGED
@@ -138,3 +138,8 @@ export function groupTags(
138
138
  if (groups !== undefined && groups.length > 0) return groups
139
139
  return title === null ? [] : [{ title }]
140
140
  }
141
+
142
+ export function isEmptyRegion(node: React.ReactNode): boolean {
143
+ if (node === null || node === undefined || node === false || node === '') return true
144
+ return Array.isArray(node) && node.every((child) => isEmptyRegion(child))
145
+ }
@@ -26,6 +26,19 @@ export function ForumRow({ forum, copy }: ForumRowSlotModel & { copy: SlotCopy }
26
26
  <p className="mt-0.5 text-xs text-muted-foreground">{forum.description}</p>
27
27
  )}
28
28
 
29
+ {!isLink && forum.lastPost !== null && (
30
+ <p className="mt-1.5 text-xs text-muted-foreground sm:hidden">
31
+ <a href={forum.lastPost.href} className="text-foreground hover:text-primary">
32
+ {forum.lastPost.threadTitle}
33
+ </a>
34
+ <span className={`${MICRO} mt-0.5 block normal-case`}>
35
+ <UserRef user={forum.lastPost.author} className="hover:text-primary" />
36
+ {c('separator')}
37
+ <Stamp at={forum.lastPost.at} />
38
+ </span>
39
+ </p>
40
+ )}
41
+
29
42
  {forum.subforums.length > 0 && (
30
43
  <p className="mt-1.5 flex flex-wrap gap-1.5">
31
44
  {forum.subforums.map((sub) => (
@@ -1,6 +1,8 @@
1
1
  import type { PostActionsSlotModel, SlotCopy } from '@meith/theme-kit'
2
2
  import { fromSlotCopy } from '@meith/theme-kit'
3
3
 
4
+ import { isEmptyRegion } from '../shared'
5
+
4
6
  const ACTION =
5
7
  'font-mono text-[0.625rem] font-semibold uppercase tracking-[0.14em] text-muted-foreground hover:text-primary'
6
8
 
@@ -22,7 +24,9 @@ export function PostActions({
22
24
  { href: actions.moderateHref, label: c('moderate') },
23
25
  ].filter((item): item is { href: string; label: string } => item.href != null)
24
26
 
25
- if (items.length === 0 && children === undefined) return null
27
+ const extra = isEmptyRegion(children) ? null : children
28
+
29
+ if (items.length === 0 && extra === null) return null
26
30
 
27
31
  return (
28
32
  <nav aria-label={c('ariaLabel')} className="flex flex-wrap items-center gap-x-4 gap-y-1">
@@ -31,7 +35,7 @@ export function PostActions({
31
35
  {item.label}
32
36
  </a>
33
37
  ))}
34
- {children}
38
+ {extra}
35
39
  </nav>
36
40
  )
37
41
  }
@@ -77,6 +77,15 @@ export function ThreadRow({
77
77
  <span className="uppercase">{c('startedBy')}</span>{' '}
78
78
  <UserRef user={thread.author} className="hover:text-primary" />
79
79
  </p>
80
+ {thread.lastPost !== null && (
81
+ <p className={`${MICRO} mt-1 normal-case sm:hidden`}>
82
+ <a href={thread.lastPost.href} className="hover:text-primary">
83
+ <Stamp at={thread.lastPost.at} className="text-foreground" />
84
+ {c('byPrefix')}
85
+ <UserRef user={thread.lastPost.author} linked={false} />
86
+ </a>
87
+ </p>
88
+ )}
80
89
  </td>
81
90
 
82
91
  <td className={`w-16 px-2 py-2.5 text-right text-xs ${NUMERIC} text-foreground`}>
package/src/theme.ts CHANGED
@@ -73,7 +73,7 @@ import { WhoIsOnline } from './slots/who-is-online'
73
73
  export const raidframeTheme = defineTheme({
74
74
  key: 'raidframe',
75
75
  title: 'Raidframe',
76
- version: '0.32.0',
76
+ version: '0.33.0',
77
77
  extends: defaultTheme,
78
78
  slots: {
79
79
  Shell,