diff --git a/src/constants/index.ts b/src/constants/index.ts index 77b20b3bc7..78dd09b8dd 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -22,7 +22,7 @@ public class Example { // Registering types can reduce class name serialization // overhead but not mandatory. // If secure mode enabled - //all custom types must be registered. + // all custom types must be registered. fory.register(SomeClass.class); } diff --git a/src/pages/home/components/HomepageCodeDisplay.tsx b/src/pages/home/components/HomepageCodeDisplay.tsx index b1a6663bd9..cbd7ca636b 100644 --- a/src/pages/home/components/HomepageCodeDisplay.tsx +++ b/src/pages/home/components/HomepageCodeDisplay.tsx @@ -56,75 +56,131 @@ export default function HomepageCodeDisplay() { }); }; + const handleLeftArrowClick = () => { + const currentIndex = langs.indexOf(selectedLang); + setSelectedLang( + langs[currentIndex > 0 ? currentIndex - 1 : langs.length - 1] + ); + startAutoSlide(); + }; + + const handleRightArrowClick = () => { + const currentIndex = langs.indexOf(selectedLang); + setSelectedLang(langs[(currentIndex + 1) % langs.length]); + startAutoSlide(); + }; + return (
{/* Pic */}
programming-coding
{/* Code Box */}
- {/* Top Bar */} -
-
- {langs.map((lang) => ( - - ))} + + +
-
- - - {/* Code Area with animation and scroll */} - - +
+ {/* Top Bar */} +
+
+ {langs.map((lang) => ( + + ))} +
+
+ {/* Code Area with animation and scroll */} + + + +
+ + {CODE_EXAMPLES[selectedLang].code} + +
+
+
+
+
-
- - {CODE_EXAMPLES[selectedLang].code} - -
- - - + + + +
+
- ); }