Skip to content

Commit

Permalink
Allow signed-out users to interact with specific buttons such as show…
Browse files Browse the repository at this point in the history
…MoreOptions (#450)

Signed-off-by: Sagi Sarussi <[email protected]>
  • Loading branch information
tuxiqae authored Jun 7, 2023
1 parent a77c611 commit 76fa69e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ fun CommentFooterLine(
icon = Icons.Outlined.MoreVert,
account = account,
onClick = { showMoreOptions = !showMoreOptions },
requiresAccount = false,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ fun CommentMentionNodeFooterLine(
icon = Icons.Outlined.MoreVert,
account = account,
onClick = { showMoreOptions = !showMoreOptions },
requiresAccount = false,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ fun CommentReplyNodeFooterLine(
icon = Icons.Outlined.MoreVert,
account = account,
onClick = { showMoreOptions = !showMoreOptions },
requiresAccount = false,
)
}
}
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/jerboa/ui/components/common/AppBars.kt
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ fun ActionBarButton(
contentColor: Color = MaterialTheme.colorScheme.onBackground.muted,
noClick: Boolean = false,
account: Account?,
requiresAccount: Boolean = true,
) {
val ctx = LocalContext.current
// Button(
Expand All @@ -311,7 +312,7 @@ fun ActionBarButton(
Modifier
} else {
Modifier.clickable(onClick = {
if (account !== null) {
if (!requiresAccount || account !== null) {
onClick()
} else {
loginFirstToast(ctx)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ fun PostFooterLine(
icon = Icons.Outlined.MoreVert,
account = account,
onClick = { showMoreOptions = !showMoreOptions },
requiresAccount = false,
)
}
}
Expand Down

0 comments on commit 76fa69e

Please sign in to comment.