@@ -20,6 +20,7 @@ export const CodePage = ({navigation}) => {
2020 const windowWidth = Dimensions . get ( 'window' ) . width ;
2121 const windowHeight = Dimensions . get ( 'window' ) . height ;
2222 const [ input , setInput ] = useState ( '' ) ;
23+ const [ input1 , setInput1 ] = useState ( '' ) ;
2324 const [ loading , setloading ] = useState ( false ) ;
2425 const [ code , setCode ] = useState ( '' ) ;
2526 const toast = useToast ( ) ;
@@ -28,7 +29,15 @@ export const CodePage = ({navigation}) => {
2829 toast . show ( 'Enter Statement' , {
2930 type : 'danger' ,
3031 placement : 'top' ,
31- duration : 4000 ,
32+ duration : 2000 ,
33+ offset : 30 ,
34+ animationType : 'zoom-in' ,
35+ } ) ;
36+ } else if ( input1 === '' ) {
37+ toast . show ( 'Enter Language' , {
38+ type : 'danger' ,
39+ placement : 'top' ,
40+ duration : 2000 ,
3241 offset : 30 ,
3342 animationType : 'zoom-in' ,
3443 } ) ;
@@ -45,7 +54,7 @@ export const CodePage = ({navigation}) => {
4554 prompt : {
4655 messages : [
4756 {
48- content : `generate Code for ${ input } ` ,
57+ content : `generate Code for ${ input } in ${ input1 } ` ,
4958 } ,
5059 ] ,
5160 } ,
@@ -110,6 +119,25 @@ export const CodePage = ({navigation}) => {
110119 borderBottomColor : '#100b2e' ,
111120 } }
112121 />
122+ < TextInput
123+ clearButtonMode = "while-editing"
124+ placeholder = { 'Language' }
125+ value = { input1 }
126+ onChangeText = { text => {
127+ setInput1 ( text ) ;
128+ } }
129+ placeholderTextColor = { 'rgb(197, 195, 195)' }
130+ style = { {
131+ maxHeight : windowHeight * 0.35 ,
132+ alignItems : 'flex-start' ,
133+ textAlignVertical : 'top' ,
134+ backgroundColor : '#292250' ,
135+ padding : 15 ,
136+ color : 'white' ,
137+ borderBottomWidth : 1 ,
138+ borderBottomColor : '#100b2e' ,
139+ } }
140+ />
113141 </ View >
114142 </ View >
115143 { ! loading && (
0 commit comments