@@ -8,18 +8,21 @@ export default function TextForm(props) {
8
8
console . log ( "upperCase was clicked" + text ) ;
9
9
let newText = text . toUpperCase ( ) ;
10
10
setText ( newText ) ;
11
+ props . showAlert ( "Converted to upperCase!" , "success" ) ;
11
12
}
12
13
13
14
const handleLoClick = ( ) => {
14
15
console . log ( "lowerCase was clicked" + text ) ;
15
16
let newText = text . toLowerCase ( ) ;
16
17
setText ( newText ) ;
18
+ props . showAlert ( "Converted to lowerCase!" , "success" ) ;
17
19
}
18
20
19
21
const handleClearClick = ( ) => {
20
22
console . log ( "clear the text" + text ) ;
21
23
let newText = "" ;
22
24
setText ( newText ) ;
25
+ props . showAlert ( "cleared the text!" , "success" ) ;
23
26
}
24
27
25
28
const handleReverseClick = ( ) => {
@@ -34,6 +37,7 @@ export default function TextForm(props) {
34
37
return output . join ( "" ) ;
35
38
} ;
36
39
setText ( newText ) ;
40
+ props . showAlert ( "Converted to reverse form!" , "success" ) ;
37
41
}
38
42
39
43
const handleCapitalizeClick = ( ) => {
@@ -48,6 +52,7 @@ export default function TextForm(props) {
48
52
return finalStr ;
49
53
}
50
54
setText ( newText ) ;
55
+ props . showAlert ( "Converted to captilize of each word!" , "success" ) ;
51
56
}
52
57
53
58
@@ -61,6 +66,7 @@ export default function TextForm(props) {
61
66
< div className = "container" style = { { color : props . mode === 'dark' ? 'white' : 'black' } } >
62
67
< h1 > { props . heading } </ h1 >
63
68
< div className = "mb-3" >
69
+ < label htmlFor = "exampleFormControlTextarea1" className = "form-label" > < h2 > Enter the text</ h2 > </ label >
64
70
< textarea className = "form-control" value = { text } onChange = { handleOnChange } style = { { backgroundColor : props . mode === 'dark' ? 'gray' : 'white' , color : props . mode === 'dark' ? 'white' : 'black' } } id = "myBox" rows = "8" > </ textarea >
65
71
</ div >
66
72
< button className = "btn btn-primary mx-2" onClick = { handleUpClick } > Convert to UpperCase</ button >
@@ -70,7 +76,7 @@ export default function TextForm(props) {
70
76
< button className = "btn btn-primary mx-2" onClick = { handleReverseClick } > reverse words</ button >
71
77
</ div >
72
78
< div className = "container my-4" style = { { color : props . mode === 'dark' ? 'white' : 'black' } } >
73
- < h1 > your text summary</ h1 >
79
+ < h2 > your text summary</ h2 >
74
80
< p > { text . split ( " " ) . length } words and { text . length } characters </ p >
75
81
< p > { 0.008 * text . split ( " " ) . length } Minutes read</ p >
76
82
< h2 > Preview</ h2 >
0 commit comments