Repository navigation
feat: add feed location directory #259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Alessandro100
wants to merge
16
commits into
main
Choose a base branch
from
feat/location-directory
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
1a961a3
feat: add feed location directory
Alessandro100 0d9253a
fix: do not cache missing locations in the directory
Alessandro100 d90beff
feat: align location pages with the feed detail page style
Alessandro100 4374d1d
feat: use country names in location URLs and refine directory cards
Alessandro100 aa7ef32
feat: add loading states and bold counts to location directory cards
Alessandro100 194f056
feat: list location directory feeds through the search endpoint
Alessandro100 d707a35
feat: browse locations from the geopolygon hierarchy
Alessandro100 fe94bc2
chore: regenerate API types for realtime feed locations
Alessandro100 c52c870
ci: bump cypress-io/github-action to v7
Alessandro100 5e00f83
chore: regenerate API types for the locations path description
Alessandro100 d5cc048
feat: build directory pages from the location lookup endpoint
Alessandro100 096a436
fix: redirect mixed-case location URLs to their lowercase path
Alessandro100 9ad8e0a
fix: localize directory links and canonical URLs, refresh empty feed …
Alessandro100 54255f9
fix: never cache out-of-range feed pages of locations without feeds
Alessandro100 4daa4ed
fix: name the location search box after the level it filters
Alessandro100 d04d0ce
fix: polish the location directory copy
Alessandro100 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| import { type ReactElement } from 'react'; | ||
| import { Box, Container, Skeleton } from '@mui/material'; | ||
| import SectionContainer from '../../../components/SectionContainer'; | ||
|
|
||
| const CARD_COUNT = 8; | ||
| const ROW_COUNT = 8; | ||
|
|
||
| /** | ||
| * Shown while a location page streams in, e.g. after clicking a child | ||
| * location; same layout as page.tsx so nothing jumps when it resolves. | ||
| * ref: https://nextjs.org/docs/app/api-reference/file-conventions/loading | ||
| */ | ||
| export default function Loading(): ReactElement { | ||
| return ( | ||
| <Container | ||
| component='main' | ||
| maxWidth='xl' | ||
| aria-busy='true' | ||
| sx={{ width: '100%', m: 'auto', px: 0 }} | ||
| > | ||
| <SectionContainer maxWidth='xl'> | ||
| {/* Back button and breadcrumb */} | ||
| <Skeleton | ||
| animation='wave' | ||
| variant='text' | ||
| sx={{ fontSize: '1rem', width: 240 }} | ||
| /> | ||
| {/* Title and intro */} | ||
| <Skeleton | ||
| animation='wave' | ||
| variant='text' | ||
| sx={{ fontSize: '3rem', width: { xs: '80%', sm: 360 }, mt: 1 }} | ||
| /> | ||
| <Skeleton | ||
| animation='wave' | ||
| variant='text' | ||
| sx={{ fontSize: '1.2rem', width: { xs: '100%', sm: 560 }, mb: 3 }} | ||
| /> | ||
| {/* Feed count chips */} | ||
| <Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 1 }}> | ||
| {[150, 140, 100].map((width) => ( | ||
| <Skeleton | ||
| key={width} | ||
| animation='wave' | ||
| variant='rounded' | ||
| width={width} | ||
| height={32} | ||
| sx={{ borderRadius: 4 }} | ||
| /> | ||
| ))} | ||
| </Box> | ||
|
|
||
| {/* Child locations */} | ||
| <Skeleton | ||
| animation='wave' | ||
| variant='text' | ||
| sx={{ fontSize: '1.5rem', width: 200, mt: { xs: 4, md: 5 }, mb: 2 }} | ||
| /> | ||
| <Box | ||
| sx={{ | ||
| display: 'grid', | ||
| gridTemplateColumns: { | ||
| xs: 'minmax(0, 1fr)', | ||
| sm: 'repeat(2, minmax(0, 1fr))', | ||
| md: 'repeat(3, minmax(0, 1fr))', | ||
| lg: 'repeat(4, minmax(0, 1fr))', | ||
| }, | ||
| gap: 2, | ||
| }} | ||
| > | ||
| {Array.from({ length: CARD_COUNT }, (_, index) => ( | ||
| <Skeleton | ||
| key={index} | ||
| animation='wave' | ||
| variant='rounded' | ||
| height={84} | ||
| /> | ||
| ))} | ||
| </Box> | ||
|
|
||
| {/* Feeds table */} | ||
| <Skeleton | ||
| animation='wave' | ||
| variant='text' | ||
| sx={{ fontSize: '1.5rem', width: 260, mt: { xs: 4, md: 5 }, mb: 2 }} | ||
| /> | ||
| {Array.from({ length: ROW_COUNT }, (_, index) => ( | ||
| <Skeleton | ||
| key={index} | ||
| animation='wave' | ||
| variant='rectangular' | ||
| height={48} | ||
| sx={{ mb: 0.5 }} | ||
| /> | ||
| ))} | ||
| </SectionContainer> | ||
| </Container> | ||
| ); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.