feat: hide watchlist button in continue watching cards
This commit is contained in:
@@ -24,6 +24,7 @@ type AnimeCardProps struct {
|
||||
TitleJapanese string
|
||||
Airing bool
|
||||
WatchlistStatus string // empty if not in watchlist
|
||||
DisableWatchlist bool // if true, don't render the watchlist button
|
||||
}
|
||||
|
||||
templ AnimeCard(props AnimeCardProps) {
|
||||
@@ -91,7 +92,7 @@ templ animeCardPoster(props AnimeCardProps) {
|
||||
</svg>
|
||||
</a>
|
||||
}
|
||||
if !props.CurrentNode {
|
||||
if !props.CurrentNode && !props.DisableWatchlist {
|
||||
@watchlist.CardButton(
|
||||
props.ID,
|
||||
props.Title,
|
||||
|
||||
@@ -23,15 +23,16 @@ templ ContinueWatching(entries []db.GetContinueWatchingEntriesRow) {
|
||||
for _, entry := range entries {
|
||||
<div class="group relative min-w-0" id={ fmt.Sprintf("continue-entry-%d", entry.AnimeID) }>
|
||||
@ui.AnimeCard(ui.AnimeCardProps{
|
||||
ID: int(entry.AnimeID),
|
||||
Title: displayContinueWatchingTitle(entry),
|
||||
ImageURL: entry.ImageUrl,
|
||||
Href: continueWatchingURL(entry),
|
||||
TitleEnglish: nullString(entry.TitleEnglish),
|
||||
TitleJapanese: nullString(entry.TitleJapanese),
|
||||
WatchlistStatus: "watching",
|
||||
Class: "notification-card min-w-0 flex flex-col bg-transparent text-inherit no-underline",
|
||||
HideTitle: true,
|
||||
ID: int(entry.AnimeID),
|
||||
Title: displayContinueWatchingTitle(entry),
|
||||
ImageURL: entry.ImageUrl,
|
||||
Href: continueWatchingURL(entry),
|
||||
TitleEnglish: nullString(entry.TitleEnglish),
|
||||
TitleJapanese: nullString(entry.TitleJapanese),
|
||||
WatchlistStatus: "watching",
|
||||
DisableWatchlist: true,
|
||||
Class: "notification-card min-w-0 flex flex-col bg-transparent text-inherit no-underline",
|
||||
HideTitle: true,
|
||||
}) {
|
||||
<div class="mt-2 grid gap-1 p-0">
|
||||
<div class="line-clamp-2 text-sm leading-snug text-(--text)">{ displayContinueWatchingTitle(entry) }</div>
|
||||
|
||||
Reference in New Issue
Block a user