Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
template.js 2.02 KiB
"use strict";

class Template {
    constructor(props) {
        this.props = props;
    }

    render() {
        return {
            tag: "main",
            contents: [
                {
                    tag: "header",
                    contents: [
                        {
                            tag: "nav",
                            contents: [
                                {
                                    tag: "ul",
                                    contents: [
                                        ["/public/", "Accueil"],
                                        ["/public/games/", "Jeux"],
                                        ["/public/software-development/", "Software"],
                                        ["/public/education/", "Pédagogie"],
                                    ].map(link => {
                                        const [href, text] = link;
                                        return {
                                            tag: "li",
                                            class:
                                                window.location.pathname === href ? "active" : "",
                                            contents: [{ tag: "a", href, contents: text }],
                                        };
                                    }),
                                },
                            ],
                        },
                    ],
                },
                {
                    tag: "div",
                    id: "page-container",
                    contents: [this.props.page.render()],
                },
                {
                    tag: "footer",
                    contents: [
                        {
                            tag: "a",
                            href: "mailto:kuadrado-software@tutanota.com",
                            contents: "kuadrado-software@tutanota.com",
                        },
                    ],
                },
            ],
        };
    }
}

module.exports = Template;