Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions src/account/AccountPickScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { AppNavigationProp } from '../nav/AppNavigator';
import * as NavigationService from '../nav/NavigationService';
import { useSelector, useDispatch } from '../react-redux';
import { getAccountStatuses } from '../selectors';
import { Centerer, ZulipButton, Logo, Screen, ViewPlaceholder } from '../common';
import { ZulipButton, Logo, Screen, ViewPlaceholder } from '../common';
import AccountList from './AccountList';
import {
navigateToRealmInputScreen,
Expand Down Expand Up @@ -84,21 +84,19 @@ export default function AccountPickScreen(props: Props) {
canGoBack={navigation.canGoBack()}
shouldShowLoadingBanner={false}
>
<Centerer>
{accounts.length === 0 && <Logo />}
<AccountList
accounts={accounts}
onAccountSelect={handleAccountSelect}
onAccountRemove={handleAccountRemove}
/>
<ViewPlaceholder height={16} />
<ZulipButton
text="Add new account"
onPress={() => {
NavigationService.dispatch(navigateToRealmInputScreen());
}}
/>
</Centerer>
{accounts.length === 0 && <Logo />}
<AccountList
accounts={accounts}
onAccountSelect={handleAccountSelect}
onAccountRemove={handleAccountRemove}
/>
<ViewPlaceholder height={16} />
<ZulipButton
text="Add new account"
onPress={() => {
NavigationService.dispatch(navigateToRealmInputScreen());
}}
/>
</Screen>
);
}
50 changes: 0 additions & 50 deletions src/common/Centerer.js

This file was deleted.

1 change: 0 additions & 1 deletion src/common/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* @flow strict-local */
export { default as UserAvatarWithPresence } from './UserAvatarWithPresence';
export { default as Centerer } from './Centerer';
export { default as ComponentList } from './ComponentList';
export { default as ComponentWithOverlay } from './ComponentWithOverlay';
export { default as CountOverlay } from './CountOverlay';
Expand Down
60 changes: 29 additions & 31 deletions src/start/AuthScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
import type { SpecificIconType } from '../common/Icons';
import { connect } from '../react-redux';
import styles from '../styles';
import { Centerer, Screen, ZulipButton } from '../common';
import { Screen, ZulipButton } from '../common';
import RealmInfo from './RealmInfo';
import { encodeParamsForUrl } from '../utils/url';
import * as webAuth from './webAuth';
Expand Down Expand Up @@ -316,36 +316,34 @@ class AuthScreen extends PureComponent<Props> {

return (
<Screen title="Log in" centerContent padding shouldShowLoadingBanner={false}>
<Centerer>
<RealmInfo
name={serverSettings.realm_name}
iconUrl={new URL(serverSettings.realm_icon, this.props.realm).toString()}
/>
{activeAuthentications(
serverSettings.authentication_methods,
serverSettings.external_authentication_methods,
).map(auth =>
auth.name === 'apple' && Platform.OS === 'ios' ? (
<IosCompliantAppleAuthButton
key={auth.name}
style={styles.halfMarginTop}
onPress={() => this.handleAuth(auth)}
/>
) : (
<ZulipButton
key={auth.name}
style={styles.halfMarginTop}
secondary
text={{
text: 'Sign in with {method}',
values: { method: auth.displayName },
}}
Icon={auth.Icon}
onPress={() => this.handleAuth(auth)}
/>
),
)}
</Centerer>
<RealmInfo
name={serverSettings.realm_name}
iconUrl={new URL(serverSettings.realm_icon, this.props.realm).toString()}
/>
{activeAuthentications(
serverSettings.authentication_methods,
serverSettings.external_authentication_methods,
).map(auth =>
auth.name === 'apple' && Platform.OS === 'ios' ? (
<IosCompliantAppleAuthButton
key={auth.name}
style={styles.halfMarginTop}
onPress={() => this.handleAuth(auth)}
/>
) : (
<ZulipButton
key={auth.name}
style={styles.halfMarginTop}
secondary
text={{
text: 'Sign in with {method}',
values: { method: auth.displayName },
}}
Icon={auth.Icon}
onPress={() => this.handleAuth(auth)}
/>
),
)}
</Screen>
);
}
Expand Down