From cb41489a7e9c37e0c37b7d70b686a20d1187fe6b Mon Sep 17 00:00:00 2001 From: "ildar.timerbaev" Date: Mon, 16 Dec 2024 09:53:34 +0300 Subject: [PATCH] Show current room in a center's button --- src/features/ecency-center/center-button.tsx | 16 ++++- .../ecency-live/ecency-live-wave-icon.scss | 43 +++++++++++++ .../ecency-live/ecency-live-wave-icon.tsx | 62 +++++++++++++++++++ 3 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 src/features/ecency-live/ecency-live-wave-icon.scss create mode 100644 src/features/ecency-live/ecency-live-wave-icon.tsx diff --git a/src/features/ecency-center/center-button.tsx b/src/features/ecency-center/center-button.tsx index 8aa3d3c7e..f0a9697e1 100644 --- a/src/features/ecency-center/center-button.tsx +++ b/src/features/ecency-center/center-button.tsx @@ -1,11 +1,16 @@ import { motion } from "framer-motion"; import Image from "next/image"; +import { useEcencyLive } from "@/features/ecency-live"; +import { UilMicrophoneSlash } from "@tooni/iconscout-unicons-react"; +import { EcencyLiveWaveIcon } from "@/features/ecency-live/ecency-live-wave-icon"; interface Props { onClick?: () => void; } export function CenterButton(props: Props) { + const { room, activeUserState } = useEcencyLive(); + return ( -
Center
+
+
Center
+ {room && ( +
+ + {room.name} + {activeUserState?.micMuted && } +
+ )} +
); } diff --git a/src/features/ecency-live/ecency-live-wave-icon.scss b/src/features/ecency-live/ecency-live-wave-icon.scss new file mode 100644 index 000000000..fc71e4ee3 --- /dev/null +++ b/src/features/ecency-live/ecency-live-wave-icon.scss @@ -0,0 +1,43 @@ +html, body { + height: 100%; +} + +body { + background: #101010; +} + +.loader { + display: flex; + align-items: center; + justify-content: center; + height: 100%; +} + +#wave { + height: 20px; + width: 20px; +} + +@for $i from 1 through 9 { + #Line_#{$i} { + animation: pulseWave 1s infinite; + animation-delay: $i * .15s; + } +} + +@keyframes pulseWave { + 0% { + transform: scaleY(1); + transform-origin: 50% 50%; + } + + 50% { + transform: scaleY(.7); + transform-origin: 50% 50%; + } + + 100% { + transform: scaleY(1); + transform-origin: 50% 50%; + } +} \ No newline at end of file diff --git a/src/features/ecency-live/ecency-live-wave-icon.tsx b/src/features/ecency-live/ecency-live-wave-icon.tsx new file mode 100644 index 000000000..6c6871b88 --- /dev/null +++ b/src/features/ecency-live/ecency-live-wave-icon.tsx @@ -0,0 +1,62 @@ +import "./ecency-live-wave-icon.scss"; + +export function EcencyLiveWaveIcon() { + return ( +
+ + Audio Wave + + + + + + + + + + +
+ ); +}