Commit 7dacb22f authored by Deni Rinaldi's avatar Deni Rinaldi

isu category + minor

parent f1051d9d
...@@ -10,6 +10,7 @@ import BaseHeader from '../Components/BaseHeader'; ...@@ -10,6 +10,7 @@ import BaseHeader from '../Components/BaseHeader';
import { Images } from '../Themes'; import { Images } from '../Themes';
import Api from '../Services/Api'; import Api from '../Services/Api';
import BaseText from '../Components/BaseText'; import BaseText from '../Components/BaseText';
import { toTitleCase } from '../Lib/Utils';
class CategoryScreen extends Component { class CategoryScreen extends Component {
constructor(props) { constructor(props) {
...@@ -65,8 +66,8 @@ class CategoryScreen extends Component { ...@@ -65,8 +66,8 @@ class CategoryScreen extends Component {
style={{ backgroundColor: index % 2 == 0 ? '#b89469' : index % 3 == 0 ? '#7a7a7d' : '#636066', borderRadius: 16, height: 90, width: '100%', marginBottom: 15, marginTop: index == 0 ? 20 : 0, justifyContent: 'space-between', paddingHorizontal: 20, flexDirection: 'row' }} style={{ backgroundColor: index % 2 == 0 ? '#b89469' : index % 3 == 0 ? '#7a7a7d' : '#636066', borderRadius: 16, height: 90, width: '100%', marginBottom: 15, marginTop: index == 0 ? 20 : 0, justifyContent: 'space-between', paddingHorizontal: 20, flexDirection: 'row' }}
onPress={() => this.props.navigation.navigate('ListSearchScreen', { catID: item.cat_id })} onPress={() => this.props.navigation.navigate('ListSearchScreen', { catID: item.cat_id })}
> >
<BaseText type={"bold"} text={item.title} style={{ fontSize: 16, color: 'white', marginTop: 5, alignSelf: 'center' }} /> <BaseText type={"bold"} text={toTitleCase(item.title)} style={{ fontSize: 16, color: 'white', marginTop: 5, alignSelf: 'center' }} />
<View style={{}}> <View style={{ justifyContent: 'center'}}>
<Image source={{ uri: item.category_image }} style={{ height: 90, width: 90 }} /> <Image source={{ uri: item.category_image }} style={{ height: 90, width: 90 }} />
</View> </View>
</TouchableOpacity> </TouchableOpacity>
......
...@@ -13,7 +13,6 @@ import BaseButton from '../Components/BaseButton'; ...@@ -13,7 +13,6 @@ import BaseButton from '../Components/BaseButton';
import BaseText from '../Components/BaseText'; import BaseText from '../Components/BaseText';
import { formatRp } from '../Lib/Utils'; import { formatRp } from '../Lib/Utils';
import Constant from '../Lib/Constant'; import Constant from '../Lib/Constant';
import RadioForm, { RadioButton, RadioButtonInput, RadioButtonLabel } from 'react-native-simple-radio-button';
import Api from '../Services/Api'; import Api from '../Services/Api';
......
import R from 'ramda' import R, {isNil, isEmpty} from 'ramda'
export function validateEmail(email) { export function validateEmail(email) {
var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
...@@ -43,3 +43,11 @@ export function handlePhone(angka) { ...@@ -43,3 +43,11 @@ export function handlePhone(angka) {
let value = String(angka).replace(/\D+/g, ""); let value = String(angka).replace(/\D+/g, "");
return value return value
} }
export function toTitleCase(str) {
if (isNil(str) || isEmpty(str)) return '';
let newstr = str.split('_').join(" ");
return newstr.replace(/\w\S*/g, function (txt) {
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
});
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment