Renamed methods to camelCase

This commit is contained in:
Welington da Silva Martins 2020-03-01 03:21:27 -03:00
parent 8f83d5055f
commit 3132c1c58d
2 changed files with 22 additions and 13 deletions

View File

@ -1,4 +1,8 @@
import { changeNavigationBarColor, HideNavigationBar, ShowNavigationBar } from './src';
import {
changeNavigationBarColor,
hideNavigationBar,
showNavigationBar,
} from './src';
export default changeNavigationBarColor;
export { HideNavigationBar, ShowNavigationBar };
export {hideNavigationBar, showNavigationBar};

View File

@ -1,25 +1,30 @@
import { NativeModules, Platform } from 'react-native';
import {NativeModules, Platform} from 'react-native';
const { NavigationBarColor } = NativeModules;
const {NavigationBarColor} = NativeModules;
const changeNavigationBarColor = (color = String, light = false, animated = true) => {
if(Platform.OS === 'android') {
const changeNavigationBarColor = (
color = String,
light = false,
animated = true,
) => {
if (Platform.OS === 'android') {
const LightNav = light ? true : false;
NavigationBarColor.changeNavigationBarColor(color, LightNav, animated);
}
};
const HideNavigationBar = () => {
if(Platform.OS === 'android') {
return NavigationBarColor.HideNavigationBar();
const hideNavigationBar = () => {
if (Platform.OS === 'android') {
return NavigationBarColor.hideNavigationBar();
} else {
return false;
}
};
const ShowNavigationBar = () => {
if(Platform.OS === 'android') {
NavigationBarColor.ShowNavigationBar();
const showNavigationBar = () => {
if (Platform.OS === 'android') {
NavigationBarColor.showNavigationBar();
} else {
return false;
}
};
export { changeNavigationBarColor, HideNavigationBar, ShowNavigationBar };
export {changeNavigationBarColor, hideNavigationBar, showNavigationBar};