diff --git a/src/pages/func_group/navigationBar.js b/src/pages/func_group/navigationBar.js new file mode 100644 index 0000000..a6b55d4 --- /dev/null +++ b/src/pages/func_group/navigationBar.js @@ -0,0 +1,236 @@ +import React, { useState, useEffect } from 'react' +import { useSelector, useDispatch } from 'react-redux' + +import { userAuthSelector } from '../../redux/slices/userAuthSlice' +import { userCrudSelector } from '../../redux/slices/userCrudSlice' + +import userCrudAsyncThunk from '../../redux/asyncThunks/userCrudAsyncThunk' + + +const __styleChanger = ( bool ) => { + + let display = { + display: 'block' + } + + let hide = { + display: 'none' + } + + return bool ? display : hide +} + +const NavigationBar = ({ movements }) => { + + const { user_get } = useSelector(userCrudSelector) + const { token, user } = useSelector(userAuthSelector) + + const dispatch = useDispatch() + + useEffect( () => { + if ( user_get !== {} && token !== '' && user.id > 0) + dispatch( + userCrudAsyncThunk.fetchGetOneUser( + { + user_id: user.id, + token: token + } + ) + ) + }) + + const [showAccount, setShowAccount] = useState(false) + const [showModels, setShowModels] = useState(false) + const [showRender, setShowRender] = useState(false) + const [showRenderFunc, setShowRenderFunc] = useState(false) + + return( + <> +