Ott 318 sport type filter clear btn (#107)
* chore(#318): fixed eslint rules order * feat(#318): added sport type filter clear button * fix(#318): fixed useLocalStore hook bug when validator was not specified * refactor(#318): replaced lang useState to useLocalStore hook Co-authored-by: mirlan.maksitaliev <mirlan.maksitaliev@instatsport.com>keep-around/af30b88d367751c9e05a735e4a0467a96238ef47
parent
d7d9266409
commit
9da11400d9
@ -0,0 +1,13 @@ |
||||
import { isSupportedLang } from '..' |
||||
|
||||
it('returns true for supported languages', () => { |
||||
expect(isSupportedLang('ru')).toBe(true) |
||||
expect(isSupportedLang('en')).toBe(true) |
||||
}) |
||||
|
||||
it('returns false for not supported languages', () => { |
||||
expect(isSupportedLang('es')).toBe(false) |
||||
expect(isSupportedLang('ja')).toBe(false) |
||||
expect(isSupportedLang('fr')).toBe(false) |
||||
expect(isSupportedLang('de')).toBe(false) |
||||
}) |
||||
@ -0,0 +1,9 @@ |
||||
import map from 'lodash/map' |
||||
import includes from 'lodash/includes' |
||||
|
||||
import { langsList } from 'features/LanguageSelect/config' |
||||
|
||||
export const isSupportedLang = (lang: string) => { |
||||
const supportedLangs = map(langsList, 'locale') |
||||
return includes(supportedLangs, lang) |
||||
} |
||||
Loading…
Reference in new issue