mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-19 11:21:41 +03:00
updated reply modal implementation in postDisplayModal
This commit is contained in:
parent
f5089d335a
commit
14467b2c9d
@ -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>
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user