File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed
src/components/in-page/Home/SectionNews Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -6,10 +6,12 @@ import useSWR from 'swr'
66import type { LinkModel } from '@mx-space/api-client'
77import { LinkState , LinkType } from '@mx-space/api-client'
88import { Avatar } from '@mx-space/kami-design/components/Avatar'
9+ import { PhUsersDuotone } from '@mx-space/kami-design/components/Icons'
910
1011import { apiClient } from '~/utils/client'
1112
1213import styles from './index.module.css'
14+ import { SectionWrap } from './section'
1315
1416export const FriendItem : FC < LinkModel > = memo ( ( props ) => {
1517 return (
@@ -46,11 +48,22 @@ export const FriendsSection: FC = memo(() => {
4648 mutate ( )
4749 } , [ ] )
4850
51+ if ( ! friends || ! friends . length ) {
52+ return null
53+ }
54+
4955 return (
50- < div className = { styles [ 'friends-wrap' ] } >
51- { friends ?. map ( ( item ) => {
52- return < FriendItem { ...item } key = { item . id } />
53- } ) }
54- </ div >
56+ < SectionWrap
57+ title = "朋友们"
58+ moreUrl = "friends"
59+ icon = { < PhUsersDuotone /> }
60+ className = { 'w-full' }
61+ >
62+ < div className = { styles [ 'friends-wrap' ] } >
63+ { friends ?. map ( ( item ) => {
64+ return < FriendItem { ...item } key = { item . id } />
65+ } ) }
66+ </ div >
67+ </ SectionWrap >
5568 )
5669} )
You can’t perform that action at this time.
0 commit comments