From 7bb32d1a0bc61a7277e812641a9a1b7a2a2c7bc4 Mon Sep 17 00:00:00 2001 From: Laktionov Anton Date: Thu, 14 May 2026 20:25:06 +0300 Subject: [PATCH] =?UTF-8?q?=D1=80=D0=B0=D0=B7=D0=BE=D0=B1=D1=80=D0=B0?= =?UTF-8?q?=D0=BB=D0=B8=D1=81=D1=8C=20=D1=81=20=D1=87=D0=B8=D1=81=D1=82?= =?UTF-8?q?=D1=8B=D0=BC=D0=B8=20=D0=BA=D0=BE=D0=BC=D0=BF=D0=BE=D0=BD=D0=B5?= =?UTF-8?q?=D1=82=D0=B0=D0=BC=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.jsx | 2 ++ src/components/timer/index.jsx | 21 +++++++++++++++++++++ src/components/timer/index.module.scss | 0 3 files changed, 23 insertions(+) create mode 100644 src/components/timer/index.jsx create mode 100644 src/components/timer/index.module.scss diff --git a/src/App.jsx b/src/App.jsx index 410e373..f6f5121 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -2,11 +2,13 @@ import styles from './App.module.scss' import Header from './components/header' import ProductList from './components/list' +import Timer from './components/timer' const App = () => { return (
+
) diff --git a/src/components/timer/index.jsx b/src/components/timer/index.jsx new file mode 100644 index 0000000..329f073 --- /dev/null +++ b/src/components/timer/index.jsx @@ -0,0 +1,21 @@ +import React, { useState, useEffect } from 'react' +import styles from './index.module.scss' + +const Timer = () => { + const [seconds, setSeconds] = useState(0); + useEffect(() => { + const interval = setInterval(() => { + setSeconds(prev => prev + 1); + }, 1000); + return () => { + clearInterval(interval); + }; + }, []); + return ( +
+

Прошло секунд: {seconds}

+
+ ); +} + +export default Timer \ No newline at end of file diff --git a/src/components/timer/index.module.scss b/src/components/timer/index.module.scss new file mode 100644 index 0000000..e69de29