mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-24 05:42:33 +03:00
added reblog setting support
This commit is contained in:
parent
1f83c5c1a7
commit
3addec09c5
@ -1,8 +1,8 @@
|
|||||||
import React, { forwardRef, useEffect, useImperativeHandle, useState } from 'react';
|
import React, { forwardRef, useEffect, useImperativeHandle, useState } from 'react';
|
||||||
import { useIntl } from 'react-intl';
|
import { useIntl } from 'react-intl';
|
||||||
import { ScrollView, View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
|
|
||||||
import { BeneficiaryModal, DateTimePicker, Modal, SettingsItem } from '../../../components';
|
import { DateTimePicker, Modal, SettingsItem } from '../../../components';
|
||||||
import styles from './editorSettingsModalStyles';
|
import styles from './editorSettingsModalStyles';
|
||||||
import ThumbSelectionContent from './thumbSelectionContent';
|
import ThumbSelectionContent from './thumbSelectionContent';
|
||||||
import {View as AnimatedView} from 'react-native-animatable';
|
import {View as AnimatedView} from 'react-native-animatable';
|
||||||
@ -35,19 +35,23 @@ export interface EditorSettingsModalRef {
|
|||||||
interface EditorSettingsModalProps {
|
interface EditorSettingsModalProps {
|
||||||
body:string;
|
body:string;
|
||||||
draftId:string;
|
draftId:string;
|
||||||
|
isCommunityPost:boolean;
|
||||||
handleRewardChange:(rewardType:string)=>void;
|
handleRewardChange:(rewardType:string)=>void;
|
||||||
handleThumbSelection:(index:number)=>void;
|
handleThumbSelection:(index:number)=>void;
|
||||||
handleScheduleChange:(datetime:string|null)=>void;
|
handleScheduleChange:(datetime:string|null)=>void;
|
||||||
handleBeneficiariesChange:(beneficiaries:Beneficiary[])=>void;
|
handleBeneficiariesChange:(beneficiaries:Beneficiary[])=>void;
|
||||||
|
handleShouldReblogChange:(shouldReblog:boolean)=>void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const EditorSettingsModal = forwardRef(({
|
const EditorSettingsModal = forwardRef(({
|
||||||
body,
|
body,
|
||||||
draftId,
|
draftId,
|
||||||
|
isCommunityPost,
|
||||||
handleRewardChange,
|
handleRewardChange,
|
||||||
handleThumbSelection,
|
handleThumbSelection,
|
||||||
handleScheduleChange,
|
handleScheduleChange,
|
||||||
handleBeneficiariesChange,
|
handleBeneficiariesChange,
|
||||||
|
handleShouldReblogChange,
|
||||||
}: EditorSettingsModalProps, ref) => {
|
}: EditorSettingsModalProps, ref) => {
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
|
|
||||||
@ -55,6 +59,7 @@ const EditorSettingsModal = forwardRef(({
|
|||||||
const [rewardTypeIndex, setRewardTypeIndex] = useState(0);
|
const [rewardTypeIndex, setRewardTypeIndex] = useState(0);
|
||||||
const [thumbIndex, setThumbIndex] = useState(0);
|
const [thumbIndex, setThumbIndex] = useState(0);
|
||||||
const [scheduleLater, setScheduleLater] = useState(false)
|
const [scheduleLater, setScheduleLater] = useState(false)
|
||||||
|
const [shouldReblog, setShouldReblog] = useState(false);
|
||||||
const [scheduledFor, setScheduledFor] = useState('');
|
const [scheduledFor, setScheduledFor] = useState('');
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -71,6 +76,10 @@ const EditorSettingsModal = forwardRef(({
|
|||||||
handleScheduleChange(scheduledFor)
|
handleScheduleChange(scheduledFor)
|
||||||
}
|
}
|
||||||
}, [scheduleLater, scheduledFor])
|
}, [scheduleLater, scheduledFor])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
handleShouldReblogChange(shouldReblog)
|
||||||
|
}, [shouldReblog])
|
||||||
|
|
||||||
|
|
||||||
useImperativeHandle(ref, () => ({
|
useImperativeHandle(ref, () => ({
|
||||||
@ -134,15 +143,19 @@ const EditorSettingsModal = forwardRef(({
|
|||||||
handleOnChange={_handleRewardChange}
|
handleOnChange={_handleRewardChange}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* <SettingsItem
|
|
||||||
|
{isCommunityPost && (
|
||||||
|
<SettingsItem
|
||||||
title={intl.formatMessage({
|
title={intl.formatMessage({
|
||||||
id: 'editor.setting_reblog',
|
id: 'editor.setting_reblog',
|
||||||
})}
|
})}
|
||||||
type="toggle"
|
type="toggle"
|
||||||
actionType="reblog"
|
actionType="reblog"
|
||||||
selectedOptionIndex={rewardTypeIndex}
|
isOn={shouldReblog}
|
||||||
handleOnChange={_handleRewardChange}
|
handleOnChange={setShouldReblog}
|
||||||
/> */}
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
|
||||||
<ThumbSelectionContent
|
<ThumbSelectionContent
|
||||||
body={body}
|
body={body}
|
||||||
|
@ -463,10 +463,12 @@ class EditorScreen extends Component {
|
|||||||
ref={(componentRef) => (this.editorSettingsModalRef = componentRef)}
|
ref={(componentRef) => (this.editorSettingsModalRef = componentRef)}
|
||||||
body={fields.body}
|
body={fields.body}
|
||||||
draftId={draftId}
|
draftId={draftId}
|
||||||
|
isCommunityPost={false}
|
||||||
handleThumbSelection={this._handleOnThumbSelection}
|
handleThumbSelection={this._handleOnThumbSelection}
|
||||||
handleRewardChange={handleRewardChange}
|
handleRewardChange={handleRewardChange}
|
||||||
handleScheduleChange={this._handleScheduleChange}
|
handleScheduleChange={this._handleScheduleChange}
|
||||||
handleBeneficiariesChange={handleBeneficiaries}
|
handleBeneficiariesChange={handleBeneficiaries}
|
||||||
|
handleShouldReblogChange={()=>{}}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user