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

Commit

Permalink
after test on expo snack
Browse files Browse the repository at this point in the history
  • Loading branch information
dilan-dio4 committed Jun 5, 2021
1 parent a4fe1e5 commit 2488072
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion native-example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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#61756dc34c5bdf1a72a4f195bf2b21f2261c0011"
"resolved" "git+ssh://git@github.com/easybase/easybase-react.git#a4fe1e5d851802a6919eee4f626751cf76cbcdb2"
"version" "2.1.15"
dependencies:
"easybasejs" "4.2.13"
Expand Down
6 changes: 4 additions & 2 deletions src/ui/NativeAuth/NativeAuth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState, lazy, Suspense, Fragment, useEffect } from 'react';
import { ThemeProvider } from 'styled-components/native';
import { defaultDictionary } from '../utils';
import { INativeAuth } from '../uiTypes';
import { Toast } from './components';
import { Toast, Container } from './components';

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

Expand Down Expand Up @@ -72,7 +72,9 @@ export default function ({ customStyles, children, dictionary, signUpFields }: I
return (
<ThemeProvider theme={typeof customStyles === "object" ? customStyles : {}}>
<Toast toastMessage={toastMessage} toastOpen={toastOpen} setToastOpen={setToastOpen} />
{getCurrentPage()}
<Container behavior="padding" enabled>
{getCurrentPage()}
</Container>
</ThemeProvider>
)
}
Expand Down
17 changes: 7 additions & 10 deletions src/ui/NativeAuth/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,18 @@ export const MainView = styled(View)({
marginBottom: 60
});

export const FormContainer = styled.ScrollView((props: any) => ({
backgroundColor: '#fff',
export const Container = styled.KeyboardAvoidingView((props: any) => ({
flex: 1,
backgroundColor: '#fff',
...(props.theme.container ? { ...props.theme.container } : {})
}))

export const KBView = styled.KeyboardAvoidingView((props: any) => ({
export const FormRoot = styled.ScrollView((props: any) => ({
flex: 1,
justifyContent: 'space-between',
alignItems: 'center',
width: '100%',
...(props.theme.form ? { ...props.theme.form } : {})
}))

export const Form = (props: any) => <FormContainer
export const Form = (props: any) => <FormRoot
keyboardShouldPersistTaps="handled"
keyboardDismissMode="on-drag"
contentContainerStyle={{
Expand All @@ -39,10 +36,10 @@ export const Form = (props: any) => <FormContainer
alwaysBounceVertical={false}
showsVerticalScrollIndicator={false}
>
<KBView behavior="height">
<View style={{ flex: 1, justifyContent: 'space-between', alignItems: 'center', width: '100%' }}>
{props.children}
</KBView>
</FormContainer>
</View>
</FormRoot>

export const HeaderText = styled.Text((props: any) => ({
fontSize: 37,
Expand Down

0 comments on commit 2488072

Please sign in to comment.