diff --git a/app/controllers/favicons_controller.ts b/app/controllers/favicons_controller.ts index af40025..95c990d 100644 --- a/app/controllers/favicons_controller.ts +++ b/app/controllers/favicons_controller.ts @@ -54,13 +54,21 @@ export default class FaviconsController { throw new FaviconNotFoundException(`No favicon path found in ${url}`); } + if (faviconPath.startsWith('http')) { + try { + return await this.fetchFavicon(faviconPath); + } catch { + logger.debug(`Unable to retrieve favicon from ${faviconPath}`); + } + } + return this.fetchFaviconFromPath(url, faviconPath); } private async fetchFavicon(url: string): Promise { const response = await this.fetchWithUserAgent(url); if (!response.ok) { - throw new FaviconNotFoundException(`Request to ${url} failed`); + throw new FaviconNotFoundException(`Request to favicon ${url} failed`); } const blob = await response.blob(); diff --git a/inertia/app/app.tsx b/inertia/app/app.tsx index 0f92cf2..0b79a22 100644 --- a/inertia/app/app.tsx +++ b/inertia/app/app.tsx @@ -1,12 +1,11 @@ import { resolvePageComponent } from '@adonisjs/inertia/helpers'; import { createInertiaApp } from '@inertiajs/react'; -import { hydrateRoot } from 'react-dom/client'; -import 'react-toggle/style.css'; -import { primaryColor } from '~/styles/theme'; -import '../i18n/index'; - import 'dayjs/locale/en'; import 'dayjs/locale/fr'; +import { hydrateRoot } from 'react-dom/client'; +import 'react-toggle/style.css'; +import { primaryColor } from '~/styles/common_colors'; +import '../i18n/index'; const appName = import.meta.env.VITE_APP_NAME || 'MyLinks'; diff --git a/inertia/components/dashboard/collection/collection_container.tsx b/inertia/components/dashboard/collection/collection_container.tsx index 48e7e7d..b2a80ff 100644 --- a/inertia/components/dashboard/collection/collection_container.tsx +++ b/inertia/components/dashboard/collection/collection_container.tsx @@ -1,10 +1,17 @@ import styled from '@emotion/styled'; +import { ReactNode } from 'react'; import CollectionHeader from '~/components/dashboard/collection/header/collection_header'; import LinkList from '~/components/dashboard/link/link_list'; import { NoCollection } from '~/components/dashboard/link/no_item'; import Footer from '~/components/footer/footer'; import useActiveCollection from '~/hooks/use_active_collection'; +export interface CollectionHeaderProps { + openNavigationItem: ReactNode; + openCollectionItem: ReactNode; + showButtons: boolean; +} + const CollectionContainerStyle = styled.div({ height: '100%', minWidth: 0, @@ -14,15 +21,7 @@ const CollectionContainerStyle = styled.div({ flexDirection: 'column', }); -interface CollectionContainerProps { - isMobile: boolean; - openSideMenu: () => void; -} - -export default function CollectionContainer({ - isMobile: _, - openSideMenu: __, -}: Readonly) { +export default function CollectionContainer(props: CollectionHeaderProps) { const { activeCollection } = useActiveCollection(); if (activeCollection === null) { @@ -31,7 +30,7 @@ export default function CollectionContainer({ return ( - +