maccounter
15 строк · 586.0 Байт
1import Greeting from '@components/Greeting/Greeting'
2import { setTimePeriod } from '@store/app-store/appReducer'
3import { useAppSelector } from '@store/hooks'
4import React from 'react'
5import { useDispatch } from 'react-redux'
6
7const GreetingContainer: React.FC = () => {
8const dispatch = useDispatch()
9const userName = useAppSelector(((state) => state.profile.firstName))
10const timePeriod = useAppSelector((state) => state.app.timePeriod)
11dispatch(setTimePeriod())
12return <Greeting userName={userName} timePeriod={timePeriod} />
13}
14
15export default GreetingContainer
16