File tree 3 files changed +23
-7
lines changed
3 files changed +23
-7
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ const ActivityIcon = memo(() => {
109
109
}
110
110
setActivityProcessInfo ( {
111
111
name : data . processInfo ?. name || data . processName ,
112
+ iconUrl : data . processInfo ?. iconUrl ,
112
113
iconBase64 : data . processInfo ?. iconBase64 ,
113
114
description : data . processInfo ?. description ,
114
115
} )
@@ -203,7 +204,11 @@ const TriggerComponent = memo<{
203
204
const isBuiltIn = ! ! appIcon [ processName ]
204
205
205
206
const src =
206
- ! isBuiltIn && icon ? icon : `${ CND_DOMAIN } /apps/${ appIcon [ processName ] } .png`
207
+ ! isBuiltIn && icon
208
+ ? icon
209
+ : isBuiltIn
210
+ ? `${ CND_DOMAIN } /apps/${ appIcon [ processName ] } .png`
211
+ : ''
207
212
208
213
const className = clsx ( 'pointer-events-none select-none' , {
209
214
'rounded-md' : ! isBuiltIn ,
@@ -214,7 +219,7 @@ const TriggerComponent = memo<{
214
219
< Image
215
220
width = { 32 }
216
221
height = { 32 }
217
- src = { error ? ErrorFallback : src }
222
+ src = { error ? ErrorFallback : src || ErrorFallback }
218
223
alt = { processName }
219
224
priority
220
225
fetchPriority = "low"
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export const ShiJu = () => {
21
21
if ( ! origin ) return null
22
22
return (
23
23
< FloatPopover triggerElement = { < span > { data ?. shiju } </ span > } >
24
- < div className = "text-center" >
24
+ < div className = "max-w-[800px] text-center" >
25
25
< h3 className = "sticky top-0 py-2 text-2xl font-medium" >
26
26
{ origin . title }
27
27
</ h3 >
Original file line number Diff line number Diff line change 1
1
import { useQuery } from '@tanstack/react-query'
2
- import { useEffect , useRef } from 'react'
2
+ import { useEffect , useMemo , useRef } from 'react'
3
+ import type { CategoryModel } from '@mx-space/api-client'
3
4
4
5
import { adminQueries } from '~/queries/definition'
5
6
@@ -22,14 +23,24 @@ export const SlugInput = () => {
22
23
setCategoryId ( category . id )
23
24
}
24
25
} , [ category , categoryId , setCategoryId ] )
26
+ const categoryIdMap : Record < string , CategoryModel > = useMemo ( ( ) => {
27
+ if ( ! categories ) return { }
28
+ return categories . data . reduce (
29
+ ( acc , category ) => ( {
30
+ ...acc ,
31
+ [ category . id ] : category ,
32
+ } ) ,
33
+ { } ,
34
+ )
35
+ } , [ categories ] )
25
36
26
37
const isLoading = ! category
27
38
return (
28
39
< >
29
- { isLoading ? (
30
- < div className = "h-2 w-[120px] animate-pulse bg-white " />
40
+ { isLoading || ! categoryId ? (
41
+ < div className = "h-2 w-[120px] animate-pulse bg-white" />
31
42
) : (
32
- < label className = "text-base-content" > { `${ webUrl } /posts/${ category ?. slug } /` } </ label >
43
+ < label className = "text-base-content" > { `${ webUrl } /posts/${ categoryIdMap ?. [ categoryId ] ?. slug } /` } </ label >
33
44
) }
34
45
35
46
< div className = "relative ml-1 inline-flex min-w-[2rem] items-center overflow-hidden rounded-md bg-white py-1 dark:bg-zinc-900 [&_*]:leading-4" >
You can’t perform that action at this time.
0 commit comments