Skip to content

Commit

Permalink
fix: hide watched divider if not authenticated
Browse files Browse the repository at this point in the history
  • Loading branch information
believer committed Jan 29, 2025
1 parent 263f005 commit 83b927c
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 44 deletions.
4 changes: 2 additions & 2 deletions components/movie/watched.templ
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ templ Watched(props WatchedProps) {
<ol class="flex flex-col gap-2">
for i, w := range props.WatchedAt {
<li
class="flex gap-x-4 justify-between tabular-nums before:content-[attr(data-position)] before:text-right before:tabular-nums before:w-[2ch] before:text-neutral-400 dark:before:text-neutral-600 items-baseline"
class={ "flex gap-x-4 tabular-nums before:content-[attr(data-position)] before:text-right before:tabular-nums before:w-[2ch] before:text-neutral-400 dark:before:text-neutral-600 items-baseline", templ.KV("justify-between", ctx.Value("IsAuthenticated")) }
data-position={ strconv.Itoa(len(props.WatchedAt) - i) }
>
<div>
Expand All @@ -51,8 +51,8 @@ templ Watched(props WatchedProps) {
{ w.Date.Format("15:04") }
</div>
</div>
@c.Divider()
@c.IsAuthenticated() {
@c.Divider()
<div class="flex gap-4">
<a
class="cursor-pointer text-neutral-300 hover:text-neutral-700 dark:text-neutral-700 hover:dark:text-neutral-300 transition-colors"
Expand Down
102 changes: 60 additions & 42 deletions components/movie/watched_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 83b927c

Please # to comment.