mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-05-31 14:11:58 +05:30
Centralize all redux types into one place, add overrides for the connect, useSelector and useDispatch functions
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
import React, { ComponentType, useCallback, useRef, useState } from 'react';
|
||||
import { useSelector } from 'react-redux';
|
||||
|
||||
import { send as sendFeedback } from 'app/services/api/feedback';
|
||||
import { RootState } from 'app/reducers';
|
||||
import logger from 'app/services/logger';
|
||||
import { useReduxSelector } from 'app/functions';
|
||||
|
||||
import ContactFormPopup from './ContactFormPopup';
|
||||
import SuccessContactFormPopup from './SuccessContactFormPopup';
|
||||
@@ -13,7 +12,7 @@ interface Props {
|
||||
}
|
||||
|
||||
const ContactForm: ComponentType<Props> = ({ onClose }) => {
|
||||
const userEmail = useSelector((state: RootState) => state.user.email);
|
||||
const userEmail = useReduxSelector((state) => state.user.email);
|
||||
const usedEmailRef = useRef(userEmail); // Use ref to avoid unneeded redraw
|
||||
const [isSent, setIsSent] = useState<boolean>(false);
|
||||
const onSubmit = useCallback(
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import React from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import { connect } from 'app/functions';
|
||||
import { create as createPopup } from 'app/components/ui/popup/actions';
|
||||
import ContactForm from 'app/components/contact';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user