/**
Copyright (c) 2021-present, Eaton
All rights reserved.
This code is licensed under the BSD-3 license found in the LICENSE file in the root directory of this source tree and at https://opensource.org/licenses/BSD-3-Clause.
**/
import React, { useCallback } from 'react';
import {
SafeAreaView,
ScrollView,
StyleSheet,
Linking,
TextStyle,
ViewStyle,
View,
Animated,
Easing,
Image,
} from 'react-native';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { Button, Divider, Text, Provider as ThemeProvider } from 'react-native-paper';
import { ExtendedTheme, useExtendedTheme, blue } from '@brightlayer-ui/react-native-themes';
import { Header } from '@brightlayer-ui/react-native-components';
const styles = (
theme: ExtendedTheme
): StyleSheet.NamedStyles<{
content: ViewStyle;
pxbLogoWrapper: ViewStyle;
pxbLogo: ViewStyle;
title: TextStyle;
subtitle: TextStyle;
bold: TextStyle;
divider: ViewStyle;
openURLButtonText: TextStyle;
}> =>
StyleSheet.create({
content: {
flex: 1,
},
pxbLogoWrapper: {
justifyContent: 'center',
marginTop: 16,
},
pxbLogo: {
alignSelf: 'center',
height: 100,
width: 100,
},
title: {
textAlign: 'center',
marginBottom: 16,
},
subtitle: {
textAlign: 'center',
},
bold: {
fontWeight: 'bold',
},
divider: {
marginVertical: 24,
},
openURLButtonText: {
color: theme.colors.primary,
padding: 8,
},
});
const OpenURLButton = (props: any): JSX.Element => {
const { url, title } = props;
const theme = useExtendedTheme();
const defaultStyles = styles(theme);
const handlePress = useCallback(async () => {
try {
await Linking.openURL(url);
} catch (error) {
console.error('Failed to open URL:', error);
}
}, [url]);
return (
);
};
const App = (): JSX.Element => {
const theme = useExtendedTheme();
const defaultStyles = styles(theme);
const spinValue = new Animated.Value(0);
Animated.loop(
Animated.timing(spinValue, {
toValue: 1,
duration: 2500,
easing: Easing.linear,
useNativeDriver: true,
})
).start();
const spin = spinValue.interpolate({
inputRange: [0, 1],
outputRange: ['0deg', '360deg'],
});
return (
Welcome to Brightlayer{' '}
UI
.
Edit{' '}
App.tsx
{' '}
and save to reload.
);
};
export default App;