import React from "react";
import ReactDOM from "react-dom";
import MainPage from "..//../pages/main";
import "./style.css";
class FullCard extends React.Component {
ui = {
name: "Имя",
category: "Категория:",
versions: "Доступные версии",
uses: " USE:",
decription: "Описание:",
site: "Сайт:",
button: {
text: "Установить"
}
};
toBack() {
ReactDOM.render(
,
document.getElementById("HomePage")
);
}
checkVersion(item) {
console.log(item.split("[U]")[1] === "");
if (item.split("[U]")[1] === "") {
return (
{item.split("[U]")[0]}
);
} else {
return (
{item.split("[M]")[0]}
);
}
}
render() {
return (
this.toBack()}>
BaCk
{this.props.PackageName.Name.split("/")[1]}
{" "}
{this.ui.category}{" "}
{this.props.PackageName.Name.split("/")[0]}
{this.ui.versions}
{this.props.PackageName.version.map((v) => this.checkVersion(v))}
{this.ui.uses}
{this.props.PackageName.USE.map((u) => (
{u}
))}
{this.ui.decription} {this.props.PackageName.Description}
{this.ui.site}
{this.ui.button.text}
);
}
}
export default FullCard;