Ott 1710 disable preferences on facr (#510)
* refactor(1710): replaced hooks usePageId useSportNameParam to usePageParams * feat(1710): added config to disable preferencsekeep-around/af30b88d367751c9e05a735e4a0467a96238ef47
parent
590ab5e390
commit
53e0abae2d
@ -1,13 +0,0 @@ |
|||||||
import { useParams } from 'react-router-dom' |
|
||||||
|
|
||||||
type Params = { |
|
||||||
pageId: string, |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* Хук возвращает id страницы |
|
||||||
*/ |
|
||||||
export const usePageId = () => { |
|
||||||
const { pageId } = useParams<Params>() |
|
||||||
return Number(pageId) |
|
||||||
} |
|
||||||
@ -1,16 +0,0 @@ |
|||||||
import { useParams } from 'react-router' |
|
||||||
|
|
||||||
import toUpper from 'lodash/toUpper' |
|
||||||
|
|
||||||
import { SportTypes } from 'config' |
|
||||||
|
|
||||||
type SportName = 'FOOTBALL' | 'HOCKEY' | 'BASKETBALL' |
|
||||||
|
|
||||||
export const useSportNameParam = () => { |
|
||||||
const { sportName } = useParams<{ sportName: string }>() |
|
||||||
|
|
||||||
return { |
|
||||||
sportName, |
|
||||||
sportType: SportTypes[toUpper(sportName) as SportName], |
|
||||||
} |
|
||||||
} |
|
||||||
Loading…
Reference in new issue