@navinc/base-react-components
Version:
Nav's Pattern Library
31 lines (29 loc) • 1.46 kB
TypeScript
import { ReactNode } from 'react';
export declare const transformHTML: (content?: string) => ReactNode;
type ArticleProps = {
/** Should have name, bio, jobTitle and image properties */
author: {
name: string;
bio: string;
jobTitle: string;
image: string;
};
/** Date that the article was written */
dateGmt: string;
/** The whole article that is pulled from Wordpress (raw html) */
content: string;
/** Date for the last time the article was updated */
modifiedGmt: string;
/** Minified text for the article, in raw html */
excerpt: string;
/** Title for the article */
title?: string;
/** Defining if the article should start open */
shouldStartOpen?: boolean;
};
/**
* The <Article /> component is specifically for resource content served up from the WordPress API, as much of its styling is configured for the elements that will be returned from this source.
* <Article /> sets the excerpt and content HTML directly into its elements. A toggle at the bottom of the article when expanded will scroll the user back up to the article's `offsetTop`, and this is recalculated every time the Article is opened or closed to account for any displacement from open elements above it.
*/
export declare const Article: ({ author, dateGmt, content, modifiedGmt, excerpt, title, shouldStartOpen }: ArticleProps) => import("react/jsx-runtime").JSX.Element | null;
export {};