Skip to content

Commit

Permalink
[native] rename <Registration* components to <Auth* components
Browse files Browse the repository at this point in the history
Summary:
This is a follow-up to what I suggested in D14114 - to avoid confusion renaming to something more generic as now those components are also used outside of registration flow.

This diff is only rename, I am going to move them to a different directory in next diff to make review easy.

Depends on D14169

Test Plan: Flow

Reviewers: bartek, tomek

Reviewed By: bartek

Subscribers: ashoat

Differential Revision: https://phab.comm.dev/D14170
  • Loading branch information
xsanm committed Jan 9, 2025
1 parent 158fc4f commit 39d7f06
Show file tree
Hide file tree
Showing 24 changed files with 195 additions and 197 deletions.
18 changes: 9 additions & 9 deletions native/account/qr-auth/connect-secondary-device.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { Text } from 'react-native';

import { PrimaryDeviceQRAuthContext } from './primary-device-qr-auth-context.js';
import type { QRAuthNavigationProp } from './qr-auth-navigator.react.js';
import RegistrationButtonContainer from '../../account/registration/registration-button-container.react.js';
import RegistrationContainer from '../../account/registration/registration-container.react.js';
import RegistrationContentContainer from '../../account/registration/registration-content-container.react.js';
import AuthButtonContainer from '../../account/registration/registration-button-container.react.js';
import AuthContainer from '../../account/registration/registration-container.react.js';
import AuthContentContainer from '../../account/registration/registration-content-container.react.js';
import PrimaryButton from '../../components/primary-button.react.js';
import { type NavigationRoute } from '../../navigation/route-names.js';
import { useStyles } from '../../themes/colors.js';
Expand Down Expand Up @@ -42,21 +42,21 @@ function ConnectSecondaryDevice(props: Props): React.Node {
}, [data, onConnect]);

return (
<RegistrationContainer>
<RegistrationContentContainer>
<AuthContainer>
<AuthContentContainer>
<Text style={styles.header}>Connect with this device?</Text>
<Text style={styles.body}>
Are you sure you want to allow this device to log in to your account?
</Text>
</RegistrationContentContainer>
<RegistrationButtonContainer>
</AuthContentContainer>
<AuthButtonContainer>
<PrimaryButton
onPress={onPressConnect}
label="Connect"
variant={connectingInProgress ? 'loading' : 'enabled'}
/>
</RegistrationButtonContainer>
</RegistrationContainer>
</AuthButtonContainer>
</AuthContainer>
);
}

Expand Down
18 changes: 9 additions & 9 deletions native/account/qr-auth/qr-auth-not-primary-device.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import * as React from 'react';
import { Text } from 'react-native';

import { type QRAuthNavigationProp } from './qr-auth-navigator.react.js';
import RegistrationButtonContainer from '../../account/registration/registration-button-container.react.js';
import RegistrationContainer from '../../account/registration/registration-container.react.js';
import RegistrationContentContainer from '../../account/registration/registration-content-container.react.js';
import AuthButtonContainer from '../../account/registration/registration-button-container.react.js';
import AuthContainer from '../../account/registration/registration-container.react.js';
import AuthContentContainer from '../../account/registration/registration-content-container.react.js';
import PrimaryButton from '../../components/primary-button.react.js';
import type { RootNavigationProp } from '../../navigation/root-navigator.react.js';
import {
Expand Down Expand Up @@ -43,22 +43,22 @@ function QRAuthNotPrimaryDevice(prop: Props): React.Node {
}, [navigation]);

return (
<RegistrationContainer>
<RegistrationContentContainer>
<AuthContainer>
<AuthContentContainer>
<Text style={styles.header}>Device not primary</Text>
<Text style={styles.body}>
This mobile device is not your primary device, and cannot be used to
authorize new devices. Please try your other mobile device(s).
</Text>
</RegistrationContentContainer>
<RegistrationButtonContainer>
</AuthContentContainer>
<AuthButtonContainer>
<PrimaryButton
onPress={onPressGoBack}
label="Go back"
variant="enabled"
/>
</RegistrationButtonContainer>
</RegistrationContainer>
</AuthButtonContainer>
</AuthContainer>
);
}

Expand Down
18 changes: 9 additions & 9 deletions native/account/qr-auth/secondary-device-connected.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import * as React from 'react';
import { Text } from 'react-native';

import type { QRAuthNavigationProp } from './qr-auth-navigator.react.js';
import RegistrationButtonContainer from '../../account/registration/registration-button-container.react.js';
import RegistrationContainer from '../../account/registration/registration-container.react.js';
import RegistrationContentContainer from '../../account/registration/registration-content-container.react.js';
import AuthButtonContainer from '../../account/registration/registration-button-container.react.js';
import AuthContainer from '../../account/registration/registration-container.react.js';
import AuthContentContainer from '../../account/registration/registration-content-container.react.js';
import PrimaryButton from '../../components/primary-button.react.js';
import type { RootNavigationProp } from '../../navigation/root-navigator.react.js';
import {
Expand Down Expand Up @@ -43,17 +43,17 @@ function SecondaryDeviceConnected(prop: Props): React.Node {
}, [navigation]);

return (
<RegistrationContainer>
<RegistrationContentContainer>
<AuthContainer>
<AuthContentContainer>
<Text style={styles.header}>Device added</Text>
<Text style={styles.body}>
Your new device has been successfully registered!
</Text>
</RegistrationContentContainer>
<RegistrationButtonContainer>
</AuthContentContainer>
<AuthButtonContainer>
<PrimaryButton onPress={onPress} label="OK" variant="enabled" />
</RegistrationButtonContainer>
</RegistrationContainer>
</AuthButtonContainer>
</AuthContainer>
);
}

Expand Down
18 changes: 9 additions & 9 deletions native/account/qr-auth/secondary-device-not-responding.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import { getMessageForException } from 'lib/utils/errors.js';

import { PrimaryDeviceQRAuthContext } from './primary-device-qr-auth-context.js';
import type { QRAuthNavigationProp } from './qr-auth-navigator.react.js';
import RegistrationButtonContainer from '../../account/registration/registration-button-container.react.js';
import RegistrationContainer from '../../account/registration/registration-container.react.js';
import RegistrationContentContainer from '../../account/registration/registration-content-container.react.js';
import AuthButtonContainer from '../../account/registration/registration-button-container.react.js';
import AuthContainer from '../../account/registration/registration-container.react.js';
import AuthContentContainer from '../../account/registration/registration-content-container.react.js';
import PrimaryButton from '../../components/primary-button.react.js';
import type { RootNavigationProp } from '../../navigation/root-navigator.react.js';
import {
Expand Down Expand Up @@ -69,15 +69,15 @@ function SecondaryDeviceNotResponding(props: Props): React.Node {
const styles = useStyles(unboundStyles);

return (
<RegistrationContainer>
<RegistrationContentContainer>
<AuthContainer>
<AuthContentContainer>
<Text style={styles.header}>New device not responding</Text>
<Text style={styles.body}>
Has the new device successfully logged in? If not, we&apos;d suggest
removing it and trying again.
</Text>
</RegistrationContentContainer>
<RegistrationButtonContainer>
</AuthContentContainer>
<AuthButtonContainer>
<PrimaryButton
onPress={onPressRemove}
label="Remove"
Expand All @@ -88,8 +88,8 @@ function SecondaryDeviceNotResponding(props: Props): React.Node {
label="Ignore"
variant="enabled"
/>
</RegistrationButtonContainer>
</RegistrationContainer>
</AuthButtonContainer>
</AuthContainer>
);
}

Expand Down
18 changes: 9 additions & 9 deletions native/account/qr-code-screen.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { platformToIdentityDeviceType } from 'lib/types/identity-service-types.j
import { getConfig } from 'lib/utils/config.js';
import { usingRestoreFlow } from 'lib/utils/services-utils.js';

import RegistrationButtonContainer from './registration/registration-button-container.react.js';
import RegistrationContainer from './registration/registration-container.react.js';
import RegistrationContentContainer from './registration/registration-content-container.react.js';
import AuthButtonContainer from './registration/registration-button-container.react.js';
import AuthContainer from './registration/registration-container.react.js';
import AuthContentContainer from './registration/registration-content-container.react.js';
import type { SignInNavigationProp } from './sign-in-navigator.react.js';
import LinkButton from '../components/link-button.react.js';
import type { NavigationRoute } from '../navigation/route-names.js';
Expand Down Expand Up @@ -49,23 +49,23 @@ function QRCodeScreen(props: QRCodeScreenProps): React.Node {
}, [props.navigation]);
if (usingRestoreFlow) {
primaryRestoreButton = (
<RegistrationButtonContainer>
<AuthButtonContainer>
<View style={styles.primaryRestoreButton}>
<LinkButton
text="Not logged in on another phone?"
onPress={goToRestoreFlow}
/>
</View>
</RegistrationButtonContainer>
</AuthButtonContainer>
);
}

const { width } = useWindowDimensions();
const qrCodeSize = width * 0.7;

return (
<RegistrationContainer>
<RegistrationContentContainer>
<AuthContainer>
<AuthContentContainer>
<View style={styles.container}>
<Text style={styles.heading}>Log in to Comm</Text>
<Text style={styles.headingSubtext}>
Expand Down Expand Up @@ -93,9 +93,9 @@ function QRCodeScreen(props: QRCodeScreenProps): React.Node {
</Text>
</View>
</View>
</RegistrationContentContainer>
</AuthContentContainer>
{primaryRestoreButton}
</RegistrationContainer>
</AuthContainer>
);
}

Expand Down
18 changes: 9 additions & 9 deletions native/account/registration/account-does-not-exist.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import * as React from 'react';
import { Text, View, Image } from 'react-native';

import RegistrationButtonContainer from './registration-button-container.react.js';
import RegistrationContainer from './registration-container.react.js';
import RegistrationContentContainer from './registration-content-container.react.js';
import AuthButtonContainer from './registration-button-container.react.js';
import AuthContainer from './registration-container.react.js';
import AuthContentContainer from './registration-content-container.react.js';
import type { RegistrationNavigationProp } from './registration-navigator.react.js';
import PrimaryButton from '../../components/primary-button.react.js';
import commSwooshSource from '../../img/comm-swoosh.png';
Expand All @@ -27,8 +27,8 @@ function AccountDoesNotExist(props: Props): React.Node {

const styles = useStyles(unboundStyles);
return (
<RegistrationContainer>
<RegistrationContentContainer style={styles.scrollViewContentContainer}>
<AuthContainer>
<AuthContentContainer style={styles.scrollViewContentContainer}>
<Text style={styles.header}>New Comm account</Text>
<Text style={styles.body}>
It looks like this is your first time logging into Comm.
Expand All @@ -39,11 +39,11 @@ function AccountDoesNotExist(props: Props): React.Node {
<View style={styles.commSwooshContainer}>
<Image source={commSwooshSource} style={styles.commSwoosh} />
</View>
</RegistrationContentContainer>
<RegistrationButtonContainer>
</AuthContentContainer>
<AuthButtonContainer>
<PrimaryButton onPress={onSubmit} label="Next" variant="enabled" />
</RegistrationButtonContainer>
</RegistrationContainer>
</AuthButtonContainer>
</AuthContainer>
);
}

Expand Down
18 changes: 9 additions & 9 deletions native/account/registration/avatar-selection.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import {
type UserAvatarSelection,
} from 'lib/components/edit-user-avatar-provider.react.js';

import RegistrationButtonContainer from './registration-button-container.react.js';
import RegistrationContainer from './registration-container.react.js';
import RegistrationContentContainer from './registration-content-container.react.js';
import AuthButtonContainer from './registration-button-container.react.js';
import AuthContainer from './registration-container.react.js';
import AuthContentContainer from './registration-content-container.react.js';
import { RegistrationContext } from './registration-context.js';
import type { RegistrationNavigationProp } from './registration-navigator.react.js';
import {
Expand Down Expand Up @@ -174,8 +174,8 @@ function AvatarSelection(props: Props): React.Node {

const styles = useStyles(unboundStyles);
return (
<RegistrationContainer>
<RegistrationContentContainer style={styles.scrollViewContentContainer}>
<AuthContainer>
<AuthContentContainer style={styles.scrollViewContentContainer}>
<Text style={styles.header}>Pick an avatar</Text>
<View style={styles.stagedAvatarSection}>
<View style={styles.editUserAvatar}>
Expand All @@ -187,11 +187,11 @@ function AvatarSelection(props: Props): React.Node {
/>
</View>
</View>
</RegistrationContentContainer>
<RegistrationButtonContainer>
</AuthContentContainer>
<AuthButtonContainer>
<PrimaryButton onPress={onProceed} label="Next" />
</RegistrationButtonContainer>
</RegistrationContainer>
</AuthButtonContainer>
</AuthContainer>
);
}

Expand Down
18 changes: 9 additions & 9 deletions native/account/registration/connect-ethereum.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import {
useGetEthereumAccountFromSIWEResult,
siweNonceExpired,
} from './ethereum-utils.js';
import RegistrationButtonContainer from './registration-button-container.react.js';
import RegistrationContainer from './registration-container.react.js';
import RegistrationContentContainer from './registration-content-container.react.js';
import AuthButtonContainer from './registration-button-container.react.js';
import AuthContainer from './registration-container.react.js';
import AuthContentContainer from './registration-content-container.react.js';
import { RegistrationContext } from './registration-context.js';
import type { RegistrationNavigationProp } from './registration-navigator.react.js';
import type { CoolOrNerdMode } from './registration-types.js';
Expand Down Expand Up @@ -271,17 +271,17 @@ function ConnectEthereum(props: Props): React.Node {

return (
<>
<RegistrationContainer>
<RegistrationContentContainer style={styles.scrollViewContentContainer}>
<AuthContainer>
<AuthContentContainer style={styles.scrollViewContentContainer}>
<Text style={styles.header}>
Do you want to connect an Ethereum wallet?
</Text>
{body}
<View style={styles.ethereumLogoContainer}>
<EthereumLogoDark />
</View>
</RegistrationContentContainer>
<RegistrationButtonContainer>
</AuthContentContainer>
<AuthButtonContainer>
{alreadyConnectedButton}
<PrimaryButton
onPress={openPanel}
Expand All @@ -293,8 +293,8 @@ function ConnectEthereum(props: Props): React.Node {
label="Do not connect"
variant="outline"
/>
</RegistrationButtonContainer>
</RegistrationContainer>
</AuthButtonContainer>
</AuthContainer>
{siwePanel}
</>
);
Expand Down
18 changes: 9 additions & 9 deletions native/account/registration/connect-farcaster.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { useIsAppForegrounded } from 'lib/shared/lifecycle-utils.js';
import type { BaseFCAvatarInfo } from 'lib/utils/farcaster-helpers.js';

import { siweNonceExpired } from './ethereum-utils.js';
import RegistrationButtonContainer from './registration-button-container.react.js';
import RegistrationContainer from './registration-container.react.js';
import RegistrationContentContainer from './registration-content-container.react.js';
import AuthButtonContainer from './registration-button-container.react.js';
import AuthContainer from './registration-container.react.js';
import AuthContentContainer from './registration-content-container.react.js';
import { RegistrationContext } from './registration-context.js';
import type { RegistrationNavigationProp } from './registration-navigator.react.js';
import type { CoolOrNerdMode } from './registration-types.js';
Expand Down Expand Up @@ -231,12 +231,12 @@ function ConnectFarcaster(prop: Props): React.Node {

const connectFarcaster = React.useMemo(
() => (
<RegistrationContainer>
<RegistrationContentContainer style={styles.scrollViewContentContainer}>
<AuthContainer>
<AuthContentContainer style={styles.scrollViewContentContainer}>
<FarcasterPrompt textType="connect" />
</RegistrationContentContainer>
</AuthContentContainer>
<FarcasterWebView onSuccess={onSuccess} webViewState={webViewState} />
<RegistrationButtonContainer>
<AuthButtonContainer>
{alreadyConnectedButton}
<PrimaryButton
onPress={onPressConnectFarcaster}
Expand All @@ -248,8 +248,8 @@ function ConnectFarcaster(prop: Props): React.Node {
label="Do not connect"
variant="outline"
/>
</RegistrationButtonContainer>
</RegistrationContainer>
</AuthButtonContainer>
</AuthContainer>
),
[
alreadyConnectedButton,
Expand Down
Loading

0 comments on commit 39d7f06

Please sign in to comment.