Skip to content
This repository was archived by the owner on May 12, 2022. It is now read-only.

Commit

Permalink
Updated layout
Browse files Browse the repository at this point in the history
  • Loading branch information
dilan-dio4 committed Jun 4, 2021
1 parent e8db09a commit 0231c71
Showing 6 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion native-example/yarn.lock
Original file line number Diff line number Diff line change
@@ -2897,7 +2897,7 @@
"version" "0.1.2"

"easybase-react@github:easybase/easybase-react#dev":
"resolved" "git+ssh://git@github.com/easybase/easybase-react.git#e65c4b5bd3b830199fd2b5a3638b7a88b3569ee8"
"resolved" "git+ssh://git@github.com/easybase/easybase-react.git#e8db09a22ce1f144b6fee0c3b4ddcc9aba5beafe"
"version" "2.1.15"
dependencies:
"easybasejs" "4.2.13"
2 changes: 1 addition & 1 deletion src/ui/NativeAuth/NativeAuth.tsx
Original file line number Diff line number Diff line change
@@ -72,7 +72,7 @@ export default function ({ customStyles, children, dictionary, signUpFields }: I
return (
<ThemeProvider theme={typeof customStyles === "object" ? customStyles : {}}>
<Toast toastMessage={toastMessage} toastOpen={toastOpen} setToastOpen={setToastOpen} />
<Container behavior="height" enabled keyboardVerticalOffset={50}>
<Container behavior="padding" enabled keyboardVerticalOffset={50}>
{getCurrentPage()}
</Container>
</ThemeProvider>
6 changes: 6 additions & 0 deletions src/ui/NativeAuth/components.tsx
Original file line number Diff line number Diff line change
@@ -5,6 +5,12 @@ export const View = styled.View({
width: "100%"
});

export const MainView = styled(View)({
width: "100%",
marginTop: 60,
marginBottom: 60
});

export const FormRoot = styled.ScrollView((props: any) => ({
backgroundColor: '#fff',
paddingTop: '20%',
6 changes: 3 additions & 3 deletions src/ui/NativeAuth/pages/ForgotPassword.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from 'react';
import { useForm, Controller } from 'react-hook-form';
import { INativePage } from '../../uiTypes';
import { Form, HeaderText, View, Input, SpacerXL, SubmitButton, SpacerS, SecondaryButton, ErrorText, SecondaryText } from '../components';
import { Form, HeaderText, View, Input, SpacerXL, SubmitButton, SpacerS, SecondaryButton, ErrorText, SecondaryText, MainView } from '../components';

const { useEasybase } = require('easybase-react');

@@ -91,7 +91,7 @@ export default function ({ setCurrentPage, dictionary, toast }: INativePage) {
<Form>
<HeaderText>{dictionary.forgotPasswordHeader}</HeaderText>

<View>
<MainView>
<SecondaryText>{dictionary.forgotPasswordSecondaryHeader}</SecondaryText>
<SpacerXL />
<Controller
@@ -112,7 +112,7 @@ export default function ({ setCurrentPage, dictionary, toast }: INativePage) {
name="email"
defaultValue=""
/>
</View>
</MainView>

<View>
<SubmitButton onPress={handleSubmit(onSubmit)} disabled={isSubmitting} title={dictionary.forgotPasswordSubmitButton} />
6 changes: 3 additions & 3 deletions src/ui/NativeAuth/pages/SignIn.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { useForm, Controller } from 'react-hook-form';
import { INativePage } from '../../uiTypes';
import { Form, HeaderText, View, Input, SubmitButton, SecondaryButton, ForgotPassword, SpacerS, SpacerXL } from '../components';
import { Form, HeaderText, View, Input, SubmitButton, SecondaryButton, ForgotPassword, SpacerS, SpacerXL, MainView } from '../components';

const { useEasybase } = require('easybase-react');

@@ -30,7 +30,7 @@ export default function ({ setCurrentPage, dictionary, toast }: INativePage) {
<Form>
<HeaderText>{dictionary.signInHeader}</HeaderText>

<View>
<MainView>
<Controller
control={control}
render={({ field: { onChange, onBlur, value } }) => (
@@ -69,7 +69,7 @@ export default function ({ setCurrentPage, dictionary, toast }: INativePage) {
defaultValue=""
/>
<ForgotPassword onPress={(_: any) => setCurrentPage("ForgotPassword")} disabled={isSubmitting} title={dictionary.forgotPasswordButton!} />
</View>
</MainView>

<View>
<SubmitButton onPress={handleSubmit(onSubmit)} disabled={isSubmitting} title={dictionary.signInSubmitButton} />
6 changes: 3 additions & 3 deletions src/ui/NativeAuth/pages/SignUp.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Fragment } from 'react';
import { useForm, Controller } from 'react-hook-form';
import { INativePage, ISignUpFields } from '../../uiTypes';
import { Form, HeaderText, View, Input, SpacerXL, SubmitButton, SpacerS, SecondaryButton, ErrorText, Picker } from '../components';
import { Form, HeaderText, View, Input, SpacerXL, SubmitButton, SpacerS, SecondaryButton, ErrorText, Picker, MainView } from '../components';

const { useEasybase } = require('easybase-react');

@@ -71,7 +71,7 @@ export default function ({ setCurrentPage, dictionary, signUpFields, toast }: IS
<Form>
<HeaderText>{dictionary.signUpHeader}</HeaderText>

<View>
<MainView>
<Controller
control={control}
render={({ field: { onChange, onBlur, value } }) => (
@@ -254,7 +254,7 @@ export default function ({ setCurrentPage, dictionary, signUpFields, toast }: IS
rules={passwordReqs}
/>
<ErrorText value={errors.passwordConfirm?.message} />
</View>
</MainView>

<View>
<SubmitButton onPress={handleSubmit(onSubmit)} disabled={isSubmitting} title={dictionary.signUpSubmitButton} />

0 comments on commit 0231c71

Please sign in to comment.