Skip to content

Commit

Permalink
[SOK-32]
Browse files Browse the repository at this point in the history
*change type for hoc
  • Loading branch information
gloginov committed Oct 9, 2024
1 parent 60b619c commit cbf937a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/client/src/components/hoc/withAuthUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ import { useNavigate, useLocation } from 'react-router-dom'
import { RootState, useAppDispatch } from '@/store'
import { useSelector } from 'react-redux'

type WithAuthUserProps = {
userIsLogged: boolean
user: UserType | null
}

export default function withAuthUser<P extends object>(
Component: ComponentType<P>,
Component: ComponentType<P & WithAuthUserProps>,
redirectTo?: string
) {
return function WrappedWithAuthUser(props: P) {
Expand Down

0 comments on commit cbf937a

Please sign in to comment.