Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions app/views/streamer/bits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ object bits:

import trans.streamer.*

def create(implicit ctx: Context) =
def create(using Context) =
views.html.site.message(
title = becomeStreamer.txt(),
icon = Some(""),
Expand All @@ -30,7 +30,7 @@ object bits:
)
)

def menu(active: String, s: Option[lila.streamer.Streamer.WithContext])(implicit ctx: Context) =
def menu(active: String, s: Option[lila.streamer.Streamer.WithContext])(using ctx: Context) =
st.nav(cls := "subnav")(
a(cls := active.active("index"), href := routes.Streamer.index())(allStreamers()),
s.map { st =>
Expand Down Expand Up @@ -107,10 +107,10 @@ object bits:
}
)

def subscribeButtonFor(s: lila.streamer.Streamer.WithContext)(using ctx: Context, lang: Lang): Option[Tag] =
def subscribeButtonFor(s: lila.streamer.Streamer.WithContext)(using ctx: Context): Option[Tag] =
ctx.isAuth option {
val id = s"streamer-subscribe-${s.streamer.userId}"
label(cls := "streamer-subscribe button button-metal")(
label(cls := "streamer-subscribe")(
`for` := id,
data("action") := s"${routes.Streamer.subscribe(s.streamer.userId, !s.subscribed)}"
)(
Expand All @@ -124,3 +124,7 @@ object bits:
trans.subscribe()
)
}
def streamerProfile(s: lila.streamer.Streamer.WithContext)(using lang: Lang) =
span(cls := "streamer-profile")(
userLink(s.user)
)
13 changes: 5 additions & 8 deletions app/views/streamer/header.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,7 @@ object header:
href := youTube.fullUrl
)(youTube.minUrl)
)
},
li(
a(cls := "service lichess ulpt", href := routes.User.show(s.user.username))(
netConfig.domain,
routes.User.show(s.user.username).url
)
)
}
),
div(cls := "ats")(
s.stream.map { s =>
Expand All @@ -62,6 +56,9 @@ object header:
}
)
),
!modView option bits.subscribeButtonFor(s)
div(cls := "streamer-footer")(
!modView option bits.subscribeButtonFor(s),
bits.streamerProfile(s)
)
)
)
5 changes: 4 additions & 1 deletion app/views/streamer/index.scala
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ object index:
}
)
),
!requests option bits.subscribeButtonFor(s)
div(cls := "streamer-footer")(
!requests option bits.subscribeButtonFor(s),
bits.streamerProfile(s)
)
)
)

Expand Down
13 changes: 12 additions & 1 deletion ui/site/css/streamer/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,12 @@
@extend %flex-center-nowrap;
gap: 1em;
align-self: flex-start;
z-index: 2;
font-weight: bold;
z-index: z('link-overlay');
}

.streamer-profile {
z-index: z('link-overlay');
}

.live .streamer-lang {
Expand All @@ -136,3 +141,9 @@
margin-right: 50px;
}
}

.streamer-footer {
@extend %flex-wrap;
align-items: center;
gap: 3em;
}
2 changes: 1 addition & 1 deletion ui/site/css/streamer/_list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ $mq-picture: $mq-medium;
}

.overview {
margin: 20px 10px 0 2.5vw;
margin: 20px 10px 10px 2.5vw;
display: flex;
flex: auto;
flex-flow: column;
Expand Down