Skip to content

Commit

Permalink
Remove login background image support
Browse files Browse the repository at this point in the history
  • Loading branch information
swansontec committed Jan 5, 2024
1 parent 2a7987e commit 60908c8
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 110 deletions.
Binary file removed src/assets/images/backgrounds/login_bg.jpg
Binary file not shown.
13 changes: 1 addition & 12 deletions src/components/scenes/LoginScene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,18 @@ import { cacheStyles, Theme, useTheme } from '../../components/services/ThemeCon
import { ENV } from '../../env'
import { ExperimentConfig, getExperimentConfig } from '../../experimentConfig'
import { useAsyncEffect } from '../../hooks/useAsyncEffect'
import { useAsyncValue } from '../../hooks/useAsyncValue'
import { useHandler } from '../../hooks/useHandler'
import { useWatch } from '../../hooks/useWatch'
import { lstrings } from '../../locales/strings'
import { config } from '../../theme/appConfig'
import { useDispatch, useSelector } from '../../types/reactRedux'
import { EdgeSceneProps } from '../../types/routerTypes'
import { ImageProp } from '../../types/Theme'
import { GuiTouchIdInfo } from '../../types/types'
import { logEvent, trackError } from '../../util/tracking'
import { pickRandom } from '../../util/utils'
import { withServices } from '../hoc/withServices'
import { showHelpModal } from '../modals/HelpModal'
import { UpdateModal } from '../modals/UpdateModal'
import { Airship, showError } from '../services/AirshipInstance'
import { getBackgroundImage } from './../../util/ThemeCache'
import { LoadingScene } from './LoadingScene'

// Sneak the BlurView over to the login UI:
Expand Down Expand Up @@ -75,11 +71,6 @@ export function LoginSceneComponent(props: Props) {
// Effects
// ---------------------------------------------------------------------

const [backgroundImage = theme.backgroundImage] = useAsyncValue<ImageProp | undefined>(async () => {
const url = pickRandom(theme.backgroundImageServerUrls)
return await getBackgroundImage(disklet, url, theme.backgroundImage)
}, [disklet, theme])

React.useEffect(() => {
const { YOLO_USERNAME, YOLO_PASSWORD, YOLO_PIN } = ENV
if (YOLO_USERNAME != null && (Boolean(YOLO_PASSWORD) || Boolean(YOLO_PIN)) && firstRun) {
Expand Down Expand Up @@ -198,7 +189,6 @@ export function LoginSceneComponent(props: Props) {
appConfig={config}
appId={config.appId}
appName={config.appNameShort}
backgroundImage={backgroundImage}
context={context}
fontDescription={fontDescription}
initialLoginId={nextLoginId ?? undefined}
Expand Down Expand Up @@ -231,8 +221,7 @@ const dummyTouchIdInfo: GuiTouchIdInfo = {
const getStyles = cacheStyles((theme: Theme) => ({
container: {
flex: 1,
paddingTop: StatusBar.currentHeight,
backgroundColor: theme.backgroundGradientColors[0]
paddingTop: StatusBar.currentHeight
}
}))

Expand Down
2 changes: 0 additions & 2 deletions src/theme/variables/edgeDark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ export const edgeDark: Theme = {
backgroundGradientColors: [palette.darkestNavy, palette.darkAqua],
backgroundGradientStart: { x: 0, y: 0 },
backgroundGradientEnd: { x: 1, y: 0 },
backgroundImageServerUrls: ['https://content.edge.app'],
backgroundImage: undefined,

// Camera Overlay
cameraOverlayColor: palette.black,
Expand Down
2 changes: 0 additions & 2 deletions src/theme/variables/edgeLight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ export const edgeLight: Theme = {
backgroundGradientColors: [palette.lightestGray, palette.lightestGray],
backgroundGradientStart: { x: 0, y: 0 },
backgroundGradientEnd: { x: 0, y: 1 },
backgroundImageServerUrls: ['https://content.edge.app'],
backgroundImage: undefined,

// Camera Overlay
cameraOverlayColor: palette.gray,
Expand Down
3 changes: 0 additions & 3 deletions src/theme/variables/testDark.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Dimensions, Platform } from 'react-native'

import backgroundImage from '../../assets/images/backgrounds/login_bg.jpg'
import fioAddressLogo from '../../assets/images/details_fioAddress.png'
import guiPluginLogoMoonpay from '../../assets/images/guiPlugins/guiPluginLogoMoonpayDark.png'
import paymentTypeLogoApplePay from '../../assets/images/paymentTypes/paymentTypeLogoApplePay.png'
Expand Down Expand Up @@ -126,8 +125,6 @@ export const testDark: Theme = {
backgroundGradientColors: [palette.deepPurple, palette.darkPurple2],
backgroundGradientStart: { x: 0, y: 0 },
backgroundGradientEnd: { x: 0, y: 1 },
backgroundImageServerUrls: ['https://content-test.edge.app'],
backgroundImage,

// Camera Overlay
cameraOverlayColor: palette.black,
Expand Down
2 changes: 0 additions & 2 deletions src/theme/variables/testLight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ export const testLight: Theme = {
backgroundGradientColors: [palette.lightestGray, palette.lightestGray],
backgroundGradientStart: { x: 0, y: 0 },
backgroundGradientEnd: { x: 0, y: 1 },
backgroundImageServerUrls: [],
backgroundImage: undefined,

// Camera Overlay
cameraOverlayColor: palette.gray,
Expand Down
3 changes: 0 additions & 3 deletions src/types/Theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ export interface Theme {
backgroundGradientStart: { x: number; y: number }
backgroundGradientEnd: { x: number; y: number }

backgroundImageServerUrls: string[]
backgroundImage?: ImageProp

// Camera Overlay
cameraOverlayColor: string
cameraOverlayOpStart: number
Expand Down
81 changes: 0 additions & 81 deletions src/util/ThemeCache.ts

This file was deleted.

5 changes: 0 additions & 5 deletions src/util/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -519,11 +519,6 @@ export const shuffleArray = <T>(array: T[]): T[] => {
return array
}

export const pickRandom = <T>(array?: T[]): T | null => {
if (array == null || array.length === 0) return null
return array[Math.floor(Math.random() * array.length)]
}

/**
* Waits for a collection of promises.
* Returns all the promises that manage to resolve within the timeout.
Expand Down

0 comments on commit 60908c8

Please sign in to comment.