mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-20 01:33:05 +00:00
fix(campanha): B133 typecheck — optional catalog subtitle + chrome component return
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
This commit is contained in:
parent
f89fc4b81f
commit
6cc17f0d4e
2 changed files with 4 additions and 2 deletions
|
|
@ -15,7 +15,7 @@ const IGNORED_PARAMS = ['page']
|
||||||
* When the current URL matches a saved municipality filter, the filter name
|
* When the current URL matches a saved municipality filter, the filter name
|
||||||
* becomes the page subtitle (B133) — the bar keeps chips as the editable recorte.
|
* becomes the page subtitle (B133) — the bar keeps chips as the editable recorte.
|
||||||
*/
|
*/
|
||||||
export const MunicipalityListPageChrome = (): null => {
|
export const MunicipalityListPageChrome = () => {
|
||||||
const savedFilters = useMunicipalitySavedFilters()
|
const savedFilters = useMunicipalitySavedFilters()
|
||||||
const pathname = usePathname()
|
const pathname = usePathname()
|
||||||
const searchParams = useSearchParams()
|
const searchParams = useSearchParams()
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,9 @@ const resolveCatalogEntry = (
|
||||||
entry: (typeof campaignPageChromeCatalog)[keyof typeof campaignPageChromeCatalog],
|
entry: (typeof campaignPageChromeCatalog)[keyof typeof campaignPageChromeCatalog],
|
||||||
): CampaignPageChrome | null => {
|
): CampaignPageChrome | null => {
|
||||||
if (!entry) return null
|
if (!entry) return null
|
||||||
return { title: entry.title, subtitle: entry.subtitle }
|
return 'subtitle' in entry && entry.subtitle
|
||||||
|
? { title: entry.title, subtitle: entry.subtitle }
|
||||||
|
: { title: entry.title }
|
||||||
}
|
}
|
||||||
|
|
||||||
const sectionOnly = (title: string): CampaignPageChrome => ({ title })
|
const sectionOnly = (title: string): CampaignPageChrome => ({ title })
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue