refactor to use function
refactor class to use function the reason is that we can not do conditional rendering using class and redux, so we switch to function and handle it with state
refactor class to use function the reason is that we can not do conditional rendering using class and redux, so we switch to function and handle it with state