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

feat: implement redesign of the home page #3600

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
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
12 changes: 12 additions & 0 deletions components/CodeAnimation/AsyncAPIcontent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* @description Renders the content related to AsyncAPI in a styled div container.
* This is used as the default content for the "AsyncAPI Document" tab in the DemoAnimation component.
*/

export default function renderAsyncAPIContent() {
return (
<div className="font-mono text-sm text-[#98c379] leading-relaxed">
content here
</div>
)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Correct function syntax and code style issues

The function has several problems:

  • Missing semicolons.
  • Unexpected usage of double quotes in JSX attributes.
  • Misplaced braces and indentation.

Apply this diff to fix the issues:

-export default function renderAsyncAPIContent() {
-    return (
-        <div className="font-mono text-sm text-[#98c379] leading-relaxed">
-          content here
-        </div>
-    )
-}
+export default function renderAsyncAPIContent() {
+  return (
+    <div className='font-mono text-sm text-[#98c379] leading-relaxed'>
+      content here
+    </div>
+  );
+}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export default function renderAsyncAPIContent() {
return (
<div className="font-mono text-sm text-[#98c379] leading-relaxed">
content here
</div>
)
}
export default function renderAsyncAPIContent() {
return (
<div className='font-mono text-sm text-[#98c379] leading-relaxed'>
content here
</div>
);
}
🧰 Tools
🪛 eslint

[error] 7-10: Replace ··return·(⏎········<div·className="font-mono·text-sm·text-[#98c379]·leading-relaxed">⏎··········content·here⏎········</div> with return·<div·className='font-mono·text-sm·text-[#98c379]·leading-relaxed'>content·here</div>;

(prettier/prettier)


[error] 8-8: Unexpected usage of doublequote.

(jsx-quotes)


[error] 11-11: Replace ····) with }

(prettier/prettier)


[error] 11-12: Missing semicolon.

(semi)


[error] 12-12: Delete }

(prettier/prettier)


[error] 12-12: Newline required at end of file but not found.

(eol-last)

12 changes: 12 additions & 0 deletions components/CodeAnimation/CodeGeneration.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* @description Renders the content related to code generation in a styled div container.
* This is used as the content for the "Code Generation" tab in the DemoAnimation component.
*/

export default function renderCodeGeneration() {
return (
<div className="font-mono text-sm leading-relaxed">
<h1 className="text-[#98c379]">content here</h1>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add proper content instead of placeholder text.

The component currently displays a placeholder text "content here". Since this is part of the demo animation showcasing code generation features, it should contain meaningful content demonstrating the actual code generation capabilities.

Would you like me to help generate sample content that demonstrates code generation features?

🧰 Tools
🪛 eslint

[error] 8-8: Replace ········<div·className="font-mono·text-sm·leading-relaxed" with ····<div·className='font-mono·text-sm·leading-relaxed'

(prettier/prettier)


[error] 8-8: Unexpected usage of doublequote.

(jsx-quotes)


[error] 9-9: Replace ············<h1·className="text-[#98c379]" with ······<h1·className='text-[#98c379]'

(prettier/prettier)


[error] 9-9: Unexpected usage of doublequote.

(jsx-quotes)


[error] 10-10: Replace ········ with ····

(prettier/prettier)

)
}
70 changes: 70 additions & 0 deletions components/CodeAnimation/DemoAnimation.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import React, { useState } from 'react';
import renderAsyncAPIContent from './AsyncAPIcontent';
import renderCodeGeneration from './CodeGeneration';
import renderDocumentation from './Documentation';
import Container from '../layout/Container';

/**
* @description A React component that displays a demo animation interface with three tabs:
* "AsyncAPI Document," "Code Generation," and "Documentation." The content of each tab
* dynamically updates based on the active tab selected by the user.
*
*/

export default function DemoAnimation() {
const [activeTab, setActiveTab] = useState('AsyncAPI Document');
const tabs = ['AsyncAPI Document', 'Code Generation', 'Documentation'];


/**
* @description Determines and renders the content for the currently active tab.
*/

const renderContent = () => {
switch (activeTab) {
case 'Code Generation':
return renderCodeGeneration();
case 'Documentation':
return renderDocumentation();
default:
return renderAsyncAPIContent();
}
};

return (
<div className="relative left-1/2 right-1/2 -mx-[50vw] w-screen bg-blue-100 p-6 font-sans">
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Optimize Tailwind CSS classes.

The pipeline indicates issues with Tailwind CSS classes:

-    <div className="relative left-1/2 right-1/2 -mx-[50vw] w-screen bg-blue-100 p-6 font-sans">
+    <div className="relative inset-x-1/2 mx-[-50vw] w-screen bg-blue-100 p-6 font-sans">
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div className="relative left-1/2 right-1/2 -mx-[50vw] w-screen bg-blue-100 p-6 font-sans">
<div className="relative inset-x-1/2 mx-[-50vw] w-screen bg-blue-100 p-6 font-sans">
🧰 Tools
🪛 eslint

[error] 35-35: Replace "relative·left-1/2·right-1/2·-mx-[50vw]·w-screen·bg-blue-100·p-6·font-sans" with 'relative·left-1/2·right-1/2·-mx-[50vw]·w-screen·bg-blue-100·p-6·font-sans'

(prettier/prettier)


[error] 35-35: Unexpected usage of doublequote.

(jsx-quotes)

🪛 GitHub Actions: PR testing - if Node project

[warning] 35-35: Multiple Tailwind CSS issues: Arbitrary value '-mx-[50vw]' should not start with dash, and classnames 'left-1/2, right-1/2' could use 'inset-x-1/2' shorthand

<Container>
<h1 className="text-2xl font-medium text-center mb-2">
Sneak Peek Into The Real Process
</h1>
<p className="text-center text-gray-600 text-sm mb-6">
One of our main goals is to improve the current state of Event<br />
Driven Architecture (EDA!)
</p>
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Localize hardcoded strings.

Text strings should be localized for better internationalization support:

-        Sneak Peek Into The Real Process
+        {t('landing-page.demo.title')}
       </h1>
       <p className="text-center text-gray-600 text-sm mb-6">
-        One of our main goals is to improve the current state of Event<br />
-        Driven Architecture (EDA!)
+        {t('landing-page.demo.description')}
       </p>

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 eslint

[error] 40-40: Replace ······<p·className="text-center·text-gray-600·text-sm·mb-6" with ········<p·className='text-center·text-gray-600·text-sm·mb-6'

(prettier/prettier)


[error] 40-40: Unexpected usage of doublequote.

(jsx-quotes)


[error] 41-41: Replace ········One·of·our·main·goals·is·to·improve·the·current·state·of·Event with ··········One·of·our·main·goals·is·to·improve·the·current·state·of·Event⏎··········

(prettier/prettier)


[error] 42-42: Insert ··

(prettier/prettier)


[error] 43-43: Insert ··

(prettier/prettier)


<div className="flex flex-wrap mb-4 bg-black rounded-lg overflow-hidden">
{tabs.map((tab) => (
<button
key={tab}
className={`flex-1 py-2 px-4 m-2 text-center rounded text-sm transition-colors duration-200 ${activeTab === tab
? 'bg-white text-black'
: 'bg-gray-700 text-gray-300 hover:bg-gray-800'
}`}
onClick={() => setActiveTab(tab)}
>
{tab}
</button>
))}
</div>

<div className="bg-[#1a1b26] rounded-lg p-6 min-h-[400px] transition-all duration-200">
<div className="overflow-auto max-w-full">
<div className="overflow-x-auto whitespace-pre-wrap">
{renderContent()}
</div>
</div>
</div>
</Container>
</div>
);
};
12 changes: 12 additions & 0 deletions components/CodeAnimation/Documentation.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* @description Renders the documentation content in a styled container.
* This is used as the content for the "Documentation" tab in the DemoAnimation component.
*/

export default function renderDocumentation() {
return (
<div className="text-white font-sans">
<h1 className="text-xl font-semibold mb-4">Documentation</h1>
</div>
)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix syntax and adhere to code style guidelines

There are several issues in this function:

  • Missing semicolons at the end of statements.
  • Unexpected usage of double quotes in JSX attributes; single quotes are preferred.
  • Incorrect indentation.

Apply this diff to correct the issues:

-export default function renderDocumentation() {
-    return (
-        <div className="text-white font-sans">
-            <h1 className="text-xl font-semibold mb-4">Documentation</h1>
-        </div>
-    )
-}
+export default function renderDocumentation() {
+  return (
+    <div className='text-white font-sans'>
+      <h1 className='text-xl font-semibold mb-4'>Documentation</h1>
+    </div>
+  );
+}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export default function renderDocumentation() {
return (
<div className="text-white font-sans">
<h1 className="text-xl font-semibold mb-4">Documentation</h1>
</div>
)
}
export default function renderDocumentation() {
return (
<div className='text-white font-sans'>
<h1 className='text-xl font-semibold mb-4'>Documentation</h1>
</div>
);
}
🧰 Tools
🪛 eslint

[error] 7-7: Delete ··

(prettier/prettier)


[error] 8-8: Replace ········<div·className="text-white·font-sans" with ····<div·className='text-white·font-sans'

(prettier/prettier)


[error] 8-8: Unexpected usage of doublequote.

(jsx-quotes)


[error] 9-9: Replace ············<h1·className="text-xl·font-semibold·mb-4" with ······<h1·className='text-xl·font-semibold·mb-4'

(prettier/prettier)


[error] 9-9: Unexpected usage of doublequote.

(jsx-quotes)


[error] 10-10: Replace ········ with ····

(prettier/prettier)


[error] 11-11: Replace ··) with );

(prettier/prettier)


[error] 11-12: Missing semicolon.

(semi)


[error] 12-12: Newline required at end of file but not found.

(eol-last)


[error] 12-12: Insert

(prettier/prettier)

🪛 GitHub Actions: PR testing - if Node project

[warning] 6-6: Missing JSDoc comment

Loading
Loading