Support dim theme on join request landing page (#10832)

This commit is contained in:
DS Boyce
2026-06-09 23:31:45 -07:00
committed by GitHub
parent 76694a2ba8
commit fc14427134
5 changed files with 15 additions and 8 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 KiB

After

Width:  |  Height:  |  Size: 242 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

+15 -8
View File
@@ -1,6 +1,7 @@
import {View} from 'react-native'
import {ImageBackground} from 'expo-image'
import {ChatBskyGroupDefs, moderateProfile} from '@atproto/api'
import {type ThemeName} from '@bsky.app/alf'
import {Trans, useLingui} from '@lingui/react/macro'
import {createSanitizedDisplayName} from '#/lib/moderation/create-sanitized-display-name'
@@ -19,10 +20,23 @@ import {ProfileBadges} from '#/components/ProfileBadges'
import {Text} from '#/components/Typography'
const desktopDarkBg = require('../../../assets/images/chat-desktop-bg-dark.webp')
const desktopDimBg = require('../../../assets/images/chat-desktop-bg-dim.webp')
const desktopLightBg = require('../../../assets/images/chat-desktop-bg-light.webp')
const mobileDarkBg = require('../../../assets/images/chat-mobile-bg-dark.webp')
const mobileDimBg = require('../../../assets/images/chat-mobile-bg-dim.webp')
const mobileLightBg = require('../../../assets/images/chat-mobile-bg-light.webp')
function getBackgroundImage(themeName: ThemeName, gtMobile: boolean) {
switch (themeName) {
case 'dark':
return gtMobile ? desktopDarkBg : mobileDarkBg
case 'dim':
return gtMobile ? desktopDimBg : mobileDimBg
default:
return gtMobile ? desktopLightBg : mobileLightBg
}
}
type Props = {
setScreenState: (state: LoggedOutScreenState) => void
}
@@ -43,14 +57,7 @@ export function JoinRequest({setScreenState}: Props) {
hasSession: false,
})
const isDarkMode = t.name !== 'light'
const background = gtMobile
? isDarkMode
? desktopDarkBg
: desktopLightBg
: isDarkMode
? mobileDarkBg
: mobileLightBg
const background = getBackgroundImage(t.name, gtMobile)
const joinLinkPreview = data?.joinLinkPreviews[0]