// Окно на главном меню с рекомендациями, новостями import React from "react"; import ReactDOM from "react-dom"; //import Scard from "../Componets/Cards/smallCard"; import FullCard from "../Componets/Cards/fullCard"; //import NavBar from "../Componets/NavList/navList"; //import div from "@mui/material/div"; import Widget from "../Componets/WCard/widget"; import "./style.css"; import Accordion from "../Componets/Acardion"; import TabsView from "../Componets/Tabs/tabs"; import { ProSidebar, Menu, MenuItem, SubMenu, SidebarHeader, //SidebarFooter, SidebarContent } from "react-pro-sidebar"; export default class MainPage extends React.Component { VVSB = false; c = "column__list"; ui = { menu: { text: "Меню" }, catalog: { text: "Каталог" } }; menuBtn = { all: { borderBottom: "1px solid #AAA", background: "#1d1d1d", color: "#FFF", textDecoration: "none", marginLeft: "0px", padding: " 10px", borderRight: "1px solid #FFF", cursor: "pointer", position: "ralative", left: "-40px", borderRadius: "0px 20px 0px 20px", left: "-20px" //borderRadius: "10px 20px 0px 0px" }, active: { background: "blue", //color: "#FFF", textDecoration: "none", marginLeft: "0px", padding: " 10px", borderRight: "1px solid #FFF", cursor: "pointer", position: "ralative", left: "-40px" } }; menuButton = [ { id: "all", text: "Рекомендации", handler: () => this.mainP() }, { id: "inclides", text: "Устаовленые", handler: () => this.mainP() }, { id: "catalog", text: "Каталог", handler: () => this.viewCatalog() } ]; active = "Рекомендации"; slideNum = 1; checkAlias(text) { //console.log( "aliases:\t" + this.props.aliases) //return text; if (text in this.props.aliases) { return this.props.aliases[text]; //console.log(this.props.aliases[text]); } else { return text; //console.log(e); } } viewCatalog() { return (
{Object.keys(this.props.category).map((k, i) => (
{/*} title={ this.checkAlias(k) + " (" + this.props.category[k].length + ")" } >*/} {this.props.category[k].map((pn, j) => (
this.viewInfo(this.props.category[k][i])} > {pn.Name.split("/")[1]}
{" "} {pn}
))}
))}
); } TitleView() { try { if (document.getElementById("pTitle").textContent !== "Главная") { document.getElementById("pTitle").textContent = "Главная"; } } catch (e) { console.log(e); } } mainP() { this.TitleView(); return (

{" "} Новости

  • TEST
  • TEST
  • TEST
  • TEST
  • TEST
  • Уведомления

  • TEST
  • TEST
  • TEST
  • TEST
  • TEST
  • {Object.keys(this.props.rec).map((k) => (
    {this.props.rec[k].map((pn, i) => (
    this.viewInfo(this.props.rec[k][i])} > {pn.Name.split("/")[1]}
    {" "} {pn.Name.split("/")[1]}
    {pn.Description}
    ))}
    ))}
    ); } viewSideBar() { if (!this.VVSB) { document.getElementById("MainContent").style.paddingLeft = "300px"; document.getElementById("btn-toggle").style.float = "right"; document.getElementById("navBar").style.left = "0px"; this.VVSB = true; } else { document.getElementById("MainContent").style.paddingLeft = "0px"; document.getElementById("navBar").style.left = "-280px"; this.VVSB = false; } } viewInfo(pkg) { //onClick={() => this.props.ViewPackageInfo(this.props.rec[k][i])} document.getElementById("backBtn").style.display = "block"; //document.getElementById("pTitle").textContent = pkg.Name.split("/")[1]; document.getElementById("container").style.display = "none"; document.getElementById("containerInfo").style.display = "block"; ReactDOM.render( , document.getElementById("containerInfo") ); } render() { return (
    {this.TitleView()}
    {this.menuButton[0].handler()}
    ); } }