Небольшой рефакторинг компонента Typo

parent fd6aa738
...@@ -44,10 +44,9 @@ export default class Typo extends Component { ...@@ -44,10 +44,9 @@ export default class Typo extends Component {
console.log(result); console.log(result);
let resultJson = await result.json(); let resultJson = await result.json();
const editUrl = resultJson.editUrl;
// Задаем ссылку // Задаем ссылку
element.href = editUrl; element.href = resultJson.editUrl;
return false; return false;
} }
...@@ -113,7 +112,7 @@ export default class Typo extends Component { ...@@ -113,7 +112,7 @@ export default class Typo extends Component {
render() { render() {
const typo = this.typo; const typo = this.typo;
const {acceptCallback, declineCallback, show} = this.props; const {show} = this.props;
const display = show ? "d-block" : "d-none"; const display = show ? "d-block" : "d-none";
const textColor = "text-white"; const textColor = "text-white";
...@@ -174,21 +173,11 @@ export default class Typo extends Component { ...@@ -174,21 +173,11 @@ export default class Typo extends Component {
); );
} }
/**
* Hides typo card
*/
// hideTypoCard() {
// $(`#typo-${this.typo.id}`).animate({
// marginLeft: "3000px",
// opacity: 0
// }, 500);
// }
applyCorrection = () => { applyCorrection = () => {
let success = this.acceptCallback(this.typo.correctedText); this.acceptCallback(this.typo.correctedText);
}; };
declineCorrection = () => { declineCorrection = () => {
let success = this.declineCallback(); this.declineCallback();
}; };
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment