* Added DrawerItem component * WIP Account Screen * Added react-native-paper * Added StatusLabel Component * Extracted i18n * TS fix DrawerItem component * WIP Account Screen * Added server name label under log out * Updated translation * WIP * Fixes the Offline text style * Added Metropolis fonts * WIP * Typo clean up * WIP * WIP * WIP * Added server display name * Writing OpenSans properly * WIP * WIP * Added OptionsModal * Opening OptionsModal * Added translation keys * Writes status to local db * Fix missing translation * Fix OptionModal not dismissing * Pushing status to server * Refactored * Added CustomStatusExpiry component * Added sub components * Added CustomLabel * CustomStatus WIP * Added Custom Status screen WIP * WIP - unsetCustomStatus and CustomStatus constant * WIP * WIP * WIP * WIP * WIP * WIP * WIP * Retrieving RecentCustomStatuses from Preferences table * WIP * WIP * WIP * Added Clear After Modal * WIP - Transations * WIP * Done with showing modal cst * wip * Clear After Modal - DONE * fix * Added missing API calls * wip * Causing screen refresh * wip * WIP * WIP * WIP * Code clean up * Added OOO alert box * Refactored Options-Item * Refactored OptionsModalList component * Opening 'status' in BottomSheet instead of OptionsModal * AddReaction screen - WIP * Add Reaction screen - WIP * Added EmojiPickerRow * Added @components/emoji_picker - WIP * Emoji Picker - WIP * WIP * WIP * WIP * SectionList - WIP * Installed react-native-section_list_get_item_layout * Adding API calls - WIP * WIP * Search Bar component - WIP * WIP * WIP * WIP * Rendering Emoticons now - have to tackle some fixmes * Code clean up * Code clean up - WIP * Code clean up * WIP * Major clean up * wip * WIP * Fix rendering issue with SectionIcons and SearchBar * Tackled the CustomEmojiPage * Code clean up * WIP * Done with loading User Profiles for Custom Emoji * Code clean up * Code Clean up * Fix screen Account * Added missing sql file for IOS Pod * Updated Podfile.lock * Using queryConfig instead of queryCommonSystemValues * Fix - Custom status * Fix - Custom Status - Error * Fix - Clear Pass Status - WIP * Fix - Custom Status Clear * Need to fix CST clear * WIP * Status clear - working * Using catchError operator * remove unnecessary prop * Status BottomSheet now has colored indicators * Added KeyboardTrackingView from 'react-native-keyboard-tracking-view' * Code clean up * WIP * code clean up * Added a safety check * Fix - Display suggestions * Code clean up based on PR Review * Code clean up * Code clean up * Code clean up * Corrections * Fix tsc * TS fix * Removed unnecessary prop * Fix SearchBar Ts * Updated tests * Delete search_bar.test.js.snap * Merge branch 'gekidou' into gekidou_account_screen * Revert "Merge branch 'gekidou' into gekidou_account_screen" This reverts commit 5defc313212478a55abf2f92cb4bd64dc7877342. * Fix fonts * Refactor home account screen * fix theme provider * refactor bottom sheet * remove paper provider * update drawer item snapshots * Remove options modal screen * remove react-native-ui-lib dependency * Refactor & fix custom status & navigation (including tablet) * Refactor emoji picker Co-authored-by: Avinash Lingaloo <> Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
125 lines
3.6 KiB
TypeScript
125 lines
3.6 KiB
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {Platform, StyleSheet, TextStyle, ViewStyle} from 'react-native';
|
|
|
|
export const getSearchBarStyle = (backgroundColor: string, cancelButtonStyle: ViewStyle | undefined, containerHeight: number, inputHeight: number, inputStyle: TextStyle | undefined, placeholderTextColor: string, searchBarRightMargin: number, tintColorDelete: string, tintColorSearch: string, titleCancelColor: string) => ({
|
|
cancelButtonText: {
|
|
...cancelButtonStyle,
|
|
color: titleCancelColor,
|
|
},
|
|
container: {
|
|
flexDirection: 'row',
|
|
justifyContent: 'flex-start',
|
|
alignItems: 'center',
|
|
height: containerHeight,
|
|
overflow: 'hidden',
|
|
},
|
|
clearIconColorIos: tintColorDelete || 'grey',
|
|
clearIconColorAndroid: titleCancelColor || placeholderTextColor,
|
|
inputStyle: {
|
|
...inputStyle,
|
|
backgroundColor: 'transparent',
|
|
height: inputHeight,
|
|
},
|
|
inputContainer: {
|
|
backgroundColor: inputStyle?.backgroundColor,
|
|
height: inputHeight,
|
|
},
|
|
searchBarWrapper: {
|
|
marginRight: searchBarRightMargin,
|
|
height: Platform.select({
|
|
ios: inputHeight || containerHeight - 10,
|
|
android: inputHeight,
|
|
}),
|
|
},
|
|
searchBarContainer: {
|
|
backgroundColor,
|
|
},
|
|
searchIcon: {
|
|
color: tintColorSearch || placeholderTextColor,
|
|
top: 8,
|
|
},
|
|
searchIconColor: tintColorSearch || placeholderTextColor,
|
|
});
|
|
|
|
export const getStyles = () => StyleSheet.create({
|
|
defaultColor: {
|
|
color: 'grey',
|
|
},
|
|
fullWidth: {
|
|
flex: 1,
|
|
},
|
|
inputContainer: {
|
|
borderRadius: Platform.select({
|
|
ios: 2,
|
|
android: 0,
|
|
}),
|
|
},
|
|
inputMargin: {
|
|
marginLeft: 4,
|
|
paddingTop: 0,
|
|
marginTop: Platform.select({
|
|
ios: 0,
|
|
android: 8,
|
|
}),
|
|
},
|
|
leftIcon: {
|
|
marginLeft: 4,
|
|
width: 30,
|
|
},
|
|
searchContainer: {
|
|
paddingTop: 0,
|
|
paddingBottom: 0,
|
|
},
|
|
text: {
|
|
fontSize: Platform.select({
|
|
ios: 14,
|
|
android: 15,
|
|
}),
|
|
color: '#fff',
|
|
},
|
|
leftComponent: {
|
|
position: 'relative',
|
|
marginLeft: 2,
|
|
},
|
|
});
|
|
|
|
export const getSearchStyles = (backgroundColor: string, cancelButtonStyle: ViewStyle | undefined, containerHeight: number, inputHeight: number, inputStyle: TextStyle | undefined, placeholderTextColor: string, searchBarRightMargin: number, tintColorDelete: string, tintColorSearch: string, titleCancelColor: string) => {
|
|
const searchBarStyle = getSearchBarStyle(backgroundColor, cancelButtonStyle, containerHeight, inputHeight, inputStyle, placeholderTextColor, searchBarRightMargin, tintColorDelete, tintColorSearch, titleCancelColor);
|
|
|
|
const styles = getStyles();
|
|
|
|
const inputTextStyle = {
|
|
...styles.text,
|
|
...styles.inputMargin,
|
|
...searchBarStyle.inputStyle,
|
|
};
|
|
|
|
const inputContainerStyle = {
|
|
...styles.inputContainer,
|
|
...searchBarStyle.inputContainer,
|
|
};
|
|
|
|
const containerStyle = {
|
|
...styles.searchContainer,
|
|
...styles.fullWidth,
|
|
...searchBarStyle.searchBarContainer,
|
|
};
|
|
|
|
const cancelButtonPropStyle = {
|
|
buttonTextStyle: {
|
|
...styles.text,
|
|
...searchBarStyle.cancelButtonText,
|
|
},
|
|
};
|
|
|
|
return {
|
|
cancelButtonPropStyle,
|
|
containerStyle,
|
|
inputContainerStyle,
|
|
inputTextStyle,
|
|
searchBarStyle,
|
|
styles,
|
|
};
|
|
};
|