fix: cls when star in gird item (#636)
* fix: grid item UI The star icon causes layout shift, and the original line height settings may lead to the title being truncated * fix: cls Signed-off-by: Innei <i@innei.in> * fix: hono Signed-off-by: Innei <i@innei.in> --------- Signed-off-by: Innei <i@innei.in> Co-authored-by: Innei <i@innei.in>
This commit is contained in:
parent
419c9cfd51
commit
b993ae050e
|
|
@ -59,7 +59,7 @@ export function SwipeMedia({
|
|||
<div
|
||||
ref={hoverRef}
|
||||
className={cn(
|
||||
"relative flex w-full items-center overflow-hidden ",
|
||||
"relative flex w-full items-center overflow-hidden",
|
||||
styles["swipe-wrapper"],
|
||||
className,
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ export const useUnread = () =>
|
|||
export const useEntryActions = ({
|
||||
view,
|
||||
entry,
|
||||
type,
|
||||
}: {
|
||||
view?: number
|
||||
entry?: FlatEntryModel | null
|
||||
|
|
@ -300,12 +301,14 @@ export const useEntryActions = ({
|
|||
className: "i-mgc-star-cute-re",
|
||||
hide: !!populatedEntry.collections,
|
||||
onClick: (e) => {
|
||||
mountLottie(absoluteStarAnimationUri, {
|
||||
x: e.clientX - 90,
|
||||
y: e.clientY - 70,
|
||||
height: 126,
|
||||
width: 252,
|
||||
})
|
||||
if (type === "toolbar") {
|
||||
mountLottie(absoluteStarAnimationUri, {
|
||||
x: e.clientX - 90,
|
||||
y: e.clientY - 70,
|
||||
height: 126,
|
||||
width: 252,
|
||||
})
|
||||
}
|
||||
|
||||
collect.mutate()
|
||||
},
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ export const PictureWaterFallItem = memo(function PictureWaterFallItem({
|
|||
<EntryItemWrapper
|
||||
view={FeedViewType.Pictures}
|
||||
entry={entry}
|
||||
itemClassName="group hover:bg-theme-item-hover rounded-md"
|
||||
itemClassName="group hover:bg-theme-item-hover rounded-md overflow-hidden"
|
||||
style={{
|
||||
width: itemWidth,
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
import { cn } from "~/lib/utils"
|
||||
|
||||
export const StarIcon: Component = ({ className }) => (
|
||||
<i
|
||||
className={cn("i-mgc-star-cute-fi absolute right-0 top-0 text-base text-orange-400", className)}
|
||||
/>
|
||||
<i className={cn("i-mgc-star-cute-fi text-base text-orange-400", className)} />
|
||||
)
|
||||
|
|
|
|||
|
|
@ -61,15 +61,18 @@ export const GridItemFooter = ({
|
|||
/>
|
||||
<div
|
||||
className={cn(
|
||||
"relative mb-1 mt-1.5 flex w-full items-center gap-1 truncate font-medium leading-none",
|
||||
!!entry.collections && "pr-5",
|
||||
"relative mb-1 mt-1.5 flex w-full items-center gap-1 truncate font-medium",
|
||||
titleClassName,
|
||||
)}
|
||||
>
|
||||
<TitleMarquee className="min-w-0 grow">
|
||||
<EntryTranslation source={entry.entries.title} target={translation?.title} />
|
||||
</TitleMarquee>
|
||||
{!!entry.collections && <StarIcon className="static shrink-0 self-end" />}
|
||||
{!!entry.collections && (
|
||||
<div className="h-0 shrink-0 -translate-y-2">
|
||||
<StarIcon />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-1 truncate text-[13px]">
|
||||
|
|
|
|||
|
|
@ -547,7 +547,7 @@ declare const collections: drizzle_orm_pg_core.PgTableWithColumns<{
|
|||
generated: undefined;
|
||||
}, {}, {}>;
|
||||
feedId: drizzle_orm_pg_core.PgColumn<{
|
||||
name: "feedId";
|
||||
name: "feed_id";
|
||||
tableName: "collections";
|
||||
dataType: "string";
|
||||
columnType: "PgText";
|
||||
|
|
@ -3426,6 +3426,8 @@ declare const _routes: hono_hono_base.HonoBase<Env, {
|
|||
handle: string | null;
|
||||
createdAt: string;
|
||||
} | null | undefined;
|
||||
subscriptionCount?: number | undefined;
|
||||
purchaseAmount?: number | undefined;
|
||||
}[];
|
||||
};
|
||||
outputFormat: "json" | "text";
|
||||
|
|
@ -3696,7 +3698,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, {
|
|||
userId: string;
|
||||
view: number;
|
||||
category: string | null;
|
||||
feedId: string;
|
||||
feeds: {
|
||||
type: "feed";
|
||||
id: string;
|
||||
|
|
@ -3725,6 +3726,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, {
|
|||
createdAt: string;
|
||||
}[] | null | undefined;
|
||||
};
|
||||
feedId: string;
|
||||
isPrivate: boolean;
|
||||
} | {
|
||||
title: string | null;
|
||||
|
|
|
|||
Loading…
Reference in New Issue