Skip to content

Commit 99b265c

Browse files
committed
Fixed Test input
1 parent aefb30a commit 99b265c

File tree

4 files changed

+168
-69
lines changed

4 files changed

+168
-69
lines changed

Screens/CodePage.js

Lines changed: 58 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import ResultDiaplay from '../Components/Global/ReaultDiaplay';
1818

1919
export const CodePage = ({navigation}) => {
2020
const windowWidth = Dimensions.get('window').width;
21+
const windowHeight = Dimensions.get('window').height;
2122
const [input, setInput] = useState('');
2223
const [loading, setloading] = useState(false);
2324
const [code, setCode] = useState('');
@@ -54,11 +55,9 @@ export const CodePage = ({navigation}) => {
5455
.request(config)
5556
.then(r => {
5657
setCode(r.data.candidates[0].content);
57-
setInput('');
5858
setloading(false);
5959
})
6060
.catch(e => {
61-
setInput('');
6261
setloading(false);
6362
if (e.message === 'Network Error') {
6463
toast.show('No Internet 😟', {
@@ -90,13 +89,20 @@ export const CodePage = ({navigation}) => {
9089
overflow: 'hidden',
9190
}}>
9291
<TextInput
92+
clearButtonMode="while-editing"
93+
multiline={true}
94+
scrollEnabled={true}
95+
numberOfLines={6}
9396
placeholder={'Problem statement'}
9497
value={input}
9598
onChangeText={text => {
9699
setInput(text);
97100
}}
98101
placeholderTextColor={'rgb(197, 195, 195)'}
99102
style={{
103+
maxHeight: windowHeight * 0.35,
104+
alignItems: 'flex-start',
105+
textAlignVertical: 'top',
100106
backgroundColor: '#292250',
101107
padding: 15,
102108
color: 'white',
@@ -107,30 +113,60 @@ export const CodePage = ({navigation}) => {
107113
</View>
108114
</View>
109115
{!loading && (
110-
<TouchableOpacity
111-
onPress={() => {
112-
if (!loading) {
113-
GenerateCode();
114-
}
115-
}}
116+
<View
116117
style={{
117-
backgroundColor: '#4341c2',
118-
marginHorizontal: 20,
119-
alignItems: 'center',
120-
justifyContent: 'center',
121-
height: 50,
122-
borderBottomRightRadius: 10,
123-
borderBottomLeftRadius: 10,
118+
flexDirection: 'row',
119+
gap: 2,
124120
}}>
125-
<Text
121+
<TouchableOpacity
122+
onPress={() => {
123+
if (!loading) {
124+
setInput('');
125+
}
126+
}}
126127
style={{
127-
textAlign: 'center',
128-
fontSize: windowWidth * 0.035,
129-
color: 'rgb(236, 236, 236)',
128+
backgroundColor: '#4341c2',
129+
marginLeft: 20,
130+
alignItems: 'center',
131+
justifyContent: 'center',
132+
height: 50,
133+
flex: 1,
134+
borderBottomLeftRadius: 10,
130135
}}>
131-
Generate
132-
</Text>
133-
</TouchableOpacity>
136+
<Text
137+
style={{
138+
textAlign: 'center',
139+
fontSize: windowWidth * 0.032,
140+
color: 'rgb(236, 236, 236)',
141+
}}>
142+
Clear text
143+
</Text>
144+
</TouchableOpacity>
145+
<TouchableOpacity
146+
onPress={() => {
147+
if (!loading) {
148+
GenerateCode();
149+
}
150+
}}
151+
style={{
152+
backgroundColor: '#4341c2',
153+
marginRight: 20,
154+
alignItems: 'center',
155+
justifyContent: 'center',
156+
height: 50,
157+
flex: 1,
158+
borderBottomRightRadius: 10,
159+
}}>
160+
<Text
161+
style={{
162+
textAlign: 'center',
163+
fontSize: windowWidth * 0.032,
164+
color: 'rgb(236, 236, 236)',
165+
}}>
166+
Generate
167+
</Text>
168+
</TouchableOpacity>
169+
</View>
134170
)}
135171
{loading && (
136172
<View

Screens/EsseyPage.js

Lines changed: 55 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,9 @@ export const EsseyPage = ({navigation}) => {
5454
.request(config)
5555
.then(r => {
5656
setResult(r.data.candidates[0].content);
57-
setInput('');
5857
setloading(false);
5958
})
6059
.catch(e => {
61-
setInput('');
6260
setloading(false);
6361
if (e.message === 'Network Error') {
6462
toast.show('No Internet 😟', {
@@ -90,13 +88,18 @@ export const EsseyPage = ({navigation}) => {
9088
overflow: 'hidden',
9189
}}>
9290
<TextInput
91+
multiline={true}
92+
scrollEnabled={true}
93+
numberOfLines={3}
9394
placeholder={'Topic'}
9495
value={input}
9596
onChangeText={text => {
9697
setInput(text);
9798
}}
9899
placeholderTextColor={'rgb(197, 195, 195)'}
99100
style={{
101+
maxHeight: 120,
102+
textAlignVertical: 'top',
100103
backgroundColor: '#292250',
101104
padding: 15,
102105
color: 'white',
@@ -107,30 +110,60 @@ export const EsseyPage = ({navigation}) => {
107110
</View>
108111
</View>
109112
{!loading && (
110-
<TouchableOpacity
111-
onPress={() => {
112-
if (!loading) {
113-
GenerateCode();
114-
}
115-
}}
113+
<View
116114
style={{
117-
backgroundColor: '#4341c2',
118-
marginHorizontal: 20,
119-
alignItems: 'center',
120-
justifyContent: 'center',
121-
height: 50,
122-
borderBottomRightRadius: 10,
123-
borderBottomLeftRadius: 10,
115+
flexDirection: 'row',
116+
gap: 2,
124117
}}>
125-
<Text
118+
<TouchableOpacity
119+
onPress={() => {
120+
if (!loading) {
121+
setInput('');
122+
}
123+
}}
126124
style={{
127-
textAlign: 'center',
128-
fontSize: windowWidth * 0.035,
129-
color: 'rgb(236, 236, 236)',
125+
backgroundColor: '#4341c2',
126+
marginLeft: 20,
127+
alignItems: 'center',
128+
justifyContent: 'center',
129+
height: 50,
130+
flex: 1,
131+
borderBottomLeftRadius: 10,
130132
}}>
131-
Generate
132-
</Text>
133-
</TouchableOpacity>
133+
<Text
134+
style={{
135+
textAlign: 'center',
136+
fontSize: windowWidth * 0.032,
137+
color: 'rgb(236, 236, 236)',
138+
}}>
139+
Clear text
140+
</Text>
141+
</TouchableOpacity>
142+
<TouchableOpacity
143+
onPress={() => {
144+
if (!loading) {
145+
GenerateCode();
146+
}
147+
}}
148+
style={{
149+
backgroundColor: '#4341c2',
150+
marginRight: 20,
151+
alignItems: 'center',
152+
justifyContent: 'center',
153+
height: 50,
154+
flex: 1,
155+
borderBottomRightRadius: 10,
156+
}}>
157+
<Text
158+
style={{
159+
textAlign: 'center',
160+
fontSize: windowWidth * 0.032,
161+
color: 'rgb(236, 236, 236)',
162+
}}>
163+
Generate
164+
</Text>
165+
</TouchableOpacity>
166+
</View>
134167
)}
135168
{loading && (
136169
<View

Screens/MailPage.js

Lines changed: 52 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@ export const MailPage = ({navigation}) => {
7272
.request(config)
7373
.then(r => {
7474
setemail(r.data.candidates[0].content);
75-
setvalueName('');
76-
setvalueSubject('');
77-
setvalueTo('');
7875
setloading(false);
7976
})
8077
.catch(e => {
@@ -89,9 +86,6 @@ export const MailPage = ({navigation}) => {
8986
});
9087
return;
9188
}
92-
setvalueName('');
93-
setvalueSubject('');
94-
setvalueTo('');
9589
console.log(e.message);
9690
});
9791
}
@@ -169,28 +163,62 @@ export const MailPage = ({navigation}) => {
169163
/>
170164
</View>
171165
{!loading && (
172-
<TouchableOpacity
173-
onPress={() => {
174-
ComposeEmail();
175-
}}
166+
<View
176167
style={{
177-
backgroundColor: '#4341c2',
178-
marginHorizontal: 20,
179-
alignItems: 'center',
180-
justifyContent: 'center',
181-
height: 50,
182-
borderBottomRightRadius: 10,
183-
borderBottomLeftRadius: 10,
168+
flexDirection: 'row',
169+
gap: 2,
184170
}}>
185-
<Text
171+
<TouchableOpacity
172+
onPress={() => {
173+
if (!loading) {
174+
setvalueName('');
175+
setvalueSubject('');
176+
setvalueTo('');
177+
}
178+
}}
186179
style={{
187-
textAlign: 'center',
188-
fontSize: width * 0.036,
189-
color: 'white',
180+
backgroundColor: '#4341c2',
181+
marginLeft: 20,
182+
alignItems: 'center',
183+
justifyContent: 'center',
184+
height: 50,
185+
flex: 1,
186+
borderBottomLeftRadius: 10,
190187
}}>
191-
Compose
192-
</Text>
193-
</TouchableOpacity>
188+
<Text
189+
style={{
190+
textAlign: 'center',
191+
fontSize: width * 0.032,
192+
color: 'rgb(236, 236, 236)',
193+
}}>
194+
Clear text
195+
</Text>
196+
</TouchableOpacity>
197+
<TouchableOpacity
198+
onPress={() => {
199+
if (!loading) {
200+
ComposeEmail();
201+
}
202+
}}
203+
style={{
204+
backgroundColor: '#4341c2',
205+
marginRight: 20,
206+
alignItems: 'center',
207+
justifyContent: 'center',
208+
height: 50,
209+
flex: 1,
210+
borderBottomRightRadius: 10,
211+
}}>
212+
<Text
213+
style={{
214+
textAlign: 'center',
215+
fontSize: width * 0.032,
216+
color: 'rgb(236, 236, 236)',
217+
}}>
218+
Compose
219+
</Text>
220+
</TouchableOpacity>
221+
</View>
194222
)}
195223
{loading && (
196224
<View

Screens/Plagiarism.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import ResultDiaplay from '../Components/Global/ReaultDiaplay';
1818

1919
export const PlagiarismPage = ({navigation}) => {
2020
const windowWidth = Dimensions.get('window').width;
21+
const windowHeight = Dimensions.get('window').height;
2122
const [input, setInput] = useState('');
2223
const [loading, setloading] = useState(false);
2324
const [result, setResult] = useState('');
@@ -55,7 +56,6 @@ export const PlagiarismPage = ({navigation}) => {
5556
.request(config)
5657
.then(r => {
5758
setResult(r.data.candidates[0].content);
58-
setInput('');
5959
setloading(false);
6060
})
6161
.catch(e => {
@@ -92,6 +92,7 @@ export const PlagiarismPage = ({navigation}) => {
9292
<TextInput
9393
clearButtonMode="while-editing"
9494
multiline={true}
95+
scrollEnabled={true}
9596
numberOfLines={6}
9697
placeholder={'Paragraph...'}
9798
value={input}
@@ -104,6 +105,7 @@ export const PlagiarismPage = ({navigation}) => {
104105
alignItems: 'flex-start',
105106
textAlignVertical: 'top',
106107
padding: 15,
108+
maxHeight: windowHeight * 0.35,
107109
color: 'white',
108110
borderBottomWidth: 1,
109111
borderBottomColor: '#100b2e',

0 commit comments

Comments
 (0)