components#StyledButton TypeScript Examples

The following examples show how to use components#StyledButton. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Overview.tsx    From react-native-crypto-wallet-app with MIT License 6 votes vote down vote up
Overview = () => {
  const alert = useAlert();
  const checkIfNewUser = useCallback(async () => {
    try {
      const isNewUser = Boolean(await AsyncStorage.getItem('isNewUser'));
      if (isNewUser) {
        alert('You are a new user!');
      } else {
        alert('You are an existing user!');
      }
    } catch (error) {}
  }, [alert]);

  useEffect(() => {
    checkIfNewUser();
  }, [checkIfNewUser]);

  const handleSignOut = async () => {
    await auth().signOut();
  };

  return (
    <Background>
      <StyledButton variant="positive" label="Sign out" onPress={handleSignOut} />
    </Background>
  );
}