feat: hide close/collapse sidebar buttons on mobile

This commit is contained in:
Gigi
2025-10-22 11:45:51 +02:00
parent a501fa816f
commit f6a325f7e9
4 changed files with 19 additions and 20 deletions

View File

@@ -37,6 +37,7 @@ interface HighlightsPanelProps {
relayPool?: RelayPool | null relayPool?: RelayPool | null
eventStore?: IEventStore | null eventStore?: IEventStore | null
settings?: UserSettings settings?: UserSettings
isMobile?: boolean
} }
export const HighlightsPanel: React.FC<HighlightsPanelProps> = ({ export const HighlightsPanel: React.FC<HighlightsPanelProps> = ({
@@ -56,7 +57,8 @@ export const HighlightsPanel: React.FC<HighlightsPanelProps> = ({
followedPubkeys = new Set(), followedPubkeys = new Set(),
relayPool, relayPool,
eventStore, eventStore,
settings settings,
isMobile = false
}) => { }) => {
const [showHighlights, setShowHighlights] = useState(true) const [showHighlights, setShowHighlights] = useState(true)
const [localHighlights, setLocalHighlights] = useState(highlights) const [localHighlights, setLocalHighlights] = useState(highlights)
@@ -125,6 +127,7 @@ export const HighlightsPanel: React.FC<HighlightsPanelProps> = ({
onRefresh={onRefresh} onRefresh={onRefresh}
onToggleCollapse={onToggleCollapse} onToggleCollapse={onToggleCollapse}
onHighlightVisibilityChange={onHighlightVisibilityChange} onHighlightVisibilityChange={onHighlightVisibilityChange}
isMobile={isMobile}
/> />
{loading && filteredHighlights.length === 0 ? ( {loading && filteredHighlights.length === 0 ? (

View File

@@ -13,6 +13,7 @@ interface HighlightsPanelHeaderProps {
onRefresh?: () => void onRefresh?: () => void
onToggleCollapse: () => void onToggleCollapse: () => void
onHighlightVisibilityChange?: (visibility: HighlightVisibility) => void onHighlightVisibilityChange?: (visibility: HighlightVisibility) => void
isMobile?: boolean
} }
const HighlightsPanelHeader: React.FC<HighlightsPanelHeaderProps> = ({ const HighlightsPanelHeader: React.FC<HighlightsPanelHeaderProps> = ({
@@ -24,7 +25,8 @@ const HighlightsPanelHeader: React.FC<HighlightsPanelHeaderProps> = ({
onToggleHighlights, onToggleHighlights,
onRefresh, onRefresh,
onToggleCollapse, onToggleCollapse,
onHighlightVisibilityChange onHighlightVisibilityChange,
isMobile = false
}) => { }) => {
return ( return (
<div className="highlights-header"> <div className="highlights-header">
@@ -101,14 +103,16 @@ const HighlightsPanelHeader: React.FC<HighlightsPanelHeaderProps> = ({
/> />
)} )}
</div> </div>
<IconButton {!isMobile && (
icon={faChevronRight} <IconButton
onClick={onToggleCollapse} icon={faChevronRight}
title="Collapse highlights panel" onClick={onToggleCollapse}
ariaLabel="Collapse highlights panel" title="Collapse highlights panel"
variant="ghost" ariaLabel="Collapse highlights panel"
style={{ transform: 'rotate(180deg)' }} variant="ghost"
/> style={{ transform: 'rotate(180deg)' }}
/>
)}
</div> </div>
</div> </div>
) )

View File

@@ -36,16 +36,7 @@ const SidebarHeader: React.FC<SidebarHeaderProps> = ({ onToggleCollapse, onLogou
return ( return (
<> <>
<div className="sidebar-header-bar"> <div className="sidebar-header-bar">
{isMobile ? ( {!isMobile && (
<IconButton
icon={faTimes}
onClick={onToggleCollapse}
title="Close sidebar"
ariaLabel="Close sidebar"
variant="ghost"
className="mobile-close-btn"
/>
) : (
<button <button
onClick={onToggleCollapse} onClick={onToggleCollapse}
className="toggle-sidebar-btn" className="toggle-sidebar-btn"

View File

@@ -413,6 +413,7 @@ const ThreePaneLayout: React.FC<ThreePaneLayoutProps> = (props) => {
relayPool={props.relayPool} relayPool={props.relayPool}
eventStore={props.eventStore} eventStore={props.eventStore}
settings={props.settings} settings={props.settings}
isMobile={isMobile}
/> />
</div> </div>
</div> </div>