aboutsummaryrefslogtreecommitdiffstats
path: root/frontend/src/components/FeedList.tsx
diff options
context:
space:
mode:
authorAdam Mathes <adam@adammathes.com>2026-02-14 14:49:09 -0800
committerAdam Mathes <adam@adammathes.com>2026-02-14 14:49:09 -0800
commit490edf9e9f2911231df6c76ef4afeb3b1fb763d2 (patch)
treeab3ed784ecb79f93af52714a993096e09040a455 /frontend/src/components/FeedList.tsx
parentafa87af01c79a9baa539f2992d32154d2a4739bd (diff)
downloadneko-490edf9e9f2911231df6c76ef4afeb3b1fb763d2.tar.gz
neko-490edf9e9f2911231df6c76ef4afeb3b1fb763d2.tar.bz2
neko-490edf9e9f2911231df6c76ef4afeb3b1fb763d2.zip
task: improve mobile responsiveness of React UI\n\n- Added media queries to App.css to handle mobile sidebar layout (overlay with backdrop)\n- Implemented auto-hiding sidebar on mobile when links are clicked\n- Reduced padding and adjusted max-widths for smaller screens in App.css, FeedItem.css, and Settings.css\n- Added window resize listener to Dashboard to manage sidebar visibility based on width\n- Verified all existing tests pass\n\nFixes NK-g818qn
Diffstat (limited to 'frontend/src/components/FeedList.tsx')
-rw-r--r--frontend/src/components/FeedList.tsx18
1 files changed, 14 insertions, 4 deletions
diff --git a/frontend/src/components/FeedList.tsx b/frontend/src/components/FeedList.tsx
index 4ce2d71..250ce7d 100644
--- a/frontend/src/components/FeedList.tsx
+++ b/frontend/src/components/FeedList.tsx
@@ -8,10 +8,12 @@ export default function FeedList({
theme,
setTheme,
setSidebarVisible,
+ isMobile,
}: {
theme: string;
setTheme: (t: string) => void;
setSidebarVisible: (visible: boolean) => void;
+ isMobile: boolean;
}) {
const [feeds, setFeeds] = useState<Feed[]>([]);
const [tags, setTags] = useState<Category[]>([]);
@@ -39,6 +41,12 @@ export default function FeedList({
setFeedsExpanded(!feedsExpanded);
};
+ const handleLinkClick = () => {
+ if (isMobile) {
+ setSidebarVisible(false);
+ }
+ };
+
useEffect(() => {
Promise.all([
apiFetch('/api/feed/').then((res) => {
@@ -89,17 +97,17 @@ export default function FeedList({
<div className="filter-section">
<ul className="filter-list">
<li className="unread_filter">
- <Link to="/?filter=unread" className={currentFilter === 'unread' ? 'active' : ''}>
+ <Link to="/?filter=unread" className={currentFilter === 'unread' ? 'active' : ''} onClick={handleLinkClick}>
unread
</Link>
</li>
<li className="all_filter">
- <Link to="/?filter=all" className={currentFilter === 'all' ? 'active' : ''}>
+ <Link to="/?filter=all" className={currentFilter === 'all' ? 'active' : ''} onClick={handleLinkClick}>
all
</Link>
</li>
<li className="starred_filter">
- <Link to="/?filter=starred" className={currentFilter === 'starred' ? 'active' : ''}>
+ <Link to="/?filter=starred" className={currentFilter === 'starred' ? 'active' : ''} onClick={handleLinkClick}>
starred
</Link>
</li>
@@ -116,6 +124,7 @@ export default function FeedList({
<Link
to={`/tag/${encodeURIComponent(tag.title)}`}
className={`tag-link ${tagName === tag.title ? 'active' : ''}`}
+ onClick={handleLinkClick}
>
{tag.title}
</Link>
@@ -138,6 +147,7 @@ export default function FeedList({
<Link
to={`/feed/${feed._id}`}
className={`feed-title ${feedId === String(feed._id) ? 'active' : ''}`}
+ onClick={handleLinkClick}
>
{feed.title || feed.url}
</Link>
@@ -150,7 +160,7 @@ export default function FeedList({
<div className="nav-section">
<ul className="nav-list">
<li>
- <Link to="/settings" className="nav-link">
+ <Link to="/settings" className="nav-link" onClick={handleLinkClick}>
settings
</Link>
</li>