From 3676fb0033aaabe91a672d9661298559a22d02ca Mon Sep 17 00:00:00 2001 From: rahighi Date: Sun, 29 Aug 2021 08:47:15 +0430 Subject: some code refactoring and remove lint errors --- modern/src/App.js | 2 +- modern/src/common/localization.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'modern') diff --git a/modern/src/App.js b/modern/src/App.js index d3ba39ad..5143ad88 100644 --- a/modern/src/App.js +++ b/modern/src/App.js @@ -91,4 +91,4 @@ const App = () => { ); }; -export default App; \ No newline at end of file +export default App; diff --git a/modern/src/common/localization.js b/modern/src/common/localization.js index 5f1b8863..7383788d 100644 --- a/modern/src/common/localization.js +++ b/modern/src/common/localization.js @@ -1,4 +1,4 @@ -import React, { useState, createContext, useContext, useEffect } from "react"; +import React, { useState, createContext, useContext } from "react"; import af from '../../../web/l10n/af.json'; import ar from '../../../web/l10n/ar.json'; @@ -141,14 +141,14 @@ export default key => { return selectedLanguage.data[key]; }; -export const setSelectedLanguage = (language) => { +const setSelectedLanguage = (language) => { selectedLanguage = supportedLanguages[language]; localStorage.setItem('language', language); } -export const defaultLanguage = language; +const defaultLanguage = language; -export const LocalizationContext = createContext({ +const LocalizationContext = createContext({ language }); -- cgit v1.2.3