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
theme-card.js 1020 B
Newer Older
  • Learn to ignore specific revisions
  • peter_rabbit's avatar
    peter_rabbit committed
    "use strict";
    
    const { images_url } = require("../../constants");
    
    class ThemeCard {
        constructor(props) {
            this.props = props;
        }
    
        render() {
            return {
                tag: "a",
                class: "theme-card",
                href: this.props.href,
                contents: [
                    {
                        tag: "div",
                        class: "card-img",
    
                        contents: [{ tag: "img", alt:`thematic image ${this.props.img.replace(/\.[A-Za-z]+/, "")}`,src: `${images_url}${this.props.img}` }],
    
    peter_rabbit's avatar
    peter_rabbit committed
                    },
                    {
                        tag: "div",
                        class: "card-title",
                        contents: [{ tag: "h2", class: "section-title", contents: this.props.title }],
                    },
                    {
                        tag: "div",
                        class: "card-description",
                        contents: [{ tag: "p", contents: this.props.description }],
                    },
                ],
            };
        }
    }
    
    module.exports = ThemeCard;