Skip to content
Snippets Groups Projects
feature.tsx 2.68 KiB
Newer Older
Toavina's avatar
Toavina committed
import React, { ReactElement } from "react"
Tovo Ramontalambo's avatar
Tovo Ramontalambo committed
import { Content, Link, Feature } from "@onegeo/gatsby-theme-onegeo"
tovo's avatar
tovo committed

function feature(): ReactElement {
Toavina's avatar
Toavina committed
    return (
        <Content>
            <div className="prose">
                <Link to="/doc">Retour</Link>
tovo's avatar
tovo committed

Toavina's avatar
Toavina committed
                <h1>Feature</h1>
                <h2>Props</h2>
                <div className="mockup-code">
                    <pre>
                        <code>
                            {`
tovo's avatar
tovo committed
interface FeatureProps {
tovo's avatar
tovo committed
title?: string;
content?: string;
image?: string | IGatsbyImageData;
mapid?: number;
tovo's avatar
tovo committed
layout?: 'left' | 'right';
backgroundImage?: string;
action?: {
  name?: string;
  url?: string;
tovo's avatar
tovo committed
  className?: string;
tovo's avatar
tovo committed
};
custom?: JSX.Element;
tovo's avatar
tovo committed
}`}
Toavina's avatar
Toavina committed
                        </code>
                    </pre>
                </div>
tovo's avatar
tovo committed

Toavina's avatar
Toavina committed
                <h2>Example</h2>
            </div>
            <div className="mt-10">
                <h1 className="text-2xl font-semibold p-4">Custom component</h1>
                <Feature
                    title="Action"
                    content="Action description for the Button"
                    layout="left"
                    custom={<div>Custom component</div>}
                    action={{
                        url: "#",
                        name: "Action",
Toavina's avatar
Toavina committed
                    }}
                />
            </div>
            <div className="mt-10">
                <h1 className="text-2xl font-semibold p-4">Image</h1>
                <Feature
                    title="Action"
                    content="Action description for the Button"
                    layout="right"
                    image="https://fakeimg.pl/480x480/"
                    action={{
                        url: "#",
                        name: "Action",
Toavina's avatar
Toavina committed
                    }}
                />
            </div>
            <div className="mt-10">
                <h1 className="text-2xl font-semibold p-4">Text only</h1>
                <Feature
                    title="Action"
                    content="Action description for the Button"
                    action={{
                        url: "#",
                        name: "Action",
Toavina's avatar
Toavina committed
                    }}
                />
            </div>
            <div className="mt-10">
                <h1 className="text-2xl font-semibold p-4">Map</h1>
                <Feature
                    title="Action"
                    content="Action description for the Button"
                    action={{
                        url: "#",
                        name: "Action",
Toavina's avatar
Toavina committed
                    }}
                    layout="left"
Tovo Ramontalambo's avatar
Tovo Ramontalambo committed
                    mapid={109}
Toavina's avatar
Toavina committed
                />
            </div>
        </Content>
    )
tovo's avatar
tovo committed
}

Toavina's avatar
Toavina committed
export default feature