mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-19 03:11:38 +03:00
discarded modal presentation, updated bottom sliding back icons
This commit is contained in:
parent
1f83d1edd9
commit
65cef59c08
@ -9,7 +9,12 @@ import { setHidePostsThumbnails } from '../../../redux/actions/applicationAction
|
|||||||
// Components
|
// Components
|
||||||
import BasicHeaderView from '../view/basicHeaderView';
|
import BasicHeaderView from '../view/basicHeaderView';
|
||||||
|
|
||||||
const BasicHeaderContainer = (props) => {
|
|
||||||
|
interface BackHeaderProps {
|
||||||
|
backIconName:'close'|'arrow-back';
|
||||||
|
}
|
||||||
|
|
||||||
|
const BasicHeaderContainer = (props:BackHeaderProps) => {
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
const isHideImages = useAppSelector((state) => state.application.hidePostsThumbnails);
|
const isHideImages = useAppSelector((state) => state.application.hidePostsThumbnails);
|
||||||
|
|
@ -45,6 +45,7 @@ const BasicHeaderView = ({
|
|||||||
handleRewardChange,
|
handleRewardChange,
|
||||||
enableViewModeToggle,
|
enableViewModeToggle,
|
||||||
handleSettingsPress,
|
handleSettingsPress,
|
||||||
|
backIconName,
|
||||||
}) => {
|
}) => {
|
||||||
|
|
||||||
const [isInputVisible, setIsInputVisible] = useState(false);
|
const [isInputVisible, setIsInputVisible] = useState(false);
|
||||||
@ -112,7 +113,7 @@ const BasicHeaderView = ({
|
|||||||
<IconButton
|
<IconButton
|
||||||
iconStyle={[styles.backIcon, isModalHeader && styles.closeIcon]}
|
iconStyle={[styles.backIcon, isModalHeader && styles.closeIcon]}
|
||||||
iconType="MaterialIcons"
|
iconType="MaterialIcons"
|
||||||
name="arrow-back"
|
name={backIconName || 'arrow-back'}
|
||||||
onPress={() => (isModalHeader ? handleOnPressClose() : handleOnPressBackButton())}
|
onPress={() => (isModalHeader ? handleOnPressClose() : handleOnPressBackButton())}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
/>
|
/>
|
||||||
|
@ -36,11 +36,10 @@ import { DrawerNavigator } from './drawerNavigator';
|
|||||||
|
|
||||||
const Stack = createNativeStackNavigator();
|
const Stack = createNativeStackNavigator();
|
||||||
|
|
||||||
|
|
||||||
export const StackNavigator = () => {
|
export const StackNavigator = () => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack.Navigator screenOptions={{ headerShown: false}} >
|
<Stack.Navigator screenOptions={{ headerShown: false }} >
|
||||||
<Stack.Group screenOptions={{ animation: 'slide_from_right' }}>
|
<Stack.Group screenOptions={{ animation: 'slide_from_right' }}>
|
||||||
<Stack.Screen name={ROUTES.DRAWER.MAIN} component={DrawerNavigator} />
|
<Stack.Screen name={ROUTES.DRAWER.MAIN} component={DrawerNavigator} />
|
||||||
<Stack.Screen name={ROUTES.SCREENS.PROFILE} component={Profile} />
|
<Stack.Screen name={ROUTES.SCREENS.PROFILE} component={Profile} />
|
||||||
@ -61,21 +60,18 @@ export const StackNavigator = () => {
|
|||||||
<Stack.Screen name={ROUTES.SCREENS.COIN_DETAILS} component={CoinDetails} />
|
<Stack.Screen name={ROUTES.SCREENS.COIN_DETAILS} component={CoinDetails} />
|
||||||
<Stack.Screen name={ROUTES.SCREENS.EDIT_HISTORY} component={EditHistoryScreen} />
|
<Stack.Screen name={ROUTES.SCREENS.EDIT_HISTORY} component={EditHistoryScreen} />
|
||||||
<Stack.Screen name={ROUTES.SCREENS.POST} component={Post} />
|
<Stack.Screen name={ROUTES.SCREENS.POST} component={Post} />
|
||||||
|
|
||||||
</Stack.Group>
|
</Stack.Group>
|
||||||
<Stack.Group screenOptions={{ presentation: 'modal' }}>
|
<Stack.Group screenOptions={{ animation: 'slide_from_bottom' }}>
|
||||||
<Stack.Screen name={ROUTES.SCREENS.REBLOGS} component={Reblogs} />
|
<Stack.Screen name={ROUTES.SCREENS.REBLOGS} component={Reblogs} />
|
||||||
<Stack.Screen name={ROUTES.SCREENS.VOTERS} component={Voters} />
|
<Stack.Screen name={ROUTES.SCREENS.VOTERS} component={Voters} />
|
||||||
<Stack.Screen name={ROUTES.SCREENS.FOLLOWS} component={Follows} />
|
<Stack.Screen name={ROUTES.SCREENS.FOLLOWS} component={Follows} />
|
||||||
|
|
||||||
</Stack.Group>
|
|
||||||
<Stack.Group screenOptions={{ animation: 'slide_from_bottom' }}>
|
|
||||||
<Stack.Screen name={ROUTES.SCREENS.TRANSFER} component={Transfer} />
|
<Stack.Screen name={ROUTES.SCREENS.TRANSFER} component={Transfer} />
|
||||||
<Stack.Screen name={ROUTES.SCREENS.EDITOR} component={Editor} />
|
<Stack.Screen name={ROUTES.SCREENS.EDITOR} component={Editor} />
|
||||||
<Stack.Screen name={ROUTES.SCREENS.REGISTER} component={Register} />
|
<Stack.Screen name={ROUTES.SCREENS.REGISTER} component={Register} />
|
||||||
<Stack.Screen name={ROUTES.SCREENS.LOGIN} component={Login} />
|
<Stack.Screen name={ROUTES.SCREENS.LOGIN} component={Login} />
|
||||||
</Stack.Group>
|
</Stack.Group>
|
||||||
|
|
||||||
|
|
||||||
</Stack.Navigator>
|
</Stack.Navigator>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ import get from 'lodash/get';
|
|||||||
// Utilities
|
// Utilities
|
||||||
|
|
||||||
// Services and Actions
|
// Services and Actions
|
||||||
import { withNavigation } from '@react-navigation/compat';
|
|
||||||
import { getFollowers, getFollowing, getFollowSearch } from '../../../providers/hive/dhive';
|
import { getFollowers, getFollowing, getFollowSearch } from '../../../providers/hive/dhive';
|
||||||
// Component
|
// Component
|
||||||
import FollowsScreen from '../screen/followsScreen';
|
import FollowsScreen from '../screen/followsScreen';
|
||||||
|
@ -61,7 +61,12 @@ class FollowsScreen extends PureComponent {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<BasicHeader title={headerTitle} isHasSearch handleOnSearch={handleSearch} />
|
<BasicHeader
|
||||||
|
title={headerTitle}
|
||||||
|
isHasSearch
|
||||||
|
backIconName="close"
|
||||||
|
handleOnSearch={handleSearch}
|
||||||
|
/>
|
||||||
<FlatList
|
<FlatList
|
||||||
data={data}
|
data={data}
|
||||||
keyExtractor={(item, index) => index.toString()}
|
keyExtractor={(item, index) => index.toString()}
|
||||||
|
@ -39,6 +39,7 @@ const ReblogScreen = ({ navigation, route }) => {
|
|||||||
<SafeAreaView style={[globalStyles.container, { paddingBottom: 40 }]}>
|
<SafeAreaView style={[globalStyles.container, { paddingBottom: 40 }]}>
|
||||||
<BasicHeader
|
<BasicHeader
|
||||||
title={`${headerTitle} (${data && data.length})`}
|
title={`${headerTitle} (${data && data.length})`}
|
||||||
|
backIconName="close"
|
||||||
isHasSearch
|
isHasSearch
|
||||||
handleOnSearch={(text) => handleSearch(text, 'account')}
|
handleOnSearch={(text) => handleSearch(text, 'account')}
|
||||||
/>
|
/>
|
||||||
|
@ -27,7 +27,10 @@ const AddressView = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<BasicHeader title={intl.formatMessage({ id: `transfer.${transferType}` })} />
|
<BasicHeader
|
||||||
|
title={intl.formatMessage({ id: `transfer.${transferType}` })}
|
||||||
|
backIconName="close"
|
||||||
|
/>
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<ScrollView>
|
<ScrollView>
|
||||||
{accountType !== 'postingKey' &&
|
{accountType !== 'postingKey' &&
|
||||||
|
@ -575,7 +575,7 @@ class DelegateScreen extends Component {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<BasicHeader title={intl.formatMessage({ id: 'transfer.delegate' })} />
|
<BasicHeader title={intl.formatMessage({ id: 'transfer.delegate' })} backIconName="close" />
|
||||||
<KeyboardAvoidingView
|
<KeyboardAvoidingView
|
||||||
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
|
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
|
||||||
style={styles.fillSpace}
|
style={styles.fillSpace}
|
||||||
|
@ -464,7 +464,10 @@ class PowerDownView extends Component {
|
|||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<BasicHeader title={intl.formatMessage({ id: `transfer.${transferType}` })} />
|
<BasicHeader
|
||||||
|
title={intl.formatMessage({ id: `transfer.${transferType}` })}
|
||||||
|
backIconName="close"
|
||||||
|
/>
|
||||||
<KeyboardAvoidingView
|
<KeyboardAvoidingView
|
||||||
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
|
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
|
||||||
style={styles.powerDownKeyboadrAvoidingContainer}
|
style={styles.powerDownKeyboadrAvoidingContainer}
|
||||||
|
@ -128,7 +128,10 @@ const TransferView = ({
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<BasicHeader title={intl.formatMessage({ id: `transfer.${transferType}` })} />
|
<BasicHeader
|
||||||
|
title={intl.formatMessage({ id: `transfer.${transferType}` })}
|
||||||
|
backIconName="close"
|
||||||
|
/>
|
||||||
|
|
||||||
<KeyboardAwareScrollView
|
<KeyboardAwareScrollView
|
||||||
keyboardShouldPersistTaps
|
keyboardShouldPersistTaps
|
||||||
|
@ -15,12 +15,11 @@ import { getResizedAvatar } from '../../../utils/image';
|
|||||||
|
|
||||||
const filterOptions = ['rewards', 'percent', 'time'];
|
const filterOptions = ['rewards', 'percent', 'time'];
|
||||||
|
|
||||||
const VotersScreen = ({ route, navigation }) => {
|
const VotersScreen = ({ route }) => {
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
|
|
||||||
const [content, setContent] = useState(route.params?.content ?? null);
|
const [content] = useState(route.params?.content ?? null);
|
||||||
const [activeVotes, setActiveVotes] = useState(get(content, 'active_votes') || []);
|
const [activeVotes, setActiveVotes] = useState(get(content, 'active_votes') || []);
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
|
||||||
|
|
||||||
const headerTitle = intl.formatMessage({
|
const headerTitle = intl.formatMessage({
|
||||||
id: 'voters.voters_info',
|
id: 'voters.voters_info',
|
||||||
@ -54,6 +53,7 @@ const VotersScreen = ({ route, navigation }) => {
|
|||||||
{({ data, filterResult, filterIndex, handleOnVotersDropdownSelect, handleSearch }) => (
|
{({ data, filterResult, filterIndex, handleOnVotersDropdownSelect, handleSearch }) => (
|
||||||
<>
|
<>
|
||||||
<BasicHeader
|
<BasicHeader
|
||||||
|
backIconName="close"
|
||||||
title={`${headerTitle} (${data && data.length})`}
|
title={`${headerTitle} (${data && data.length})`}
|
||||||
isHasSearch
|
isHasSearch
|
||||||
handleOnSearch={(text) => handleSearch(text, 'voter')}
|
handleOnSearch={(text) => handleSearch(text, 'voter')}
|
||||||
|
Loading…
Reference in New Issue
Block a user