Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Close SortDropdown on sort select #1224

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,11 @@ class CustomInsideStack extends React.Component {
render() {
const { navigation } = this.props;
return (
<React.Fragment>
<>
<InsideStackModal navigation={navigation} />
<NotificationBadge navigation={navigation} />
<Toast />
</React.Fragment>
</>
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/views/AuthLoadingView.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const styles = StyleSheet.create({
});

export default React.memo(() => (
<React.Fragment>
<>
<StatusBar />
{isAndroid ? <Image source={{ uri: 'launch_screen' }} style={styles.image} /> : null}
</React.Fragment>
</>
));
4 changes: 2 additions & 2 deletions app/views/AuthenticationWebView.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class AuthenticationWebView extends React.PureComponent {
const { loading } = this.state;
const uri = navigation.getParam('url');
return (
<React.Fragment>
<>
<StatusBar />
<WebView
useWebKit
Expand All @@ -120,7 +120,7 @@ class AuthenticationWebView extends React.PureComponent {
}}
/>
{ loading ? <ActivityIndicator size='large' style={styles.loading} /> : null }
</React.Fragment>
</>
);
}
}
Expand Down
8 changes: 4 additions & 4 deletions app/views/DirectoryView/Options.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default class DirectoryOptions extends PureComponent {
});
const { globalUsers, toggleWorkspace, isFederationEnabled } = this.props;
return (
<React.Fragment>
<>
<TouchableWithoutFeedback onPress={this.close}>
<Animated.View style={[styles.backdrop, { opacity: backdropOpacity }]} />
</TouchableWithoutFeedback>
Expand All @@ -103,7 +103,7 @@ export default class DirectoryOptions extends PureComponent {
{this.renderItem('users')}
{isFederationEnabled
? (
<React.Fragment>
<>
<View style={styles.dropdownSeparator} />
<View style={[styles.dropdownItemContainer, styles.globalUsersContainer]}>
<View style={styles.globalUsersTextContainer}>
Expand All @@ -112,11 +112,11 @@ export default class DirectoryOptions extends PureComponent {
</View>
<Switch value={globalUsers} onValueChange={toggleWorkspace} trackColor={SWITCH_TRACK_COLOR} />
</View>
</React.Fragment>
</>
)
: null}
</Animated.View>
</React.Fragment>
</>
);
}
}
4 changes: 2 additions & 2 deletions app/views/DirectoryView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class DirectoryView extends React.Component {
renderHeader = () => {
const { type } = this.state;
return (
<React.Fragment>
<>
<SearchBox
onChangeText={this.onSearchChangeText}
onSubmitEditing={this.search}
Expand All @@ -155,7 +155,7 @@ class DirectoryView extends React.Component {
<CustomIcon name='arrow-down' size={20} style={styles.toggleDropdownArrow} />
</View>
</Touch>
</React.Fragment>
</>
);
}

Expand Down
8 changes: 4 additions & 4 deletions app/views/RoomInfoView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,23 +253,23 @@ class RoomInfoView extends React.Component {
renderChannel = () => {
const { room } = this.state;
return (
<React.Fragment>
<>
{this.renderItem('description', room)}
{this.renderItem('topic', room)}
{this.renderItem('announcement', room)}
{room.broadcast ? this.renderBroadcast() : null}
</React.Fragment>
</>
);
}

renderDirect = () => {
const { roomUser } = this.state;
return (
<React.Fragment>
<>
{this.renderRoles()}
{this.renderTimezone()}
{this.renderCustomFields(roomUser._id)}
</React.Fragment>
</>
);
}

Expand Down
4 changes: 2 additions & 2 deletions app/views/RoomView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,13 +669,13 @@ class RoomView extends React.Component {

if (showUnreadSeparator || dateSeparator) {
return (
<React.Fragment>
<>
{message}
<Separator
ts={dateSeparator}
unread={showUnreadSeparator}
/>
</React.Fragment>
</>
);
}

Expand Down
4 changes: 2 additions & 2 deletions app/views/RoomsListView/ListHeader/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import Sort from './Sort';
const ListHeader = React.memo(({
searchLength, sortBy, onChangeSearchText, toggleSort, goDirectory
}) => (
<React.Fragment>
<>
<SearchBar onChangeSearchText={onChangeSearchText} />
<Directory goDirectory={goDirectory} />
<Sort searchLength={searchLength} sortBy={sortBy} toggleSort={toggleSort} />
</React.Fragment>
</>
));

ListHeader.propTypes = {
Expand Down
6 changes: 4 additions & 2 deletions app/views/RoomsListView/SortDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,12 @@ class Sort extends PureComponent {

sortByName = () => {
this.setSortPreference({ sortBy: 'alphabetical' });
this.close();
}

sortByActivity = () => {
this.setSortPreference({ sortBy: 'activity' });
this.close();
}

toggleGroupByType = () => {
Expand Down Expand Up @@ -112,7 +114,7 @@ class Sort extends PureComponent {
} = this.props;

return (
<React.Fragment>
<>
<TouchableWithoutFeedback key='sort-backdrop' onPress={this.close}>
<Animated.View style={[styles.backdrop, { opacity: backdropOpacity }]} />
</TouchableWithoutFeedback>
Expand Down Expand Up @@ -167,7 +169,7 @@ class Sort extends PureComponent {
</View>
</Touch>
</Animated.View>
</React.Fragment>
</>
);
}
}
Expand Down
16 changes: 8 additions & 8 deletions app/views/ShareListView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ class ShareListView extends React.Component {
const { server } = this.props;
const currentServer = servers.find(serverFiltered => serverFiltered.id === server);
return currentServer ? (
<React.Fragment>
<>
{this.renderSectionHeader('Select_Server')}
<View style={styles.bordered}>
<ServerItem
Expand All @@ -319,7 +319,7 @@ class ShareListView extends React.Component {
item={currentServer}
/>
</View>
</React.Fragment>
</>
) : null;
}

Expand All @@ -332,17 +332,17 @@ class ShareListView extends React.Component {
renderHeader = () => {
const { searching } = this.state;
return (
<React.Fragment>
<>
{ !searching
? (
<React.Fragment>
<>
{this.renderSelectServer()}
{this.renderSectionHeader('Chats')}
</React.Fragment>
</>
)
: null
}
</React.Fragment>
</>
);
}

Expand Down Expand Up @@ -393,9 +393,9 @@ class ShareListView extends React.Component {
<View style={styles.container}>
{ !searching
? (
<React.Fragment>
<>
{this.renderSelectServer()}
</React.Fragment>
</>
)
: null
}
Expand Down
4 changes: 2 additions & 2 deletions app/views/SidebarView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class Sidebar extends Component {
const { isAdmin } = this.state;
const { activeItemKey } = this.props;
return (
<React.Fragment>
<>
<SidebarItem
text={I18n.t('Chats')}
left={<CustomIcon name='message' size={20} color={COLOR_TEXT} />}
Expand Down Expand Up @@ -215,7 +215,7 @@ class Sidebar extends Component {
onPress={this.logout}
testID='sidebar-logout'
/>
</React.Fragment>
</>
);
}

Expand Down