updated reply modal implementation in postDisplayModal

This commit is contained in:
Nouman Tahir 2022-07-18 17:44:57 +05:00
parent f5089d335a
commit 14467b2c9d

View File

@ -24,6 +24,8 @@ import styles from './postDisplayStyles';
import { OptionsModal } from '../../atoms';
import { QuickReplyModal } from '../..';
import getWindowDimensions from '../../../utils/getWindowDimensions';
import { useAppDispatch } from '../../../hooks';
import { showReplyModal } from '../../../redux/actions/uiAction';
const HEIGHT = getWindowDimensions().height;
const WIDTH = getWindowDimensions().width;
@ -47,6 +49,7 @@ const PostDisplayView = ({
reblogs,
activeVotesCount,
}) => {
const dispatch = useAppDispatch();
const insets = useSafeAreaInsets();
const [postHeight, setPostHeight] = useState(0);
@ -58,8 +61,6 @@ const PostDisplayView = ({
const [postBodyLoading, setPostBodyLoading] = useState(false);
const [tags, setTags] = useState([]);
const quickReplyModalRef = useRef(null);
// Component Life Cycles
useEffect(() => {
if (isLoggedIn && get(currentAccount, 'name') && !isNewPost) {
@ -210,7 +211,7 @@ const PostDisplayView = ({
// show quick reply modal
const _showQuickReplyModal = (post) => {
if (isLoggedIn) {
quickReplyModalRef.current.show(post);
dispatch(showReplyModal(post));
} else {
console.log('Not LoggedIn');
}
@ -283,7 +284,6 @@ const PostDisplayView = ({
cancelButtonIndex={1}
onPress={(index) => (index === 0 ? handleOnRemovePress(get(post, 'permlink')) : null)}
/>
<QuickReplyModal ref={quickReplyModalRef} fetchPost={fetchPost} />
</View>
);
};