From b1d68ac307ed87d63e83820cbdf843fff0fd9f7f Mon Sep 17 00:00:00 2001 From: polwex Date: Thu, 11 Sep 2025 01:48:14 +0700 Subject: init --- front/src/components/modals/Modal.tsx | 72 +++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 front/src/components/modals/Modal.tsx (limited to 'front/src/components/modals/Modal.tsx') diff --git a/front/src/components/modals/Modal.tsx b/front/src/components/modals/Modal.tsx new file mode 100644 index 0000000..7dd688c --- /dev/null +++ b/front/src/components/modals/Modal.tsx @@ -0,0 +1,72 @@ +import useLocalState from "@/state/state"; +import { useEffect, useRef, useState } from "react"; + +function Modal({ children }: any) { + const { setModal } = useLocalState(); + function onKey(event: any) { + if (event.key === "Escape") setModal(null); + } + useEffect(() => { + document.addEventListener("keyup", onKey); + return () => { + document.removeEventListener("keyup", onKey); + }; + }, [children]); + + function clickAway(e: React.MouseEvent) { + console.log("clicked away"); + e.stopPropagation(); + if (!modalRef.current || !modalRef.current.contains(e.target)) + setModal(null); + } + const modalRef = useRef(null); + return ( + + ); +} +export default Modal; + +export function Welcome() { + return ( + +
+

Welcome to Nostril!

+

+ Trill is the world's only truly free and sovereign social media + platform, powered by Urbit. +

+

+ Click on the crow icon on the top left to see all available feeds. +

+

The Global feed should be populated by default.

+

Follow people soon so your Global feed doesn't go stale.

+

+ Trill is still on beta. The UI is Mobile only, we recommend you use + your phone or the browser dev tools. Desktop UI is on the works. +

+

+ If you have any feedback please reach out to us on Groups at + ~hoster-dozzod-sortug/trill or here at ~polwex +

+
+
+ ); +} + +export function Tooltip({ children, text, className }: any) { + const [show, toggle] = useState(false); + return ( +
toggle(true)} + onMouseOut={() => toggle(false)} + > + {children} + {show &&
{text}
} +
+ ); +} -- cgit v1.2.3