From 510b65f1f4cf205345de3bd0e8ae73c639706227 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren?= Date: Thu, 7 Sep 2023 12:51:10 +0200 Subject: [PATCH] Remove unused and confusing location properties --- src/assets-dev/provider-assets.ts | 9 +-------- src/assets-dev/stories/locations.ts | 3 +-- src/shared.ts | 3 +-- types/location.ts | 2 -- 4 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/assets-dev/provider-assets.ts b/src/assets-dev/provider-assets.ts index 29c69f35..9c345751 100644 --- a/src/assets-dev/provider-assets.ts +++ b/src/assets-dev/provider-assets.ts @@ -17,21 +17,18 @@ const i18nKeyPassThrough = { // for providerLabel is happening in i18n-t in ProviderBanner, and providerTooltip is defined as a getter to not be // constant but re-computed on language changes. providerLabel can include a {provider} placeholder which gets handled // in i18n-t in ProviderBanner. -export const providersAssets: Record> = { +export const providersAssets: Record> = { [Provider.DefaultShop]: { bg: 'white', - bgFullCard: false, theme: Theme.Light, }, [Provider.DefaultAtm]: { theme: Theme.Dark, - bgFullCard: true, bg: 'radial-gradient(100% 100% at 100% 100%, #4D4C96 0%, #5F4B8B 100%)', }, [Provider.GoCrypto]: { theme: Theme.Light, - bgFullCard: false, bg: '#F0BF4C', get providerLabel() { const i18n = i18nKeyPassThrough @@ -44,7 +41,6 @@ export const providersAssets: Record +type ExtraFields = Pick export function getExtra(provider: Provider, sells: Currency[] = [], linkTo: LocationLink = LocationLink.GMaps): ExtraFields { const assets = providersAssets[provider] if (!assets) @@ -23,7 +23,6 @@ export function getExtra(provider: Provider, sells: Currency[] = [], linkTo: Loc return { isAtm, - isShop: !isAtm, isDark: assets.theme === 'dark', isLight: assets.theme === 'light', ...assets, diff --git a/src/shared.ts b/src/shared.ts index a2de43ea..6e1bf63b 100644 --- a/src/shared.ts +++ b/src/shared.ts @@ -1,6 +1,6 @@ import { PROVIDERS } from 'database' import type { DatabaseArgs, Location } from 'types' -import { Category, LocationLink, Provider, Theme } from 'types' +import { LocationLink, Provider, Theme } from 'types' import { providersAssets } from './assets-dev/provider-assets' import { translateCategory } from './translations' @@ -41,7 +41,6 @@ export function parseLocation(location: Location) { Object.assign(location, providersAssets[location.provider]) // Assing all the keys from the asset to the location location.isAtm = isAtm - location.isShop = location.category === Category.Shop location.isDark = location.theme === Theme.Dark location.isLight = location.theme === Theme.Light location.hasBottomBanner = location.provider !== Provider.DefaultShop && location.provider !== Provider.DefaultAtm diff --git a/types/location.ts b/types/location.ts index 34fd544f..a77e5c5c 100644 --- a/types/location.ts +++ b/types/location.ts @@ -48,7 +48,6 @@ export interface Location { // UI Options theme: Theme - bgFullCard: boolean bg: string // Provider text @@ -58,7 +57,6 @@ export interface Location { // Quick getters isAtm: boolean - isShop: boolean isDark: boolean isLight: boolean hasBottomBanner: boolean