diff options
| author | Adam Mathes <adam@adammathes.com> | 2026-02-14 14:49:09 -0800 |
|---|---|---|
| committer | Adam Mathes <adam@adammathes.com> | 2026-02-14 14:49:09 -0800 |
| commit | 490edf9e9f2911231df6c76ef4afeb3b1fb763d2 (patch) | |
| tree | ab3ed784ecb79f93af52714a993096e09040a455 /frontend/src/components | |
| parent | afa87af01c79a9baa539f2992d32154d2a4739bd (diff) | |
| download | neko-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')
| -rw-r--r-- | frontend/src/components/FeedItem.css | 22 | ||||
| -rw-r--r-- | frontend/src/components/FeedList.tsx | 18 | ||||
| -rw-r--r-- | frontend/src/components/Settings.css | 15 |
3 files changed, 51 insertions, 4 deletions
diff --git a/frontend/src/components/FeedItem.css b/frontend/src/components/FeedItem.css index 4eca2b1..944b66a 100644 --- a/frontend/src/components/FeedItem.css +++ b/frontend/src/components/FeedItem.css @@ -123,4 +123,26 @@ .scrape-btn:hover { background: var(--sidebar-bg); +} + +@media (max-width: 768px) { + .feed-item { + margin-top: 2rem; + padding: 0.5rem; + } + + .item-title { + font-size: 1.4rem; + word-break: break-word; + } + + .item-header { + flex-direction: column; + gap: 0.5rem; + } + + .item-actions { + margin-left: 0; + margin-bottom: 0.5rem; + } }
\ No newline at end of file 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> diff --git a/frontend/src/components/Settings.css b/frontend/src/components/Settings.css index c8784a0..3738e61 100644 --- a/frontend/src/components/Settings.css +++ b/frontend/src/components/Settings.css @@ -110,8 +110,23 @@ } @media (max-width: 600px) { + .settings-page { + padding: 1rem; + } + + .add-feed-form { + flex-direction: column; + } + .import-export-section { flex-direction: column; + gap: 1rem; + } + + .settings-feed-item { + flex-direction: column; + align-items: flex-start; + gap: 1rem; } } |
