fix: favorite link and search result styles

This commit is contained in:
Sonny
2024-09-17 16:14:25 +02:00
parent 9d4eb08bc9
commit b0e3bfa0f6
5 changed files with 17 additions and 6 deletions

View File

@@ -25,9 +25,11 @@ export default class CollectionsController {
return response.redirectToNamedRoute('dashboard'); return response.redirectToNamedRoute('dashboard');
} }
// TODO: Create DTOs
return inertia.render('dashboard', { return inertia.render('dashboard', {
collections, collections: collections.map((collection) => collection.serialize()),
activeCollection: activeCollection || collections[0], activeCollection:
activeCollection?.serialize() || collections[0].serialize(),
}); });
} }

View File

@@ -80,6 +80,7 @@ export default function DashboardProviders(
enabled: globalHotkeysEnabled, enabled: globalHotkeysEnabled,
} }
); );
return ( return (
<CollectionsContext.Provider value={collectionsContextValue}> <CollectionsContext.Provider value={collectionsContextValue}>
<ActiveCollectionContext.Provider value={activeCollectionContextValue}> <ActiveCollectionContext.Provider value={activeCollectionContextValue}>

View File

@@ -15,7 +15,7 @@ const SearchItemStyle = styled('li', {
shouldForwardProp: (propName) => propName !== 'isActive', shouldForwardProp: (propName) => propName !== 'isActive',
})<{ isActive: boolean }>(({ theme, isActive }) => ({ })<{ isActive: boolean }>(({ theme, isActive }) => ({
fontSize: '16px', fontSize: '16px',
backgroundColor: isActive ? theme.colors.background : 'transparent', backgroundColor: isActive ? theme.colors.secondary : 'transparent',
display: 'flex', display: 'flex',
gap: '0.35em', gap: '0.35em',
alignItems: 'center', alignItems: 'center',

View File

@@ -16,6 +16,7 @@ import { appendCollectionId, appendLinkId } from '~/lib/navigation';
import { LinkWithCollection } from '~/types/app'; import { LinkWithCollection } from '~/types/app';
const FavoriteItemStyle = styled(ItemExternalLink)(({ theme }) => ({ const FavoriteItemStyle = styled(ItemExternalLink)(({ theme }) => ({
height: 'auto',
backgroundColor: theme.colors.secondary, backgroundColor: theme.colors.secondary,
})); }));
@@ -23,13 +24,20 @@ const FavoriteDropdown = styled(Dropdown)(({ theme }) => ({
backgroundColor: theme.colors.secondary, backgroundColor: theme.colors.secondary,
})); }));
const FavoriteContainer = styled.div({
flex: 1,
lineHeight: '1.1rem',
});
export default function FavoriteItem({ link }: { link: LinkWithCollection }) { export default function FavoriteItem({ link }: { link: LinkWithCollection }) {
const { t } = useTranslation(); const { t } = useTranslation();
return ( return (
<FavoriteItemStyle href={link.url}> <FavoriteItemStyle href={link.url}>
<LinkFavicon url={link.url} size={24} /> <LinkFavicon url={link.url} size={24} />
<FavoriteContainer>
<TextEllipsis>{link.name}</TextEllipsis> <TextEllipsis>{link.name}</TextEllipsis>
<Legend>({link.collection.name})</Legend> <Legend>{link.collection.name}</Legend>
</FavoriteContainer>
<FavoriteDropdown <FavoriteDropdown
onClick={(event) => { onClick={(event) => {
event.preventDefault(); event.preventDefault();

View File

@@ -14,7 +14,7 @@ const ProfileStyle = styled(UnstyledList)({
gap: '1.25em', gap: '1.25em',
}); });
const Column = styled.li({ const Column = styled.div({
display: 'flex', display: 'flex',
gap: '1rem', gap: '1rem',
flexDirection: 'column', flexDirection: 'column',