Remove dependency on lodash.get
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { useSelector } from 'react-redux'
|
||||
import get from 'lodash.get'
|
||||
|
||||
const getPerPage = (width) => {
|
||||
if (width === 'xs') return 12
|
||||
@@ -19,8 +18,8 @@ const getPerPageOptions = (width) => {
|
||||
|
||||
export const useAlbumsPerPage = (width) => {
|
||||
const perPage =
|
||||
useSelector((state) =>
|
||||
get(state.admin.resources, ['album', 'list', 'params', 'perPage'])
|
||||
useSelector(
|
||||
(state) => state?.admin.resources?.album?.list?.params?.perPage
|
||||
) || getPerPage(width)
|
||||
|
||||
return [perPage, getPerPageOptions(width)]
|
||||
|
||||
Reference in New Issue
Block a user