mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-25 07:16:51 +00:00
style(sns): move friends count to contact header
This commit is contained in:
@@ -22,6 +22,7 @@ interface SnsFilterPanelProps {
|
|||||||
setSearchKeyword: (val: string) => void
|
setSearchKeyword: (val: string) => void
|
||||||
jumpTargetDate?: Date
|
jumpTargetDate?: Date
|
||||||
setJumpTargetDate: (date?: Date) => void
|
setJumpTargetDate: (date?: Date) => void
|
||||||
|
totalFriendsLabel?: string
|
||||||
selectedUsernames: string[]
|
selectedUsernames: string[]
|
||||||
setSelectedUsernames: (val: string[]) => void
|
setSelectedUsernames: (val: string[]) => void
|
||||||
contacts: Contact[]
|
contacts: Contact[]
|
||||||
@@ -36,6 +37,7 @@ export const SnsFilterPanel: React.FC<SnsFilterPanelProps> = ({
|
|||||||
setSearchKeyword,
|
setSearchKeyword,
|
||||||
jumpTargetDate,
|
jumpTargetDate,
|
||||||
setJumpTargetDate,
|
setJumpTargetDate,
|
||||||
|
totalFriendsLabel,
|
||||||
selectedUsernames,
|
selectedUsernames,
|
||||||
setSelectedUsernames,
|
setSelectedUsernames,
|
||||||
contacts,
|
contacts,
|
||||||
@@ -270,6 +272,9 @@ export const SnsFilterPanel: React.FC<SnsFilterPanelProps> = ({
|
|||||||
{selectedUsernames.length > 0 && (
|
{selectedUsernames.length > 0 && (
|
||||||
<span className="badge">{selectedUsernames.length}</span>
|
<span className="badge">{selectedUsernames.length}</span>
|
||||||
)}
|
)}
|
||||||
|
{totalFriendsLabel && (
|
||||||
|
<span className="widget-header-summary">{totalFriendsLabel}</span>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="contact-search-bar">
|
<div className="contact-search-bar">
|
||||||
|
|||||||
@@ -1021,9 +1021,21 @@
|
|||||||
padding: 2px 6px;
|
padding: 2px 6px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.widget-header-summary {
|
||||||
|
margin-left: auto;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: var(--text-tertiary);
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.contact-widget .widget-header .badge + .widget-header-summary {
|
||||||
|
margin-left: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
/* Search Widget */
|
/* Search Widget */
|
||||||
.input-group {
|
.input-group {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
@@ -451,7 +451,7 @@ export default function SnsPage() {
|
|||||||
if (overviewStatsStatus === 'loading') {
|
if (overviewStatsStatus === 'loading') {
|
||||||
return '统计中...'
|
return '统计中...'
|
||||||
}
|
}
|
||||||
return `共 ${overviewStats.totalPosts} 条 | ${formatDateOnly(overviewStats.earliestTime)} ~ ${formatDateOnly(overviewStats.latestTime)} | ${overviewStats.totalFriends} 位好友`
|
return `共 ${overviewStats.totalPosts} 条 | ${formatDateOnly(overviewStats.earliestTime)} ~ ${formatDateOnly(overviewStats.latestTime)}`
|
||||||
}
|
}
|
||||||
|
|
||||||
const loadPosts = useCallback(async (options: { reset?: boolean, direction?: 'older' | 'newer' } = {}) => {
|
const loadPosts = useCallback(async (options: { reset?: boolean, direction?: 'older' | 'newer' } = {}) => {
|
||||||
@@ -1112,6 +1112,13 @@ export default function SnsPage() {
|
|||||||
setSearchKeyword={setSearchKeyword}
|
setSearchKeyword={setSearchKeyword}
|
||||||
jumpTargetDate={jumpTargetDate}
|
jumpTargetDate={jumpTargetDate}
|
||||||
setJumpTargetDate={setJumpTargetDate}
|
setJumpTargetDate={setJumpTargetDate}
|
||||||
|
totalFriendsLabel={
|
||||||
|
overviewStatsStatus === 'loading'
|
||||||
|
? '统计中'
|
||||||
|
: overviewStatsStatus === 'ready'
|
||||||
|
? `${overviewStats.totalFriends} 位好友`
|
||||||
|
: undefined
|
||||||
|
}
|
||||||
selectedUsernames={selectedUsernames}
|
selectedUsernames={selectedUsernames}
|
||||||
setSelectedUsernames={setSelectedUsernames}
|
setSelectedUsernames={setSelectedUsernames}
|
||||||
contacts={contacts}
|
contacts={contacts}
|
||||||
|
|||||||
Reference in New Issue
Block a user