mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-11 00:33:04 +00:00
fix: favorite link and search result styles
This commit is contained in:
@@ -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(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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}>
|
||||||
|
|||||||
@@ -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',
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -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',
|
||||||
|
|||||||
Reference in New Issue
Block a user