Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: nexti18nSetup for OG tags error #3111

Merged
merged 56 commits into from
Sep 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
f1a57a0
initial commit
sambhavgupta0705 Jul 23, 2024
69c43f2
Merge branch 'master' into ogtags
sambhavgupta0705 Jul 23, 2024
960d694
fixes
sambhavgupta0705 Jul 23, 2024
10a2516
package.json changes
sambhavgupta0705 Jul 23, 2024
6f8e0fb
fixing local host url
sambhavgupta0705 Jul 23, 2024
e70371e
foixed caseStudies
sambhavgupta0705 Jul 23, 2024
ec0864a
home page fix
sambhavgupta0705 Jul 23, 2024
679f6bc
fixed GH button
sambhavgupta0705 Jul 23, 2024
85485e9
fixed linting
sambhavgupta0705 Jul 23, 2024
66debb3
fixed linting
sambhavgupta0705 Jul 23, 2024
96d4691
fixed githubButton
sambhavgupta0705 Jul 23, 2024
863fdc7
react-i18next
sambhavgupta0705 Aug 9, 2024
fb522bd
Merge branch 'master' into ogtags
sambhavgupta0705 Aug 9, 2024
805dbf7
backticks fix
sambhavgupta0705 Aug 9, 2024
a5506e9
Merge branch 'master' into ogtags
sambhavgupta0705 Aug 13, 2024
9b97fc0
Merge branch 'master' into ogtags
akshatnema Aug 15, 2024
5d99ef2
Merge branch 'master' into ogtags
akshatnema Aug 17, 2024
23c3f29
updated package-lock.json
akshatnema Aug 17, 2024
c404023
removed lint errors
akshatnema Aug 17, 2024
d764b8e
Merge branch 'master' into ogtags
akshatnema Aug 17, 2024
b966aff
Merge branch 'master' into ogtags
sambhavgupta0705 Aug 20, 2024
6a04253
package-lock.json
sambhavgupta0705 Aug 20, 2024
407a96a
package-lock.json changes
sambhavgupta0705 Aug 22, 2024
db5a459
package-lock.json changes2
sambhavgupta0705 Aug 22, 2024
07cbf4b
Merge branch 'master' into ogtags
sambhavgupta0705 Aug 22, 2024
46bc14b
rtesolving merge conflicts
sambhavgupta0705 Aug 29, 2024
8518729
resolving merge conflicts
sambhavgupta0705 Aug 29, 2024
23161d7
resolving merge conflicts
sambhavgupta0705 Aug 29, 2024
94560ff
resolving conflicts
sambhavgupta0705 Aug 30, 2024
56dabcc
merge conflicts
sambhavgupta0705 Aug 30, 2024
f2cd8e8
package changes
sambhavgupta0705 Aug 30, 2024
a11b129
fix package-lock
JeelRajodiya Aug 30, 2024
56cdf32
fix mdx
JeelRajodiya Aug 30, 2024
ea9048f
Merge branch 'asyncapi:master' into ogtags-package-fix
JeelRajodiya Aug 30, 2024
ef89be9
fix: date warnings
JeelRajodiya Aug 30, 2024
01fcb80
Merge branch 'asyncapi:master' into ogtags-package-fix
JeelRajodiya Aug 30, 2024
3bf1b18
Merge pull request #2 from sambhavgupta0705/ogtags-package-fix
sambhavgupta0705 Aug 31, 2024
24233a8
fixed lint errors
akshatnema Aug 31, 2024
e879cd3
fix
sambhavgupta0705 Aug 31, 2024
451f48d
Merge branch 'master' into ogtags
sambhavgupta0705 Sep 3, 2024
671b0ba
temporary commit
sambhavgupta0705 Sep 3, 2024
3bbbe4f
temporary commit
sambhavgupta0705 Sep 3, 2024
a3d0dbe
temporary commit
sambhavgupta0705 Sep 3, 2024
81fce4f
revert breaking changes
sambhavgupta0705 Sep 3, 2024
ff6c0b4
Merge branch 'master' into ogtags
sambhavgupta0705 Sep 3, 2024
5d43180
space fixes
sambhavgupta0705 Sep 3, 2024
8b88156
Merge branch 'master' into ogtags
sambhavgupta0705 Sep 3, 2024
428bf11
test
sambhavgupta0705 Sep 3, 2024
420ec89
Merge branch 'ogtags' of github.com:sambhavgupta0705/asyncapi_website…
sambhavgupta0705 Sep 3, 2024
6bc1848
test
sambhavgupta0705 Sep 3, 2024
1f20cba
Merge branch 'master' into ogtags
sambhavgupta0705 Sep 4, 2024
a1e0906
Merge branch 'master' into ogtags
sambhavgupta0705 Sep 5, 2024
62c1c2d
featured blog post file changes
sambhavgupta0705 Sep 6, 2024
bf1b1ee
Merge branch 'ogtags' of github.com:sambhavgupta0705/asyncapi_website…
sambhavgupta0705 Sep 6, 2024
cff22dd
Merge branch 'master' into ogtags
sambhavgupta0705 Sep 6, 2024
d2740c4
lint error fix
sambhavgupta0705 Sep 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/CaseStudyCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function CaseStudyCard({ studies = [] }: ICaseStudyCardProps) {
return (
<div className='flex flex-wrap pt-10 lg:grid lg:grid-cols-3 lg:gap-8 lg:text-center'>
{studies.map((study, index) => (
<a key={index} href={`casestudies/${study.id}`}>
<a key={index} href={`${study.id}`}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of a, we should use Link tag to navigate internal pages of website.

Copy link
Contributor

@JeelRajodiya JeelRajodiya Aug 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of a, we should use Link tag to navigate internal pages of website.

Should we create a new issue for it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<div
className='max-w-sm overflow-hidden rounded-md border border-gray-200 bg-white p-4'
data-testid='CaseStudyCard-main'
Expand Down
2 changes: 1 addition & 1 deletion components/Head.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function HeadComponent({
rssTitle = 'RSS Feed for AsyncAPI Initiative Blog',
rssLink = '/rss.xml'
}: IHeadProps) {
const url = process.env.DEPLOY_PRIME_URL || process.env.DEPLOY_URL || 'http://localhost:3000';
const url = process.env.NEXT_PUBLIC_DEPLOY_PRIME_URL || process.env.NEXT_PUBLIC_DEPLOY_URL || 'http://localhost:3000';
const appContext = useContext(AppContext);
const { path = '' } = appContext || {};
let currImage = image;
Expand Down
309 changes: 153 additions & 156 deletions components/MDX/MDX.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import Profiles from '../Profiles';
import Remember from '../Remember';
import Sponsors from '../sponsors/Sponsors';
import Warning from '../Warning';
import { Table, TableCell, TableHeader, TableRow } from './MDXTable';
import { Table, TableBody, TableCell, TableHeader, TableRow, Thead } from './MDXTable';

let mermaidInitialized = false;

Expand Down Expand Up @@ -175,164 +175,161 @@ function Text({ content = '', className = '' }) {
/**
* @description This function returns MDX components.
*/
export function getMDXComponents() {
return {
h1: (props: React.HTMLProps<HTMLHeadingElement>) => (
<h1
{...props}
className={`${props.className || ''} my-4 font-heading text-2xl font-semibold tracking-heading text-gray-900 antialiased`}
/>
),
h2: (props: React.HTMLProps<HTMLHeadingElement>) => (
<h2
{...props}
className={`${props.className || ''} mb-4 mt-6 font-heading text-2xl font-semibold tracking-heading text-gray-900 antialiased`}
/>
),
h3: (props: React.HTMLProps<HTMLHeadingElement>) => (
<h3
{...props}
className={`${props.className || ''} mb-4 mt-6 font-heading text-lg font-medium tracking-heading text-gray-900 antialiased`}
/>
),
h4: (props: React.HTMLProps<HTMLHeadingElement>) => (
<h4
{...props}
className={`${props.className || ''} text-md my-4 font-heading font-medium text-gray-900 antialiased`}
/>
),
h5: (props: React.HTMLProps<HTMLHeadingElement>) => (
<h5 {...props} className={`${props.className || ''} text-md my-4 font-heading font-bold antialiased`} />
),
h6: (props: React.HTMLProps<HTMLHeadingElement>) => (
<h6
{...props}
className={`${props.className || ''} my-4 font-heading text-sm font-bold uppercase text-gray-900 antialiased`}
/>
),
blockquote: (props: React.HTMLProps<HTMLQuoteElement>) => (
<blockquote
{...props}
className={`${props.className || ''} my-4 border-l-4 border-gray-400 bg-white py-1 pl-4 pr-1 font-body italic text-gray-700 antialiased`}
/>
),
p: (props: React.HTMLProps<HTMLParagraphElement>) => (
<p {...props} className={`${props.className || ''} my-4 font-body font-regular text-gray-700 antialiased`} />
),
strong: (props: React.HTMLProps<HTMLSpanElement>) => (
<strong
{...props}
className={`${props.className || ''} my-4 font-body font-semibold text-gray-800 antialiased`}
/>
),
a: (props: React.HTMLProps<HTMLAnchorElement>) => (
<a
{...props}
className={`${props.className || 'border-b border-secondary-400 font-semibold text-gray-900 transition duration-300 ease-in-out hover:border-secondary-500'} font-body antialiased`}
/>
),
ul: (props: React.HTMLProps<HTMLUListElement>) => (
<ul
{...props}
className={`${props.className || ''} font-normal my-4 ml-4 list-disc font-body text-gray-700 antialiased`}
/>
),
ol: (props: React.HTMLProps<HTMLOListElement>) => (
<ol
{...props}
className={`${props.className || ''} font-normal my-4 ml-4 list-decimal font-body text-gray-700 antialiased`}
type='1'
/>
),
li: (props: React.HTMLProps<HTMLLIElement>) => (
<li
{...props}
className={`${props.className || ''} my-3 font-body font-regular tracking-tight text-gray-700 antialiased`}
/>
),
button: Button as React.ComponentType<React.ButtonHTMLAttributes<HTMLButtonElement>>,
table: (props: React.HTMLProps<HTMLTableElement>) => (
<div className={`${props.className || ''} flex flex-col`}>
<div className='my-2 overflow-x-auto py-2 sm:-mx-6 sm:px-6 lg:-mx-8 lg:px-8'>
<div className='inline-block w-full overflow-auto border-b border-gray-200 align-middle shadow sm:rounded-lg'>
<table {...props} className={`${props.className || ''} w-full`} />
</div>
const getMDXComponents = {
h1: (props: React.HTMLProps<HTMLHeadingElement>) => (
<h1
{...props}
className={`${props.className || ''} my-4 font-heading text-2xl font-semibold tracking-heading text-gray-900 antialiased`}
/>
),
h2: (props: React.HTMLProps<HTMLHeadingElement>) => (
<h2
{...props}
className={`${props.className || ''} mb-4 mt-6 font-heading text-2xl font-semibold tracking-heading text-gray-900 antialiased`}
/>
),
h3: (props: React.HTMLProps<HTMLHeadingElement>) => (
<h3
{...props}
className={`${props.className || ''} mb-4 mt-6 font-heading text-lg font-medium tracking-heading text-gray-900 antialiased`}
/>
),
h4: (props: React.HTMLProps<HTMLHeadingElement>) => (
<h4
{...props}
className={`${props.className || ''} text-md my-4 font-heading font-medium text-gray-900 antialiased`}
/>
),
h5: (props: React.HTMLProps<HTMLHeadingElement>) => (
<h5 {...props} className={`${props.className || ''} text-md my-4 font-heading font-bold antialiased`} />
),
h6: (props: React.HTMLProps<HTMLHeadingElement>) => (
<h6
{...props}
className={`${props.className || ''} my-4 font-heading text-sm font-bold uppercase text-gray-900 antialiased`}
/>
),
blockquote: (props: React.HTMLProps<HTMLQuoteElement>) => (
<blockquote
{...props}
className={`${props.className || ''} my-4 border-l-4 border-gray-400 bg-white py-1 pl-4 pr-1 font-body italic text-gray-700 antialiased`}
/>
),
p: (props: React.HTMLProps<HTMLParagraphElement>) => (
<p {...props} className={`${props.className || ''} my-4 font-body font-regular text-gray-700 antialiased`} />
),
strong: (props: React.HTMLProps<HTMLSpanElement>) => (
<strong {...props} className={`${props.className || ''} my-4 font-body font-semibold text-gray-800 antialiased`} />
),
a: (props: React.HTMLProps<HTMLAnchorElement>) => (
<a
{...props}
className={`${props.className || 'border-b border-secondary-400 font-semibold text-gray-900 transition duration-300 ease-in-out hover:border-secondary-500'} font-body antialiased`}
/>
),
ul: (props: React.HTMLProps<HTMLUListElement>) => (
<ul
{...props}
className={`${props.className || ''} font-normal my-4 ml-4 list-disc font-body text-gray-700 antialiased`}
/>
),
ol: (props: React.HTMLProps<HTMLOListElement>) => (
<ol
{...props}
className={`${props.className || ''} font-normal my-4 ml-4 list-decimal font-body text-gray-700 antialiased`}
type='1'
/>
),
li: (props: React.HTMLProps<HTMLLIElement>) => (
<li
{...props}
className={`${props.className || ''} my-3 font-body font-regular tracking-tight text-gray-700 antialiased`}
/>
),
button: Button as React.ComponentType<React.ButtonHTMLAttributes<HTMLButtonElement>>,
table: (props: React.HTMLProps<HTMLTableElement>) => (
<div className={`${props.className || ''} flex flex-col`}>
<div className='my-2 overflow-x-auto py-2 sm:-mx-6 sm:px-6 lg:-mx-8 lg:px-8'>
<div className='inline-block w-full overflow-auto border-b border-gray-200 align-middle shadow sm:rounded-lg'>
<table {...props} className={`${props.className || ''} w-full`} />
</div>
</div>
),
th: (props: React.HTMLProps<HTMLTableCellElement>) => (
<th
{...props}
className={`${props.className || ''} border-b border-gray-200 bg-gray-100 px-6 py-3 text-left font-body text-xs font-medium uppercase leading-4 tracking-wider text-gray-900`}
/>
),
tr: (props: React.HTMLProps<HTMLTableRowElement>) => (
<tr {...props} className={`${props.className || ''} bg-white`} />
),
td: (props: React.HTMLProps<HTMLTableCellElement>) => (
<td
{...props}
className={`${props.className || ''} border-b border-gray-200 px-6 py-4 text-sm leading-5 tracking-tight text-gray-700`}
/>
),
pre: (props: React.HTMLProps<HTMLPreElement>) => CodeComponent((props.children as React.ReactElement)?.props),
code: (props: React.HTMLProps<HTMLElement>) => (
<code
{...props}
className={`${props.className || ''} rounded bg-gray-200 px-1 py-0.5 font-mono text-sm text-gray-800`}
/>
),
hr: (props: React.HTMLProps<HTMLHRElement>) => <hr {...props} className={`${props.className || ''} my-8`} />,
Link: (props: React.HTMLProps<HTMLHRElement>) => (
<Link
href={props.href || '/'}
className='border-b border-secondary-400 font-body font-semibold text-gray-900 antialiased transition duration-300 ease-in-out hover:border-secondary-500'
>
{props.children}
</Link>
),
Tr: TableRow,
Td: TableCell,
Th: TableHeader,
Table,
Asyncapi3ChannelComparison,
Asyncapi3IdAndAddressComparison,
Asyncapi3MetaComparison,
Asyncapi3OperationComparison,
Asyncapi3ParameterComparison,
Asyncapi3SchemaFormatComparison,
Asyncapi3ServerComparison,
CodeBlock,
ChapterSuggestions,
YouTube,
Remember,
Text,
Warning,
Sponsors,
FAQ,
Caption,
Row,
Column,
Figure,
DocsCards,
GeneratorInstallation,
NewsletterSubscribe,
TwitterTimelineEmbed,
TwitterShareButton,
TwitterFollowButton,
TwitterHashtagButton,
TwitterMentionButton,
TwitterTweetEmbed,
TwitterMomentShare,
TwitterDMButton,
TwitterVideoEmbed,
TwitterOnAirButton,
Profiles,
Visualizer
};
}
</div>
),
th: (props: React.HTMLProps<HTMLTableCellElement>) => (
<th
{...props}
className={`${props.className || ''} border-b border-gray-200 bg-gray-100 px-6 py-3 text-left font-body text-xs font-medium uppercase leading-4 tracking-wider text-gray-900`}
/>
),
tr: (props: React.HTMLProps<HTMLTableRowElement>) => (
<tr {...props} className={`${props.className || ''} bg-white`} />
),
td: (props: React.HTMLProps<HTMLTableCellElement>) => (
<td
{...props}
className={`${props.className || ''} border-b border-gray-200 px-6 py-4 text-sm leading-5 tracking-tight text-gray-700`}
/>
),
pre: (props: React.HTMLProps<HTMLPreElement>) => CodeComponent((props.children as React.ReactElement)?.props),
code: (props: React.HTMLProps<HTMLElement>) => (
<code
{...props}
className={`${props.className || ''} rounded bg-gray-200 px-1 py-0.5 font-mono text-sm text-gray-800`}
/>
),
hr: (props: React.HTMLProps<HTMLHRElement>) => <hr {...props} className={`${props.className || ''} my-8`} />,
Link: (props: React.HTMLProps<HTMLHRElement>) => (
<Link
href={props.href || '/'}
className='border-b border-secondary-400 font-body font-semibold text-gray-900 antialiased transition duration-300 ease-in-out hover:border-secondary-500'
>
{props.children}
</Link>
),
Tr: TableRow,
Td: TableCell,
Th: TableHeader,
Tbody: TableBody,
Thead,
Table,
Asyncapi3ChannelComparison,
Asyncapi3IdAndAddressComparison,
Asyncapi3MetaComparison,
Asyncapi3OperationComparison,
Asyncapi3ParameterComparison,
Asyncapi3SchemaFormatComparison,
Asyncapi3ServerComparison,
CodeBlock,
ChapterSuggestions,
YouTube,
Remember,
Text,
Warning,
Sponsors,
Caption,
Row,
Column,
Figure,
FAQ,
DocsCards,
GeneratorInstallation,
NewsletterSubscribe,
TwitterTimelineEmbed,
TwitterShareButton,
TwitterFollowButton,
TwitterHashtagButton,
TwitterMentionButton,
TwitterTweetEmbed,
TwitterMomentShare,
TwitterDMButton,
TwitterVideoEmbed,
TwitterOnAirButton,
Profiles,
Visualizer
};

const mdxComponents = getMDXComponents();
export const mdxComponents = getMDXComponents;

interface MDXProviderProps {
children: React.ReactNode;
Expand Down
20 changes: 20 additions & 0 deletions components/MDX/MDXTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,23 @@ export function TableHeader(props: React.HTMLProps<HTMLTableCellElement>) {
/>
);
}

/**
* Renders the body of a table.
*
* @param props - The HTML props for the `<tbody>` element.
* @returns The rendered `<tbody>` element.
*/
export function TableBody(props: React.HTMLProps<HTMLTableSectionElement>) {
return <tbody {...props} className={`${props.className || ''}`} />;
}

/**
* Renders the body of a table.
*
* @param props - The HTML props for the `<tbody>` element.
* @returns The rendered `<tbody>` element.
*/
export function Thead(props: React.HTMLProps<HTMLTableSectionElement>) {
return <thead {...props} className={`${props.className || ''}`} />;
}
2 changes: 1 addition & 1 deletion components/NewsletterSubscribe.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useTranslation } from 'next-i18next';
import { useState } from 'react';

import IconCircularLoader from '@/components/icons/CircularLoader';
import { ButtonType } from '@/types/components/buttons/ButtonPropsType';
import { InputTypes } from '@/types/components/InputBoxPropsType';
import { HeadingLevel, HeadingTypeStyle } from '@/types/typography/Heading';

import { useTranslation } from '../utils/i18n';
import Button from './buttons/Button';
import InputBox from './InputBox';
import Loader from './Loader';
Expand Down
2 changes: 1 addition & 1 deletion components/dashboard/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function Header() {
href='https://github.com/asyncapi?type=source#-contribute-to-asyncapi'
target='_blank'
/>
<GithubButton className='lg:mt-0' />
<GithubButton text='View on Github' className='lg:mt-0' />
<SlackButton className='lg:mt-0' />
</div>
</div>
Expand Down
3 changes: 1 addition & 2 deletions components/link.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import Link from 'next/link';
import { useRouter } from 'next/router';

import { defaultLanguage, languages } from '../utils/i18n';
import i18nPaths from '../utils/i18nPaths';
import { defaultLanguage, i18nPaths, languages } from '@/utils/i18n';

interface LinkComponentProps {
children: React.ReactNode;
Expand Down
Loading
Loading