@@ -10,7 +10,7 @@ import {
1010 Box ,
1111 LinkBox ,
1212 icons ,
13- DropdownInput ,
13+ DropdownInput
1414} from '..' ;
1515import { handleUpdateNumericInput } from '../../../utils/input' ;
1616import { iconColors } from '../../../constants/icons' ;
@@ -118,8 +118,9 @@ export const CopyField = (
118118 labelColor : any ;
119119 placeholder : any ;
120120 value : string ;
121+ showTokField : any ;
121122 } & any ,
122- ) : JSX . Element => {
123+ ) : any => {
123124 const [ copied , setCopied ] = useState ( false ) ;
124125 const handleClick = ( ) => {
125126 navigator . clipboard . writeText ( props . value ) ;
@@ -130,26 +131,38 @@ export const CopyField = (
130131 } ;
131132
132133 return (
133- < FlexBox . Column fullWidth style = { { height : '100px' } } >
134+ < FlexBox . Column fullWidth >
134135 < FlexBox alignItems = "center" fullWidth style = { { position : 'relative' } } >
135136 < InputWithLabel
136137 name = { props . name }
137138 label = { props . label }
138139 labelColor = { props . labelColor }
139140 InputComponent = {
140- < TextInput
141- { ...props }
142- value = { `${ props . value . slice ( 0 , 60 ) } ...` }
143- placeholder = { props . placeholder }
144- />
145- }
141+ props . showTokField ?
142+ < TextInput
143+ { ...props }
144+ style = { { background : 'rgba(168, 168, 168, 0.2)' , border : '1px solid #C9CBD0' } }
145+ value = { `${ props . value . slice ( 0 , 30 ) } ...` }
146+ placeholder = { props . placeholder }
147+ />
148+ :
149+ < TextInput
150+ { ...props }
151+ style = { { background : 'rgba(168, 168, 168, 0.2)' , border : '1px solid #C9CBD0' } }
152+ value = 'Token'
153+ placeholder = { props . placeholder }
154+ />
155+ }
146156 />
147- < LinkBox
148- style = { { position : 'absolute' , right : '10px' , top : '30px' } }
149- onClick = { handleClick }
150- >
151- < icons . copy color = { iconColors . grey } />
152- </ LinkBox >
157+
158+ { props . showTokField && (
159+ < LinkBox
160+ style = { { position : 'absolute' , right : '10px' , top : '40px' } }
161+ onClick = { handleClick }
162+ >
163+ < icons . copy color = { iconColors . grey } />
164+ </ LinkBox >
165+ ) }
153166 </ FlexBox >
154167 { copied && (
155168 < div style = { { marginTop : '20px' , textAlign : 'right' } } >
@@ -169,6 +182,70 @@ export const CopyField = (
169182 ) ;
170183} ;
171184
185+
186+ export const GenerateTokenField = (
187+ props : {
188+ label : string ;
189+ labelColor : any ;
190+ placeholder : any ;
191+ value : string ;
192+ handleClick : any ;
193+ loading : boolean ;
194+ hideButton : boolean ;
195+ } & any ,
196+ ) : any => {
197+ return (
198+ < FlexBox . Column fullWidth >
199+ < FlexBox alignItems = "center" fullWidth style = { { position : 'relative' } } >
200+ < InputWithLabel
201+ optional = { props . required }
202+ name = { props . name }
203+ label = { props . label }
204+ labelColor = { props . labelColor }
205+ InputComponent = {
206+ < TextInput
207+ { ...props }
208+ style = { props . style }
209+ placeholder = { props . placeholder }
210+ hasError = { props . error ?. hasError }
211+ value = { props . value }
212+ onChangeText = { props . onChange }
213+ />
214+ }
215+ />
216+ { ! props . hideButton && (
217+ < Box
218+ style = { {
219+ position : 'absolute' ,
220+ right : '0' ,
221+ top : '38px' ,
222+ display : 'flex' ,
223+ justifyContent : 'center' ,
224+ textAlign : 'center' ,
225+ } } >
226+ < Box style = { { width : '120px' , borderLeft : '1px solid #C9CBD0' } } >
227+ < div style = { {
228+ fontFamily : 'Rubik' ,
229+ fontSize : '16px' ,
230+ color : '#443E99' ,
231+ marginTop : '3px' ,
232+ cursor : 'pointer'
233+ } }
234+ onClick = { props . handleClick }
235+ >
236+ { props . loading ? < > Submitting...</ > : < > Generate</ > }
237+ </ div >
238+ </ Box >
239+ </ Box >
240+ ) }
241+ </ FlexBox >
242+ </ FlexBox . Column >
243+ ) ;
244+ } ;
245+
246+
247+
248+
172249export const EditField = (
173250 props : {
174251 label : string ;
0 commit comments