Skip to content

Commit

Permalink
Update section edit to new admin.
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusgr committed Nov 10, 2023
1 parent ef8f83a commit 29693b4
Showing 1 changed file with 32 additions and 44 deletions.
76 changes: 32 additions & 44 deletions docs/developing/editable-sections/pt.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,57 +114,45 @@ 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 {
logo?: ImageWidget;
title?: string;
/** @format textarea */
headline?: string;
links?: Array<Link>;
/**
* @title Post image.
*/
photo?: ImageWidget;
/**
* @title Post body.
*/
post: string;
/**
* @title Publish date.
* @format datetime
*/
datetime: string;
/**
* @title Post title.
*/
title: string;
}

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 (
<header class="lg:container mx-8 md:mx-16 lg:mx-auto mt-8 md:mt-12 mb-28 text-xl md:text-base">
<div class="mb-10 md:mb-20">
<img
class="object-cover w-20"
src={logo}
alt={title}
/>
export default function LatestPosts({ title, photo }: Props) {
return (
<div>
{photo && <Image
src={photo}
alt={`${title} image`}
height={500}
width={500}
class="rounded"
/>}
<h1 class="font-bold">{title}</h1>
<p>This is an example section</p>
</div>
<div class="font-bold text-2xl lg:text-6xl leading-tight lg:leading-none xl:w-5/6">
{headline}
</div>
{!!links?.length && (
<ul class="mt-8 flex flex-col md:flex-row gap-2 md:gap-4">
{links.map(({ href, title, hightlight }) => (
<a href={href} aria-label={title}>
<li class={`${hightlight ? "font-black" : ""}`}>{title}</li>
</a>
))}
</ul>
)}
</header>
);
);
}

```
_Alterando o tipo Link e o JSX com a nova propriedade `hightlight`_

Expand Down

0 comments on commit 29693b4

Please sign in to comment.