mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-23 21:35:04 +03:00
Merge pull request #2108 from ecency/nt/editor-modal-tweaks
Nt - Editor Tweaks
This commit is contained in:
commit
1018da6937
@ -335,7 +335,8 @@
|
||||
"scheduled_for":"Scheduled For",
|
||||
"scheduled_immediate":"Immediate",
|
||||
"scheduled_later":"Later",
|
||||
"settings_title":"Post Settings"
|
||||
"settings_title":"Post Options",
|
||||
"done":"DONE"
|
||||
},
|
||||
"snippets":{
|
||||
"label_no_snippets":"No Snippets Found",
|
||||
|
@ -14,10 +14,11 @@ import { TEMP_BENEFICIARIES_ID } from '../../../redux/constants/constants';
|
||||
import { removeBeneficiaries, setBeneficiaries as setBeneficiariesAction } from '../../../redux/actions/editorActions';
|
||||
|
||||
interface BeneficiarySelectionContent {
|
||||
draftId:string,
|
||||
draftId:string;
|
||||
setDisableDone:(value:boolean)=>void;
|
||||
}
|
||||
|
||||
const BeneficiarySelectionContent = ({ draftId }) => {
|
||||
const BeneficiarySelectionContent = ({ draftId, setDisableDone }) => {
|
||||
const intl = useIntl();
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
@ -38,6 +39,10 @@ const BeneficiarySelectionContent = ({ draftId }) => {
|
||||
readTempBeneficiaries();
|
||||
}, [draftId]);
|
||||
|
||||
useEffect(() => {
|
||||
setDisableDone(newEditable)
|
||||
}, [newEditable])
|
||||
|
||||
|
||||
const readTempBeneficiaries = async () => {
|
||||
if(beneficiariesMap){
|
||||
|
@ -2,12 +2,13 @@ import React, { forwardRef, useEffect, useImperativeHandle, useState } from 'rea
|
||||
import { useIntl } from 'react-intl';
|
||||
import { View } from 'react-native';
|
||||
|
||||
import { DateTimePicker, Modal, SettingsItem } from '../../../components';
|
||||
import { DateTimePicker, MainButton, Modal, SettingsItem } from '../../../components';
|
||||
import styles from './editorSettingsModalStyles';
|
||||
import ThumbSelectionContent from './thumbSelectionContent';
|
||||
import {View as AnimatedView} from 'react-native-animatable';
|
||||
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
|
||||
import BeneficiarySelectionContent from './beneficiarySelectionContent';
|
||||
import EStyleSheet from 'react-native-extended-stylesheet';
|
||||
|
||||
const REWARD_TYPES = [
|
||||
{
|
||||
@ -60,6 +61,7 @@ const EditorSettingsModal = forwardRef(({
|
||||
const [scheduleLater, setScheduleLater] = useState(false)
|
||||
const [shouldReblog, setShouldReblog] = useState(false);
|
||||
const [scheduledFor, setScheduledFor] = useState('');
|
||||
const [disableDone, setDisableDone] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if(handleThumbSelection){
|
||||
@ -106,8 +108,13 @@ const EditorSettingsModal = forwardRef(({
|
||||
setScheduledFor(date);
|
||||
}
|
||||
|
||||
const _onDonePress = () => {
|
||||
setShowModal(false);
|
||||
}
|
||||
|
||||
|
||||
const _renderContent = (
|
||||
<View style={{flex:1}}>
|
||||
<KeyboardAwareScrollView contentContainerStyle={{flex:1}} >
|
||||
<View style={styles.container}>
|
||||
{!isEdit && (
|
||||
@ -175,6 +182,7 @@ const EditorSettingsModal = forwardRef(({
|
||||
{!isEdit && (
|
||||
<BeneficiarySelectionContent
|
||||
draftId={draftId}
|
||||
setDisableDone={setDisableDone}
|
||||
/>
|
||||
)}
|
||||
|
||||
@ -182,6 +190,15 @@ const EditorSettingsModal = forwardRef(({
|
||||
</View>
|
||||
</KeyboardAwareScrollView>
|
||||
|
||||
<MainButton
|
||||
style={{...styles.saveButton, backgroundColor:EStyleSheet.value(disableDone?'$primaryDarkGray':'$primaryBlue') }}
|
||||
isDisable={disableDone}
|
||||
onPress={_onDonePress}
|
||||
text={intl.formatMessage({id:"editor.done"})}
|
||||
/>
|
||||
</View>
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
@ -65,13 +65,15 @@ export default EStyleSheet.create({
|
||||
color:'$pureWhite'
|
||||
} as TextStyle,
|
||||
saveButton:{
|
||||
|
||||
backgroundColor:'$primaryBlue',
|
||||
width:150,
|
||||
paddingVertical:16,
|
||||
borderRadius:32,
|
||||
marginVertical:16,
|
||||
marginRight:32,
|
||||
justifyContent:'center',
|
||||
alignItems:'center'
|
||||
alignItems:'center',
|
||||
alignSelf:'flex-end'
|
||||
} as ViewStyle,
|
||||
closeButton:{
|
||||
marginRight:16,
|
||||
|
Loading…
Reference in New Issue
Block a user