Skip to content

Commit 309eb5a

Browse files
authored
Remove generic 'handle' prefix from Social Web UI function names (#2485)
1 parent 2ab66fc commit 309eb5a

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/social-web/components/layout/index.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,39 +74,39 @@ export function Layout() {
7474
setSelectedItemId( itemId );
7575
}, [] );
7676

77-
// Listen for hash changes (back/forward navigation)
77+
// Listen for hash changes (back/forward navigation).
7878
useEffect( () => {
79-
const handleHashChange = () => {
79+
const syncUrlToState = () => {
8080
const { section, itemId } = parseHash();
8181
setActiveSection( section );
8282
setSelectedItemId( itemId );
8383
};
8484

85-
window.addEventListener( 'hashchange', handleHashChange );
85+
window.addEventListener( 'hashchange', syncUrlToState );
8686
return () => {
87-
window.removeEventListener( 'hashchange', handleHashChange );
87+
window.removeEventListener( 'hashchange', syncUrlToState );
8888
};
8989
}, [] );
9090

91-
const handleSelectItem = ( id: string | number ) => {
91+
const selectItem = ( id: string | number ) => {
9292
setSelectedItemId( id );
9393
updateHash( activeSection, id );
9494
};
9595

96-
const handleCloseInspector = () => {
96+
const closeInspector = () => {
9797
setSelectedItemId( null );
9898
updateHash( activeSection );
9999
};
100100

101-
const handleNavigate = ( section: string ) => {
101+
const navigate = ( section: string ) => {
102102
setActiveSection( section );
103103
setSelectedItemId( null );
104104
updateHash( section );
105105
};
106106

107107
// Render main content (stage) with Suspense for lazy loading
108108
const renderStage = () => {
109-
const props = { onSelectItem: handleSelectItem };
109+
const props = { onSelectItem: selectItem };
110110

111111
let StageComponent;
112112
switch ( activeSection ) {
@@ -145,7 +145,7 @@ export function Layout() {
145145
return null;
146146
}
147147
InspectorComponent = FeedInspector;
148-
props = { id: selectedItemId, onClose: handleCloseInspector };
148+
props = { id: selectedItemId, onClose: closeInspector };
149149
}
150150

151151
return (
@@ -169,7 +169,7 @@ export function Layout() {
169169
<div className="app-content">
170170
{ /* Sidebar - 240px fixed width (no Panel wrapper, stays dark) */ }
171171
<div className="sidebar-region">
172-
<Sidebar activeSection={ activeSection } onNavigate={ handleNavigate } />
172+
<Sidebar activeSection={ activeSection } onNavigate={ navigate } />
173173
</div>
174174

175175
{ /* Stage - main content area */ }

src/social-web/routes/feed/stage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export default function FeedStage( { onSelectItem }: FeedStageProps ) {
151151
}
152152
}, [ feed, selection ] );
153153

154-
const handleChangeSelection = useCallback(
154+
const changeSelection = useCallback(
155155
( nextSelection: string[] ) => {
156156
setSelection( nextSelection );
157157

@@ -185,7 +185,7 @@ export default function FeedStage( { onSelectItem }: FeedStageProps ) {
185185
isItemClickable={ () => true }
186186
getItemId={ ( item ) => item.id.toString() }
187187
selection={ selection }
188-
onChangeSelection={ handleChangeSelection }
188+
onChangeSelection={ changeSelection }
189189
empty={
190190
<p>
191191
{ normalizedView.search

0 commit comments

Comments
 (0)