Components

Author

<Author />

Constructor

# <Author />

Author Component - displays all authors passed as an array

Parameters:
Name Type Description
props AuthorProps
authors Array.<Author>

Array containing details about all authors of the story. Comes from Story API

prepend string | React.Component

Optional. Used to prepend either some string or a component containing some icon to authors.

View Source atoms/author/author.tsx, line 28

Classes

Author

<Author />

Constructor

# <Author />

How to pass custom Author component from the app?

... ... ampRoutes(app, { ... ... render: { authorCardRender: ({ story, config, theme }) => { const authorSettings = get( config, ["additionalConfig", "story", ${camelCase(storyType)}-story, "settings", "authorDetails"], {} ) || {}; const authorStyle = get(authorSettings, ["template"], "default"); if (authorStyle !== "default") return null; const { enableLocalization = false, localizedElements = {} } = get( config, ["additionalConfig", "general", "localization"], {} ); const localizedElementData = enableLocalization ? localizedElements : {}; const { buttonLabels = {} } = localizedElementData; const { authorLabel: localizedAuthorLabel, guestAuthorLabel: localizedGuestAuthorLabel } = buttonLabels; const authorConfig = { ...authorSettings, localizedAuthorLabel, localizedGuestAuthorLabel, }; return ; } }, } ... ...

View Source atoms/author/author.tsx, line 48

Classes

Author