mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-19 19:31:54 +03:00
converting add button to floating style
This commit is contained in:
parent
5744922f45
commit
b843fc2032
@ -116,25 +116,24 @@ const SnippetsModal = ({ username, handleOnSelect }:SnippetsModalProps) => {
|
||||
|
||||
|
||||
|
||||
|
||||
//renders footer with add snipept button and shows new snippet modal
|
||||
const _renderListFooter = () => {
|
||||
const _renderFloatingButton = () => {
|
||||
const _onPress = () => {
|
||||
if(editorRef.current){
|
||||
editorRef.current.showNewModal();
|
||||
}
|
||||
}
|
||||
return (
|
||||
<>
|
||||
<View style={styles.floatingContainer}>
|
||||
<MainButton
|
||||
style={{ width: 150, marginTop:16, }}
|
||||
style={{ width: 150}}
|
||||
onPress={_onPress}
|
||||
iconName="plus"
|
||||
iconType="MaterialCommunityIcons"
|
||||
iconColor="white"
|
||||
text={intl.formatMessage({id:'snippets.btn_add'})}
|
||||
/>
|
||||
</>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
@ -148,7 +147,6 @@ const SnippetsModal = ({ username, handleOnSelect }:SnippetsModalProps) => {
|
||||
keyExtractor={(item, index) => index.toString()}
|
||||
renderItem={_renderItem}
|
||||
ListEmptyComponent={_renderEmptyContent}
|
||||
ListFooterComponent={_renderListFooter}
|
||||
refreshControl={
|
||||
<RefreshControl
|
||||
refreshing={isLoading}
|
||||
@ -156,6 +154,8 @@ const SnippetsModal = ({ username, handleOnSelect }:SnippetsModalProps) => {
|
||||
/>
|
||||
}
|
||||
/>
|
||||
{_renderFloatingButton()}
|
||||
|
||||
</View>
|
||||
|
||||
<SnippetEditorModal
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { ViewStyle } from 'react-native';
|
||||
import EStyleSheet from 'react-native-extended-stylesheet';
|
||||
|
||||
export default EStyleSheet.create({
|
||||
@ -10,6 +11,13 @@ export default EStyleSheet.create({
|
||||
flex: 3,
|
||||
paddingHorizontal:16
|
||||
},
|
||||
floatingContainer:{
|
||||
position:'absolute',
|
||||
bottom:0,
|
||||
right:20,
|
||||
justifyContent:'flex-end',
|
||||
zIndex:10
|
||||
} as ViewStyle,
|
||||
itemWrapper: {
|
||||
paddingHorizontal: 16,
|
||||
paddingVertical:8,
|
||||
@ -40,4 +48,5 @@ export default EStyleSheet.create({
|
||||
paddingBottom:8,
|
||||
color:'$primaryBlack'
|
||||
},
|
||||
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user