description: This service is in charge of processing
user signups :rocket:
@@ -218,7 +218,7 @@ export default function DemoAnimation({ className = '' }: IDemoAnimationProps) {
return (
<>
{common}
-
} onFinishedTyping={descriptionCallback}>
+
} onTypingDone={descriptionCallback}>
description:
@@ -263,7 +263,7 @@ export default function DemoAnimation({ className = '' }: IDemoAnimationProps) {
return (
<>
{common}
- } onFinishedTyping={descriptionCallback}>
+ } onTypingDone={descriptionCallback}>
description:
diff --git a/components/Hero.tsx b/components/Hero.tsx
index e670cfed116..6f9d717bf36 100644
--- a/components/Hero.tsx
+++ b/components/Hero.tsx
@@ -4,6 +4,7 @@ import { ParagraphTypeStyle } from '@/types/typography/Paragraph';
import { useTranslation } from '../utils/i18n';
import AlgoliaSearch, { SearchButton } from './AlgoliaSearch'; // Import AlgoliaSearch component
import Button from './buttons/Button';
+import DemoAnimation from './DemoAnimation';
import Features from './features';
import ArrowRight from './icons/ArrowRight';
import IconLoupe from './icons/Loupe';
@@ -76,7 +77,9 @@ export default function Hero({ className = '' }: HeroProps) {
- {/* */}
+
+
+
>
diff --git a/package-lock.json b/package-lock.json
index 439e915ae59..43a161d0924 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -58,6 +58,7 @@
"react-syntax-highlighter": "^15.5.0",
"react-text-truncate": "^0.19.0",
"react-twitter-embed": "^4.0.4",
+ "react-typist-component": "^1.0.6",
"react-youtube-embed": "^1.0.3",
"reading-time": "^1.5.0",
"recharts": "^2.12.2",
@@ -13242,6 +13243,14 @@
"react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0"
}
},
+ "node_modules/react-typist-component": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/react-typist-component/-/react-typist-component-1.0.6.tgz",
+ "integrity": "sha512-DOcMvPyqsB2dgh/DtfaDrrNSoZAFarToPXn82WN56vF9DJBeS5ss5voLI1x+nntXiWpWCUJkLL/rDS4/W0YTSQ==",
+ "peerDependencies": {
+ "react": ">=18.0.0"
+ }
+ },
"node_modules/react-youtube-embed": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/react-youtube-embed/-/react-youtube-embed-1.0.3.tgz",
diff --git a/package.json b/package.json
index a583ec70a87..0677f079e74 100644
--- a/package.json
+++ b/package.json
@@ -84,6 +84,7 @@
"react-syntax-highlighter": "^15.5.0",
"react-text-truncate": "^0.19.0",
"react-twitter-embed": "^4.0.4",
+ "react-typist-component": "^1.0.6",
"react-youtube-embed": "^1.0.3",
"reading-time": "^1.5.0",
"recharts": "^2.12.2",
From 8539ac55c5004a42ffe78c4f66356e6fcf192c46 Mon Sep 17 00:00:00 2001
From: Ansh Goyal
Date: Thu, 25 Apr 2024 15:13:38 +0000
Subject: [PATCH 3/7] add minor fixes
---
components/DemoAnimation.tsx | 2 +-
pages/index.tsx | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/components/DemoAnimation.tsx b/components/DemoAnimation.tsx
index 7e4f9eb0069..5b888a6d8aa 100644
--- a/components/DemoAnimation.tsx
+++ b/components/DemoAnimation.tsx
@@ -358,7 +358,7 @@ export default function DemoAnimation({ className = '' }: IDemoAnimationProps) {
-
&slash;&slash; Example
+
// Example
{'{'}
diff --git a/pages/index.tsx b/pages/index.tsx
index 5bacdc950cf..348311a7aa2 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -15,7 +15,7 @@ export default function HomePage() {
-
+
Loading...
From 002d0cd708b9b32abd8c16d5bc7fe9d8a3e966b0 Mon Sep 17 00:00:00 2001
From: akshatnema
Date: Thu, 25 Apr 2024 21:45:43 +0530
Subject: [PATCH 4/7] included json in tsconfig
---
tsconfig.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tsconfig.json b/tsconfig.json
index 57d570ff80d..d7c7683d940 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -16,6 +16,6 @@
"@/*": ["./*"]
}
},
- "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "types/**/*.d.ts"],
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "types/**/*.d.ts", "**/*.json"],
"exclude": ["node_modules", "netlify"]
}
From 37da86a8b8b218f7aac897fda892b7de434827f9 Mon Sep 17 00:00:00 2001
From: akshatnema
Date: Thu, 25 Apr 2024 22:57:34 +0530
Subject: [PATCH 5/7] fixed meeting event issue
---
components/Calendar.tsx | 2 +
utils/api.ts | 38 +++-----
utils/staticHelpers.js | 204 ----------------------------------------
utils/staticHelpers.ts | 171 +++++++++++++++++++++++++++++++++
4 files changed, 188 insertions(+), 227 deletions(-)
delete mode 100644 utils/staticHelpers.js
create mode 100644 utils/staticHelpers.ts
diff --git a/components/Calendar.tsx b/components/Calendar.tsx
index 2805abf2f7c..3b5c176dd8b 100644
--- a/components/Calendar.tsx
+++ b/components/Calendar.tsx
@@ -29,6 +29,8 @@ export default function Calendar({ className = '', size }: ICalendarProps) {
'https://calendar.google.com/calendar/embed?src=c_q9tseiglomdsj6njuhvbpts11c%40group.calendar.google.com&ctz=UTC';
const eventsExist = eventsData.length > 0;
+ console.log(getEvents(eventsData, size));
+
return (
diff --git a/utils/api.ts b/utils/api.ts
index d7a35af5073..bbeef4bcf1b 100644
--- a/utils/api.ts
+++ b/utils/api.ts
@@ -15,22 +15,19 @@ export function getAllPosts(): IPosts {
* @param {string} [type=''] - The type of the post.
* @returns {Object | undefined} The post if found, undefined otherwise.
*/
-export function getPostBySlug(
- slug: string,
- type: string = ''
-) {
- if(type)
- return (posts as any)[type].find((post: IPost) => post.slug === slug && !post.isSection )
- else {
- let item;
- Object.entries(posts).forEach(([key, value]) => {
- let content
- if(key!== 'docsTree')
- content = (posts as any)[key].find((post: IPost) => post.slug === slug && !post.isSection)
- if(content) item = content
- })
- return item
- }
+export function getPostBySlug(slug: string, type: string = '') {
+ if (type) return (posts as any)[type].find((post: IPost) => post.slug === slug && !post.isSection);
+
+ let item;
+
+ Object.entries(posts).forEach(([key]) => {
+ let content;
+
+ if (key !== 'docsTree') content = (posts as any)[key].find((post: IPost) => post.slug === slug && !post.isSection);
+ if (content) item = content;
+ });
+
+ return item;
}
/**
@@ -39,11 +36,6 @@ export function getPostBySlug(
* @param {string} slug - The slug of the document.
* @returns {Object | undefined} The document if found, undefined otherwise.
*/
-export function getDocBySlug(
- structuredPosts: IPost[],
- slug: string
-): object | undefined {
- return structuredPosts.find(
- (post) => post.slug === slug && !post.isSection
- );
+export function getDocBySlug(structuredPosts: IPost[], slug: string): object | undefined {
+ return structuredPosts.find((post) => post.slug === slug && !post.isSection);
}
diff --git a/utils/staticHelpers.js b/utils/staticHelpers.js
deleted file mode 100644
index 3dab218265b..00000000000
--- a/utils/staticHelpers.js
+++ /dev/null
@@ -1,204 +0,0 @@
-import { getPostBySlug, getAllPosts } from './api';
-import moment from 'moment';
-
-export function getStaticPropsHelper(path) {
- return async function getStaticProps({ params }) {
- const navItems = [
- {
- title: 'Getting started',
- slug: 'docs/getting-started',
- items: getSectionItems('docs/getting-started'),
- },
- {
- title: 'Tutorials',
- slug: 'docs/tutorials',
- items: getSectionItems('docs/tutorials'),
- },
- ];
- const post = getPostBySlug(
- path,
- params && params.slug ? params.slug : 'index',
- [
- 'title',
- 'date',
- 'slug',
- 'fullSlug',
- 'author',
- 'content',
- 'ogImage',
- 'coverImage',
- ]
- );
- const content = post.content || '';
-
- return {
- props: {
- post: {
- ...post,
- content,
- },
- navItems,
- },
- };
- };
-}
-
-function getSectionItems(path) {
- return getAllPosts(path, ['slug', 'fullSlug', 'title', 'weight']).sort(
- (p1, p2) => (p1.weight || 0) - (p2.weight || 0)
- );
-}
-
-export function getStaticPathsHelper(path) {
- return async function getStaticPaths() {
- const posts = getAllPosts(path, ['slug']);
-
- return {
- paths: posts.map((post) => {
- return {
- params: {
- slug: post.slug,
- },
- };
- }),
- fallback: false,
- };
- };
-}
-
-export function getEvents(events, size) {
- let meetingsWithDates = events.map((event) => ({
- ...event,
- date: moment(event.date),
- }));
- meetingsWithDates.sort((a, b) => a.date - b.date);
- if (size) {
- return meetingsWithDates
- .filter((meeting) => meeting.date > new Date())
- .slice(0, size || meetingsWithDates.length);
- }
- const sortedMeetings = [];
- meetingsWithDates.filter((a) => {
- if (a.date > new Date()) {
- sortedMeetings.push(a);
- }
- });
- meetingsWithDates.sort((a, b) => {
- return b.date - a.date
- })
- meetingsWithDates.filter((a) => {
- if (a.date < new Date()) {
- sortedMeetings.push(a);
- }
- });
-
- meetingsWithDates = sortedMeetings
-
- return meetingsWithDates;
-}
-
-export const generateCaseStudyContent = (data) => {
- const { challenges, solution, usecase, architecture, testing, codegen, schemaStorage, registry, versioning, validation, asyncapiStorage, asyncapiEditing, asyncapiExtensions, asyncapiDocumentation, asyncapiBindings, asyncapiTools, additionalResources, casestudy } = data;
- const languages= casestudy.technical.languages
- const frameworks=casestudy.technical.frameworks
- const protocols=casestudy.technical.protocols
- const versions=casestudy.asyncapi.versions
-
- return [
- {
- title: "Challenges",
- content: challenges,
- },
- {
- title: "Solution",
- content: solution,
- },
- {
- title: "Use Case",
- content: usecase,
- },
- {
- title: "More Details",
- items: [
- `Languages: ${languages.join(", ")}`,
- `Frameworks: ${frameworks.join(", ")}`,
- `Protocols: ${protocols.join(", ")}`,
- ],
- children: [
- {
- title: "Testing strategy",
- content: testing,
- },
- {
- title: "Approach to code generation",
- content: codegen,
- },
- {
- title: "Architecture",
- content: architecture,
- },
- {
- title: "More Details about AsyncAPI",
- items: [
- `Version: ${versions.join(", ")}`,
- `Who maintains documents: ${casestudy.asyncapi.maintainers}}`,
- `Internal users: ${casestudy.asyncapi.audience.internal.toString()}`,
- `External users: ${casestudy.asyncapi.audience.external.toString()}`,
- ],
- children: [
- {
- title: "How AsyncAPI documents are stored",
- content: asyncapiStorage,
- },
- {
- title: "Where maintainers edit AsyncAPI documents",
- content: asyncapiEditing,
- },
- {
- title: "What extensions are used",
- content: asyncapiExtensions,
- },
- {
- title: "How documentation is generated",
- content: asyncapiDocumentation,
- },
- {
- title: "What bindings are used",
- content: asyncapiBindings,
- },
- {
- title: "What tools are used",
- content: asyncapiTools,
- },
- ],
- },
- {
- title: "Schemas",
- items: [`Spec: ${casestudy.schemas.description}`],
- children: [
- {
- title: "Storage strategy",
- content: schemaStorage,
- },
- {
- title: "Schema Registry",
- content: registry,
- },
- {
- title: "Versioning of schemas",
- content: versioning,
- },
- {
- title: "Validation of message schemas",
- content: validation,
- },
- {
- title: "Additional Resources",
- content: additionalResources,
- },
- ],
- },
- ],
- },
- ];
-}
\ No newline at end of file
diff --git a/utils/staticHelpers.ts b/utils/staticHelpers.ts
new file mode 100644
index 00000000000..b1175af762e
--- /dev/null
+++ b/utils/staticHelpers.ts
@@ -0,0 +1,171 @@
+import moment from 'moment';
+
+import type { IEvent } from '@/types/event';
+
+/**
+ *
+ * @param events
+ * @param size
+ * @returns
+ */
+export function getEvents(events: IEvent[], size?: number) {
+ let meetingsWithDates: any = events.map((event) => ({
+ ...event,
+ date: moment(event.date)
+ }));
+
+ meetingsWithDates.sort((a: any, b: any) => a.date - b.date);
+
+ if (size) {
+ return meetingsWithDates
+ .filter((meeting: any) => meeting.date > moment(new Date().toDateString()))
+ .slice(0, size || meetingsWithDates.length);
+ }
+
+ const sortedMeetings: any = [];
+
+ for (const meeting of meetingsWithDates) {
+ if (meeting.date > moment(new Date().toDateString())) {
+ sortedMeetings.push(meeting);
+ }
+ }
+
+ meetingsWithDates.sort((a: any, b: any) => {
+ return b.date - a.date;
+ });
+
+ for (const meeting of meetingsWithDates) {
+ if (meeting.date < moment(new Date().toDateString())) {
+ sortedMeetings.push(meeting);
+ }
+ }
+
+ meetingsWithDates = sortedMeetings;
+
+ return meetingsWithDates;
+}
+
+export const generateCaseStudyContent = (data: any) => {
+ const {
+ challenges,
+ solution,
+ usecase,
+ architecture,
+ testing,
+ codegen,
+ schemaStorage,
+ registry,
+ versioning,
+ validation,
+ asyncapiStorage,
+ asyncapiEditing,
+ asyncapiExtensions,
+ asyncapiDocumentation,
+ asyncapiBindings,
+ asyncapiTools,
+ additionalResources,
+ casestudy
+ } = data;
+ const { languages } = casestudy.technical;
+ const { frameworks } = casestudy.technical;
+ const { protocols } = casestudy.technical;
+ const { versions } = casestudy.asyncapi;
+
+ return [
+ {
+ title: 'Challenges',
+ content: challenges
+ },
+ {
+ title: 'Solution',
+ content: solution
+ },
+ {
+ title: 'Use Case',
+ content: usecase
+ },
+ {
+ title: 'More Details',
+ items: [
+ `Languages: ${languages.join(', ')}`,
+ `Frameworks: ${frameworks.join(', ')}`,
+ `Protocols: ${protocols.join(', ')}`
+ ],
+ children: [
+ {
+ title: 'Testing strategy',
+ content: testing
+ },
+ {
+ title: 'Approach to code generation',
+ content: codegen
+ },
+ {
+ title: 'Architecture',
+ content: architecture
+ },
+ {
+ title: 'More Details about AsyncAPI',
+ items: [
+ `Version: ${versions.join(', ')}`,
+ `Who maintains documents: ${casestudy.asyncapi.maintainers}`,
+ `Internal users: ${casestudy.asyncapi.audience.internal.toString()}`,
+ `External users: ${casestudy.asyncapi.audience.external.toString()}`
+ ],
+ children: [
+ {
+ title: 'How AsyncAPI documents are stored',
+ content: asyncapiStorage
+ },
+ {
+ title: 'Where maintainers edit AsyncAPI documents',
+ content: asyncapiEditing
+ },
+ {
+ title: 'What extensions are used',
+ content: asyncapiExtensions
+ },
+ {
+ title: 'How documentation is generated',
+ content: asyncapiDocumentation
+ },
+ {
+ title: 'What bindings are used',
+ content: asyncapiBindings
+ },
+ {
+ title: 'What tools are used',
+ content: asyncapiTools
+ }
+ ]
+ },
+ {
+ title: 'Schemas',
+ items: [`Spec: ${casestudy.schemas.description}`],
+ children: [
+ {
+ title: 'Storage strategy',
+ content: schemaStorage
+ },
+ {
+ title: 'Schema Registry',
+ content: registry
+ },
+ {
+ title: 'Versioning of schemas',
+ content: versioning
+ },
+ {
+ title: 'Validation of message schemas',
+ content: validation
+ },
+ {
+ title: 'Additional Resources',
+ content: additionalResources
+ }
+ ]
+ }
+ ]
+ }
+ ];
+};
From 2aca532fe070b83c610b5ee675b4d7b3164e6e5e Mon Sep 17 00:00:00 2001
From: Ansh Goyal
Date: Fri, 26 Apr 2024 09:17:47 +0530
Subject: [PATCH 6/7] Apply suggestions from code review
---
components/Calendar.tsx | 2 --
utils/staticHelpers.ts | 8 ++++----
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/components/Calendar.tsx b/components/Calendar.tsx
index 3b5c176dd8b..2805abf2f7c 100644
--- a/components/Calendar.tsx
+++ b/components/Calendar.tsx
@@ -29,8 +29,6 @@ export default function Calendar({ className = '', size }: ICalendarProps) {
'https://calendar.google.com/calendar/embed?src=c_q9tseiglomdsj6njuhvbpts11c%40group.calendar.google.com&ctz=UTC';
const eventsExist = eventsData.length > 0;
- console.log(getEvents(eventsData, size));
-
return (
diff --git a/utils/staticHelpers.ts b/utils/staticHelpers.ts
index b1175af762e..230f26da6ee 100644
--- a/utils/staticHelpers.ts
+++ b/utils/staticHelpers.ts
@@ -3,10 +3,10 @@ import moment from 'moment';
import type { IEvent } from '@/types/event';
/**
- *
- * @param events
- * @param size
- * @returns
+ * Retrieves events sorted by date.
+ * @param {IEvent[]} events - The list of events to retrieve.
+ * @param {number} [size] - The optional maximum number of events to return.
+ * @returns {any[]} The sorted list of events.
*/
export function getEvents(events: IEvent[], size?: number) {
let meetingsWithDates: any = events.map((event) => ({
From b7e5b9cd36cd107f9a19db43c147e36b33142cbc Mon Sep 17 00:00:00 2001
From: akshatnema
Date: Fri, 26 Apr 2024 14:52:47 +0530
Subject: [PATCH 7/7] resolved DemoAnimation and TextLink space
---
components/DemoAnimation.tsx | 3 ++-
components/typography/TextLink.tsx | 23 +++++++++++++----------
2 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/components/DemoAnimation.tsx b/components/DemoAnimation.tsx
index 5b888a6d8aa..0e8affd7628 100644
--- a/components/DemoAnimation.tsx
+++ b/components/DemoAnimation.tsx
@@ -358,7 +358,8 @@ export default function DemoAnimation({ className = '' }: IDemoAnimationProps) {
-
// Example
+ {/* eslint-disable-next-line react/jsx-no-comment-textnodes */}
+
// Example
{'{'}
diff --git a/components/typography/TextLink.tsx b/components/typography/TextLink.tsx
index d8d5d82c5cd..985604c3a35 100644
--- a/components/typography/TextLink.tsx
+++ b/components/typography/TextLink.tsx
@@ -24,15 +24,18 @@ export default function TextLink({ href, className = '', target = '_blank', chil
);
return (
-
- {children}
-
+ <>
+ {' '}
+
+ {children}
+
+ >
);
}