From ef8f83a11216e68f2c5240effb33f268d7d3f3fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matheus=20Gaudencio=20do=20R=C3=AAgo?= Date: Tue, 7 Nov 2023 16:06:18 -0300 Subject: [PATCH] Update edit section. --- docs/developing/editable-sections/pt.md | 76 ++++++++++++++----------- 1 file changed, 44 insertions(+), 32 deletions(-) diff --git a/docs/developing/editable-sections/pt.md b/docs/developing/editable-sections/pt.md index b0377b64..df62e39e 100644 --- a/docs/developing/editable-sections/pt.md +++ b/docs/developing/editable-sections/pt.md @@ -114,45 +114,57 @@ Execute o projeto localmente (`deno task start`) e altere o código da `Hero` pa ```tsx import type { ImageWidget } from "apps/admin/widgets.ts"; -import Image from "apps/website/components/Image.tsx"; +/** @title {{{title}}} - {{{href}}} */ +export interface Link { + title: string; + href: string; + hightlight?: boolean; +} export interface Props { - /** - * @title Post image. - */ - photo?: ImageWidget; - /** - * @title Post body. - */ - post: string; - /** - * @title Publish date. - * @format datetime - */ - datetime: string; - /** - * @title Post title. - */ - title: string; + logo?: ImageWidget; + title?: string; + /** @format textarea */ + headline?: string; + links?: Array; } -export default function LatestPosts({ title, photo }: Props) { - return ( -
- {photo && {`${title}} -

{title}

-

This is an example section

+export default function Hero({ + title = "deco.cx", + logo = "/logo.svg", + headline = + "The digital experience platform that combines performance and personalization for the ultimate sales results.", + links = [ + { title: "Official website", "href": "https://deco.cx/" }, + { title: "Linkedin", "href": "https://www.linkedin.com/company/deco-cx/" }, + { title: "Discord", "href": "https://deco.cx/discord" }, + ], +}: Props) { + return ( +
+
+ {title}
- ); +
+ {headline} +
+ {!!links?.length && ( +
    + {links.map(({ href, title, hightlight }) => ( + +
  • {title}
  • +
    + ))} +
+ )} +
+ ); } - ``` _Alterando o tipo Link e o JSX com a nova propriedade `hightlight`_