mirror of
https://github.com/balzack/databag.git
synced 2025-02-14 20:49:16 +00:00
adding new topic button to drawer view
This commit is contained in:
parent
07aef2c952
commit
ec07246b5f
@ -310,7 +310,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
|
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 24;
|
CURRENT_PROJECT_VERSION = 26;
|
||||||
DEVELOPMENT_TEAM = 3P65PQ7SUR;
|
DEVELOPMENT_TEAM = 3P65PQ7SUR;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
@ -322,7 +322,7 @@
|
|||||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.productivity";
|
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.productivity";
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
|
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||||
MARKETING_VERSION = 1.0.1;
|
MARKETING_VERSION = 1.0;
|
||||||
OTHER_LDFLAGS = (
|
OTHER_LDFLAGS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"-ObjC",
|
"-ObjC",
|
||||||
@ -348,14 +348,14 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
|
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 24;
|
CURRENT_PROJECT_VERSION = 26;
|
||||||
DEVELOPMENT_TEAM = 3P65PQ7SUR;
|
DEVELOPMENT_TEAM = 3P65PQ7SUR;
|
||||||
INFOPLIST_FILE = Databag/Info.plist;
|
INFOPLIST_FILE = Databag/Info.plist;
|
||||||
INFOPLIST_KEY_CFBundleDisplayName = Databag;
|
INFOPLIST_KEY_CFBundleDisplayName = Databag;
|
||||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.productivity";
|
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.productivity";
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
|
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||||
MARKETING_VERSION = 1.0.1;
|
MARKETING_VERSION = 1.0;
|
||||||
OTHER_LDFLAGS = (
|
OTHER_LDFLAGS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"-ObjC",
|
"-ObjC",
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>25</string>
|
<string>26</string>
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>NSAppTransportSecurity</key>
|
<key>NSAppTransportSecurity</key>
|
||||||
|
@ -102,6 +102,22 @@ export function ChannelsBody({ state, actions, openConversation }) {
|
|||||||
|
|
||||||
export function Channels({ openConversation }) {
|
export function Channels({ openConversation }) {
|
||||||
const { state, actions } = useChannels();
|
const { state, actions } = useChannels();
|
||||||
|
|
||||||
|
const addTopic = async () => {
|
||||||
|
try {
|
||||||
|
const channel = await actions.addTopic();
|
||||||
|
actions.hideAdding();
|
||||||
|
openConversation(null, channel.id)
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.log(err);
|
||||||
|
Alert.alert(
|
||||||
|
'Failed to Create Topic',
|
||||||
|
'Please try again.'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<SafeAreaView edges={['left']} style={styles.searchbar}>
|
<SafeAreaView edges={['left']} style={styles.searchbar}>
|
||||||
@ -128,11 +144,50 @@ export function Channels({ openConversation }) {
|
|||||||
)}
|
)}
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
<SafeAreaView style={styles.bottomArea} edges={['left']}>
|
<SafeAreaView style={styles.bottomArea} edges={['left']}>
|
||||||
<TouchableOpacity style={styles.addbottom}>
|
<TouchableOpacity style={styles.addbottom} onPress={actions.showAdding}>
|
||||||
<Ionicons name={'message1'} size={16} color={Colors.white} />
|
<Ionicons name={'message1'} size={16} color={Colors.white} />
|
||||||
<Text style={styles.newtext}>New Topic</Text>
|
<Text style={styles.newtext}>New Topic</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
|
<Modal
|
||||||
|
animationType="fade"
|
||||||
|
transparent={true}
|
||||||
|
visible={state.adding}
|
||||||
|
supportedOrientations={['portrait', 'landscape']}
|
||||||
|
onRequestClose={actions.hideAdding}
|
||||||
|
>
|
||||||
|
<KeyboardAvoidingView behavior="height" style={styles.addWrapper}>
|
||||||
|
<View style={styles.addContainer}>
|
||||||
|
<Text style={styles.addHeader}>New Topic:</Text>
|
||||||
|
<View style={styles.inputField}>
|
||||||
|
<TextInput style={styles.input} value={state.addSubject} onChangeText={actions.setAddSubject}
|
||||||
|
autoCapitalize="words" placeholder="Subject (optional)" placeholderTextColor={Colors.grey} />
|
||||||
|
</View>
|
||||||
|
<Text style={styles.label}>Members:</Text>
|
||||||
|
{ state.connected.length == 0 && (
|
||||||
|
<View style={styles.emptyMembers}>
|
||||||
|
<Text style={styles.empty}>No Connected Contacts</Text>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
{ state.connected.length > 0 && (
|
||||||
|
<FlatList style={styles.addMembers}
|
||||||
|
data={state.connected}
|
||||||
|
renderItem={({ item }) => <AddMember members={state.addMembers} item={item}
|
||||||
|
setCard={actions.setAddMember} clearCard={actions.clearAddMember} />}
|
||||||
|
keyExtractor={item => item.cardId}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<View style={styles.addControls}>
|
||||||
|
<TouchableOpacity style={styles.cancel} onPress={actions.hideAdding}>
|
||||||
|
<Text>Cancel</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
<TouchableOpacity style={styles.save} onPress={addTopic}>
|
||||||
|
<Text style={styles.saveText}>Create</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</KeyboardAvoidingView>
|
||||||
|
</Modal>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user