Skip to content

Commit

Permalink
better big view handling for join prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
AmyrAhmady committed Aug 11, 2024
1 parent 493c11a commit 316c78e
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/containers/JoinServerPrompt/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ const JoinServerPrompt = () => {
return null;
}

const HEIGHT =
(server?.hasPassword ? 316 : 248) + (bannerUrl.length ? 77 : 0);
const bigView = bannerUrl.length || logoUrl.length;

const HEIGHT = (server?.hasPassword ? 316 : 248) + (bigView ? 77 : 0);
const WIDTH = 320;

return (
Expand All @@ -118,16 +119,16 @@ const JoinServerPrompt = () => {
shadowRadius: 10,
alignItems: "center",
paddingVertical: sc(11),
paddingTop: bannerUrl.length ? sc(0) : undefined,
paddingTop: bigView ? sc(0) : undefined,
}}
>
{bannerUrl.length ? (
{bigView ? (
<View
style={{
width: "100%",
height: 70 + sc(11),
marginHorizontal: "5%",
// backgroundColor: "red",
backgroundColor: theme.itemBackgroundColor,
overflow: "hidden",
borderTopLeftRadius: sc(10),
borderTopRightRadius: sc(10),
Expand Down Expand Up @@ -358,7 +359,7 @@ const JoinServerPrompt = () => {
<TouchableOpacity
style={{
position: "absolute",
...(bannerUrl.length
...(bigView
? {
top: sc(5),
right: sc(5),
Expand All @@ -376,8 +377,8 @@ const JoinServerPrompt = () => {
>
<Icon
image={images.icons.close}
size={bannerUrl.length ? sc(15) : sc(20)}
color={bannerUrl.length ? "white" : theme.textSecondary}
size={bigView ? sc(15) : sc(20)}
color={bigView ? "white" : theme.textSecondary}
/>
</TouchableOpacity>
</View>
Expand Down

0 comments on commit 316c78e

Please sign in to comment.