From 4996cc893c480ab77cf27a27801dba96771eadc5 Mon Sep 17 00:00:00 2001 From: MAZE Date: Sat, 12 Jul 2025 00:06:59 +0330 Subject: [PATCH] fix: fixate the binary pattern --- src/components/binary.astro | 7 +++++++ src/components/binary.tsx | 17 ----------------- src/components/source.astro | 4 ++-- 3 files changed, 9 insertions(+), 19 deletions(-) create mode 100644 src/components/binary.astro delete mode 100644 src/components/binary.tsx diff --git a/src/components/binary.astro b/src/components/binary.astro new file mode 100644 index 0000000..64d001a --- /dev/null +++ b/src/components/binary.astro @@ -0,0 +1,7 @@ +--- +import { generateRandomBinaryString } from '@/helpers/binary'; + +const binary = generateRandomBinaryString(1000); +--- + +{binary} diff --git a/src/components/binary.tsx b/src/components/binary.tsx deleted file mode 100644 index 2976906..0000000 --- a/src/components/binary.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { useState, useEffect } from 'react'; - -import { generateRandomBinaryString } from '@/helpers/binary'; - -export function Binary() { - const [binary, setBinary] = useState(''); - - useEffect(() => { - setBinary(generateRandomBinaryString(1000)); - - setInterval(() => { - setBinary(generateRandomBinaryString(1000)); - }, 200); - }, []); - - return {binary}; -} diff --git a/src/components/source.astro b/src/components/source.astro index 3a99113..40f826f 100644 --- a/src/components/source.astro +++ b/src/components/source.astro @@ -3,7 +3,7 @@ import { FaGithub } from 'react-icons/fa/index'; import { SpecialButton } from './special-button'; import { Container } from './container'; -import { Binary } from './binary'; +import Binary from './binary.astro'; ---
@@ -25,7 +25,7 @@ import { Binary } from './binary';
-
+