IN-444-add-other-sports #139
Merged
andrey.dekterev
merged 2 commits from IN-444-add-other-sports into develop 3 years ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'IN-444-add-other-sports'
Deleting a branch is permanent. It CANNOT be undone. Continue?
https://insports.atlassian.net/browse/IN-444
const [sportsList, setSportsList] = useLocalStore<SportsType>({defaultValue: {} as Sport,key: querieKeys.sportsList,validator: (val) => !!val,export const InputStyled = styled.input<InputProps>`${inputStyles}${inputStyles};зачем ";" ?
линтер ругался
key: filterKeys.DATE,validator: isValidDate,})const sportList = JSON.parse(localStorage.getItem(querieKeys.sportsList)!)так будет безопаснее
export const getLexicFromSport = () => {const sportList = getLocalStorageItem(querieKeys.sportsList)const sportLexics = Object.values(sportList as Array<Sport>)так лучше с точки зрения перфоманса
id={team.id}name={team.name_en}sportId={SportTypes.FOOTBALL}sportId={1} // footballа у нас теперь не будет словаря, как узнать какой id спорта для хоккея например?
можно в локалсторадж зайти и посмотреть, там хранится инфа по всем видам спорта
export const getLocalStorageItem = (key: string) => {const item = localStorage.getItem(key)!а почему !, а если не будет ключа? лучше добавить проверку
const sportsList = getLocalStorageItem(querieKeys.sportsList)const sportsArray = Object.values(sportsList as Array<Sport>)?.reduce((acc, cur) => {if (cur.id === 1 || cur.id === 3) {858ae3a313to38828ce8163 years ago38828ce816toe43cbc2c023 years agoe43cbc2c02into develop 3 years agoReviewers
e43cbc2c02.