Skip to content

Commit 1ad4935

Browse files
committed
make text editable
1 parent 6630c86 commit 1ad4935

File tree

3 files changed

+20
-17
lines changed

3 files changed

+20
-17
lines changed

package.json

+6-13
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
{
2-
"name": "react",
2+
"name": "text-to-speech",
33
"version": "1.0.0",
4-
"description": "React example starter project",
5-
"keywords": [
6-
"react",
7-
"starter"
8-
],
4+
"description": "React text to speech example",
5+
"licence": "MIT",
6+
"keywords": ["react", "starter"],
97
"main": "src/index.js",
108
"dependencies": {
119
"react": "17.0.0",
@@ -22,10 +20,5 @@
2220
"test": "react-scripts test --env=jsdom",
2321
"eject": "react-scripts eject"
2422
},
25-
"browserslist": [
26-
">0.2%",
27-
"not dead",
28-
"not ie <= 11",
29-
"not op_mini all"
30-
]
31-
}
23+
"browserslist": [">0.2%", "not dead", "not ie <= 11", "not op_mini all"]
24+
}

src/App.js

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
1-
import React from "react";
1+
import React, { useState } from "react";
22
import Speech from "./speech";
33
import "./styles.css";
44

55
export default function App() {
6+
const [text, setText] = useState("Jónapot kívánok");
67
return (
78
<div className="App">
8-
<h1>Text to speech próba</h1>
9-
<Speech lang="hu-HU" text="Jónapot kívánok" pause resume />
9+
<h1>Szövegből beszéd</h1>
10+
<textarea
11+
onChange={({ target: { value } }) => setText(value)}
12+
style={{ width: "50%", minHeight: 100 }}
13+
value={text}
14+
/>
15+
<br />
16+
<br />
17+
<Speech lang="hu-HU" text={text} pause resume />
18+
<br />
19+
<br />
20+
<p style={{ fontSize: 11 }}>[email protected]</p>
1021
</div>
1122
);
1223
}

src/speech.js

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export default class Speech extends Component {
2020
}
2121

2222
componentDidMount() {
23-
console.log(style);
2423
this.setButtonState("all", "none", "none", "none");
2524
}
2625

0 commit comments

Comments
 (0)