From f213520baca515e8f89feb5d5dcd044c4cd8c863 Mon Sep 17 00:00:00 2001 From: medyo Date: Fri, 28 Oct 2022 14:34:35 +0100 Subject: [PATCH] move constant values to config folder --- src/Constants.js | 11 ++--------- src/config/index.ts | 3 +++ src/lib/analytics.ts | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-) create mode 100644 src/config/index.ts diff --git a/src/Constants.js b/src/Constants.js index 788e1d6e..c4935038 100644 --- a/src/Constants.js +++ b/src/Constants.js @@ -16,8 +16,8 @@ import { FaDev } from 'react-icons/fa' import { SiProducthunt } from 'react-icons/si' import { FaReddit, FaMediumM } from 'react-icons/fa' import { HiTicket } from 'react-icons/hi' -import HashNodeIcon from './static/icon_hashnode.png' -import LobstersIcon from './static/icon_lobsters.png' +import HashNodeIcon from 'src/assets/icon_hashnode.png' +import LobstersIcon from 'src/assets/icon_lobsters.png' import { FaFreeCodeCamp } from 'react-icons/fa' import { CgIndieHackers } from 'react-icons/cg' @@ -34,12 +34,6 @@ const APP = { dataSourcesLink: 'https://www.hackertab.dev/data-sources', changeLogLink: 'https://api.github.com/repos/medyo/hackertab.dev/releases', } -export const ANALYTICS_ENDPOINT = 'https://api.hackertab.dev/analytics' -export const ANALYTICS_SDK_KEY = '9662c93f91473ba6e96711b22e0a367d' - -export const LOCAL_CONFIGURATION = { - supportedTags: [], // Loaded remotly -} export const SUPPORTED_CARDS = [ { @@ -152,7 +146,6 @@ export const SUPPORTED_SEARCH_ENGINES = [ }, ] export const LS_PREFERENCES_KEY = 'hackerTabPrefs' -export const LS_ANALYTICS_ID_KEY = 'hackerTabAnalyticsId' export const GLOBAL_TAG = { value: 'global', label: 'Trending', diff --git a/src/config/index.ts b/src/config/index.ts new file mode 100644 index 00000000..0ea42387 --- /dev/null +++ b/src/config/index.ts @@ -0,0 +1,3 @@ +export const ANALYTICS_ENDPOINT = 'https://api.hackertab.dev/analytics' +export const ANALYTICS_SDK_KEY = '9662c93f91473ba6e96711b22e0a367d' +export const LS_ANALYTICS_ID_KEY = 'hackerTabAnalyticsId' \ No newline at end of file diff --git a/src/lib/analytics.ts b/src/lib/analytics.ts index f5424a2b..3ddbc642 100644 --- a/src/lib/analytics.ts +++ b/src/lib/analytics.ts @@ -1,7 +1,7 @@ import AppStorage from '../services/localStorage'; import { init, track, identify, Identify } from '@amplitude/analytics-browser' import { isDevelopment } from 'src/utils/Environment'; -import { ANALYTICS_SDK_KEY, ANALYTICS_ENDPOINT, LS_ANALYTICS_ID_KEY } from 'src/Constants' +import { ANALYTICS_SDK_KEY, ANALYTICS_ENDPOINT, LS_ANALYTICS_ID_KEY } from 'src/config' import {getAppVersion} from "src/utils/Os"; enum Objects {