diff --git a/microsite-next/src/components/simpleCard/simpleCard.tsx b/microsite-next/src/components/simpleCard/simpleCard.tsx new file mode 100644 index 0000000000..77be566f18 --- /dev/null +++ b/microsite-next/src/components/simpleCard/simpleCard.tsx @@ -0,0 +1,17 @@ +import React from 'react'; + +export interface ICardData { + header: React.ReactNode; + body: React.ReactNode; + footer: React.ReactNode; +} + +export const SimpleCard = ({ header, body, footer }: ICardData) => ( +
+
{header}
+ +
{body}
+ +
{footer}
+
+); diff --git a/microsite-next/src/pages/on-demand/_onDemandCard.tsx b/microsite-next/src/pages/on-demand/_onDemandCard.tsx new file mode 100644 index 0000000000..e203c80f9a --- /dev/null +++ b/microsite-next/src/pages/on-demand/_onDemandCard.tsx @@ -0,0 +1,66 @@ +import Link from '@docusaurus/Link'; +import { SimpleCard } from '@site/src/components/simpleCard/simpleCard'; +import React from 'react'; + +export interface IOnDemandData { + title: string; + category: string; + description: string; + date: string; + youtubeUrl: string; + youtubeImgUrl: string; + rsvpUrl: string; + eventUrl: string; +} + +export const OnDemandCard = ({ + title, + category, + description, + date, + youtubeUrl, + youtubeImgUrl, + rsvpUrl, + eventUrl, +}: IOnDemandData) => ( + +

{title}

+ +

on {date}

+ + {category} + + {title} + + } + body={

{description}

} + footer={ + category.toLowerCase() === 'upcoming' ? ( + <> + + Event page + + + + Remind me + + + ) : ( + + Watch on YouTube + + ) + } + /> +); diff --git a/microsite-next/src/pages/on-demand/index.tsx b/microsite-next/src/pages/on-demand/index.tsx new file mode 100644 index 0000000000..7262005f70 --- /dev/null +++ b/microsite-next/src/pages/on-demand/index.tsx @@ -0,0 +1,78 @@ +import Layout from '@theme/Layout'; +import clsx from 'clsx'; +import React from 'react'; + +import { IOnDemandData, OnDemandCard } from './_onDemandCard'; +import pluginsStyles from './onDemand.module.scss'; +import { truncateDescription } from '@site/src/util/truncateDescription'; +import Link from '@docusaurus/Link'; + +//#region Plugin data import +const onDemandContext = require.context( + '../../../../microsite/data/on-demand', + false, + /\.ya?ml/, +); + +const onDemandData = onDemandContext.keys().reduce( + (acum, id) => { + const pluginData: IOnDemandData = onDemandContext(id).default; + + acum[ + pluginData.category === 'Upcoming' ? 'upcomingEvents' : 'onDemandEvents' + ].push(truncateDescription(pluginData)); + + return acum; + }, + { + upcomingEvents: [] as IOnDemandData[], + onDemandEvents: [] as IOnDemandData[], + }, +); +//#endregion + +const Plugins = () => ( + +
+
+
+

Community sessions

+ +

+ Upcoming events and recorded sessions about updates, demos and + discussions. +

+
+ + + Add an event or recording + +
+ +
+ +

Upcoming live events

+ +
+ {onDemandData.upcomingEvents.map(eventData => ( + + ))} +
+ +

Community on demand

+ +
+ {onDemandData.onDemandEvents.map(eventData => ( + + ))} +
+
+
+); + +export default Plugins; diff --git a/microsite-next/src/pages/on-demand/onDemand.module.scss b/microsite-next/src/pages/on-demand/onDemand.module.scss new file mode 100644 index 0000000000..fba051ec97 --- /dev/null +++ b/microsite-next/src/pages/on-demand/onDemand.module.scss @@ -0,0 +1,44 @@ +.onDemandPage { + :global(.marketplaceBanner) { + display: flex; + align-items: center; + } + + :global(.marketplaceContent) { + flex: 1; + } + + :global(.card) { + max-width: 100%; + } + + :global(.card .card__header) { + display: grid; + row-gap: 0.25rem; + column-gap: 1rem; + justify-items: start; + + > * { + margin: 0; + } + + :global(img) { + width: 250px; + max-width: 100%; + justify-self: center; + } + } + + :global(.card .card__footer) { + gap: 1rem; + display: grid; + grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); + } + + :global(.cardsContainer) { + gap: 1rem; + display: grid; + grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); + justify-items: start; + } +} diff --git a/microsite-next/src/pages/plugins/_pluginCard.tsx b/microsite-next/src/pages/plugins/_pluginCard.tsx index dec62af06f..99f27b865d 100644 --- a/microsite-next/src/pages/plugins/_pluginCard.tsx +++ b/microsite-next/src/pages/plugins/_pluginCard.tsx @@ -1,4 +1,5 @@ import Link from '@docusaurus/Link'; +import { SimpleCard } from '@site/src/components/simpleCard/simpleCard'; import React from 'react'; export interface IPluginData { @@ -23,32 +24,30 @@ export const PluginCard = ({ iconUrl, title, }: IPluginData) => ( -
-
- {title} + + {title} -

{title}

+

{title}

-

- by {author} -

+

+ by {author} +

- - {category} - -
- -
-

{description}

-
- -
+ + {category} + + + } + body={

{description}

} + footer={ Explore -
-
+ } + /> ); diff --git a/microsite-next/src/pages/plugins/index.tsx b/microsite-next/src/pages/plugins/index.tsx index f8c6f78819..0e57e01994 100644 --- a/microsite-next/src/pages/plugins/index.tsx +++ b/microsite-next/src/pages/plugins/index.tsx @@ -5,18 +5,9 @@ import React from 'react'; import { IPluginData, PluginCard } from './_pluginCard'; import pluginsStyles from './plugins.module.scss'; +import { truncateDescription } from '@site/src/util/truncateDescription'; //#region Plugin data import -const maxDescLength = 160; - -const truncatePluginDescription = (pluginData: IPluginData) => - pluginData.description.length > maxDescLength - ? { - ...pluginData, - description: pluginData.description.slice(0, maxDescLength) + '...', - } - : pluginData; - const pluginsContext = require.context( '../../../../microsite/data/plugins', false, @@ -29,7 +20,7 @@ const plugins = pluginsContext.keys().reduce( acum[ pluginData.category === 'Core Feature' ? 'corePlugins' : 'otherPlugins' - ].push(truncatePluginDescription(pluginData)); + ].push(truncateDescription(pluginData)); return acum; }, diff --git a/microsite-next/src/util/truncateDescription.tsx b/microsite-next/src/util/truncateDescription.tsx new file mode 100644 index 0000000000..dc661cbd49 --- /dev/null +++ b/microsite-next/src/util/truncateDescription.tsx @@ -0,0 +1,11 @@ +export const maxDescLength = 160; + +export const truncateDescription = ( + itemData: T, +) => + itemData.description.length > maxDescLength + ? { + ...itemData, + description: itemData.description.slice(0, maxDescLength) + '...', + } + : itemData;