| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- import React from 'react';
- import { StyleSheet, TouchableOpacity, View } from 'react-native';
- import TextView from './TextView';
- export default ToolbarUgly = ({
- title,
- scope,
- showBack=true,
- onBackPress
- }) => (
- <View style={styles.toolbarUgly}>
- { showBack &&
- <TouchableOpacity
- style={styles.uglyIcon}
- onPress={() => {
- if (onBackPress) {
- onBackPress();
- } else {
- goBack();
- }
- }}>
- <MaterialIcons
- name={'arrow-back-ios'}
- size={20}
- color={textPrimary} />
- </TouchableOpacity>
- }
- <TextView style={styles.titleText}>{scope ? $t(scope) : title}</TextView>
- { showBack &&
- <View style={styles.uglyIcon}>
- <MaterialIcons
- name={'arrow-back-ios'}
- size={16}
- color={'transparent'} />
- </View>
- }
- </View>
- )
- const styles = StyleSheet.create({
- toolbarUgly: {
- alignItems: 'center',
- flexDirection: 'row',
- backgroundColor: colorLight
- },
- uglyIcon: {
- height: 44,
- paddingLeft: 16,
- paddingRight: 16,
- alignItems: 'center',
- justifyContent: 'center'
- },
- titleText: {
- flex: 1,
- color: textPrimary,
- padding: 8,
- fontSize: 20,
- fontWeight: 'bold',
- textAlign: 'center',
- textTransform: 'uppercase'
- }
- })
|