-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.ts
121 lines (108 loc) · 2.79 KB
/
config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
import { toBoolean } from 'lib/shared/utils'
import { LevelsByName } from 'tinga'
import linguiConfig from '../../../lingui.config.js'
/**
* ! This file holds configuration options that can be used
* ! in the browser as well on the server
*/
const nodeEnv = process.env.NEXT_PUBLIC_NODE_ENV as typeof process.env.NODE_ENV
export type SharedConfig = typeof SHARED_CONFIG
export const SHARED_CONFIG = Object.freeze({
isProduction: nodeEnv === 'production',
isDevelopment: nodeEnv === 'development',
isPreview: process.env.NEXT_PUBLIC_APP_ENV === 'preview',
url:
process.env.NEXT_PUBLIC_VERCEL_ENV === 'production'
? 'https://live-radio.vercel.app'
: process.env.NEXT_PUBLIC_VERCEL_URL
? process.env.NEXT_PUBLIC_VERCEL_URL!.replace(/\/$/, '')
: 'http://localhost:3000',
logLevel: (process.env.NEXT_PUBLIC_BROWSER_LOG_LEVEL ||
'silent') as LevelsByName,
locales: [...linguiConfig.locales],
defaultLocale: linguiConfig.fallbackLocales.default,
radioAPIUserAgent: 'Live Radio',
localDbName: 'LiveRadio',
layout: {
playerHeight: 73,
mobileMenuHeight: 56,
topBarHeight: 56,
mainContentSpacer: 16,
desktopDrawerWidth: 270
} as const,
defaultArtwork: {
src: '/pwa-icons/manifest-icon-512.png',
sizes: '512x512',
type: 'image/png'
},
colors: {
favoritesHeartColor: '#ff0000'
},
serviceWorker: {
path: '/sw.js',
scope: '/',
enable: toBoolean(process.env.NEXT_PUBLIC_ENABLE_SERVICE_WORKER, false),
enableReload: toBoolean(
process.env.NEXT_PUBLIC_ENABLE_SERVICE_WORKER_RELOAD,
false
)
},
defaultStation: {
_id: '961173b5-0601-11e8-ae97-52543be04c81',
name: 'SomaFM Lush',
url: 'https://ice.somafm.com/lush-128-mp3',
homepage: 'https://www.somafm.com/',
language: [],
tags: [],
flag: '',
country: 'Internet',
countryCode: '',
continent: '',
continentCode: '',
codec: 'MP3'
},
stationSearchIndexes: [
'data.language',
'data.country',
'data.tags',
'data.continent',
'data.name'
],
cookies: {
pwaUpdated: {
name: 'show_app_updated',
value: '1',
options: {
sameSite: 'strict' as const
}
},
pwaInstallDismissed: {
name: 'pwa_install_dissmissed',
value: '1',
options: {
expires: 1
}
},
anonymousImportDissmissed: {
name: 'anonymous_dissmissed',
value: '1',
options: {
expires: 31 * 12, // ~ one year,
path: '/',
sameSite: 'strict' as const
}
},
locale: {
name: 'NEXT_LOCALE',
options: {
expires: 31, //one month,
path: '/',
sameSite: 'lax' as const
}
}
},
enablePWAInstallBanner: toBoolean(
process.env.NEXT_PUBLIC_ENABLE_PWA_INSTALL,
false
)
})