From 55e248dc3bc516d36ac231ce3492ae5a022031c5 Mon Sep 17 00:00:00 2001 From: Sasha Date: Thu, 23 Feb 2023 11:41:11 +0100 Subject: [PATCH] move ThemeProvider --- examples/web-chat/src/App.tsx | 60 ++++++++------------------------- examples/web-chat/src/index.tsx | 38 +++++++++++++++++++-- 2 files changed, 49 insertions(+), 49 deletions(-) diff --git a/examples/web-chat/src/App.tsx b/examples/web-chat/src/App.tsx index 51ec1f0..e1223e3 100644 --- a/examples/web-chat/src/App.tsx +++ b/examples/web-chat/src/App.tsx @@ -5,7 +5,6 @@ import "./App.css"; import handleCommand from "./command"; import Room from "./Room"; import { WakuContext } from "./WakuContext"; -import { ThemeProvider } from "@livechat/ui-kit"; import { generate } from "server-name-generator"; import { Message } from "./Message"; import { LightNode } from "@waku/interfaces"; @@ -14,35 +13,6 @@ import { PageDirection } from "@waku/interfaces"; import { useWaku, useFilterMessages, useStoreMessages } from "@waku/react"; -const themes = { - AuthorName: { - css: { - fontSize: "1.1em", - }, - }, - Message: { - css: { - margin: "0em", - padding: "0em", - fontSize: "0.83em", - }, - }, - MessageText: { - css: { - margin: "0em", - padding: "0.1em", - paddingLeft: "1em", - fontSize: "1.1em", - }, - }, - MessageGroup: { - css: { - margin: "0em", - padding: "0.2em", - }, - }, -}; - export const ChatContentTopic = "/toy-chat/2/huilong/proto"; const ChatDecoder = new Decoder(ChatContentTopic); @@ -96,22 +66,20 @@ export default function App() { style={{ height: "100vh", width: "100vw", overflow: "hidden" }} > - - { - handleCommand(input, node, setNick).then( - ({ command, response }) => { - const commandMessages = response.map((msg) => { - return Message.fromUtf8String(command, msg); - }); - console.log("trying to send", commandMessages); - } - ); - }} - /> - + { + handleCommand(input, node, setNick).then( + ({ command, response }) => { + const commandMessages = response.map((msg) => { + return Message.fromUtf8String(command, msg); + }); + console.log("trying to send", commandMessages); + } + ); + }} + /> ); diff --git a/examples/web-chat/src/index.tsx b/examples/web-chat/src/index.tsx index 5559780..967ee76 100644 --- a/examples/web-chat/src/index.tsx +++ b/examples/web-chat/src/index.tsx @@ -1,5 +1,6 @@ import React from "react"; import ReactDOM from "react-dom"; +import { ThemeProvider } from "@livechat/ui-kit"; import { LightNodeProvider } from "@waku/react"; import { wakuDnsDiscovery } from "@waku/dns-discovery"; import { Protocols } from "@waku/interfaces"; @@ -26,11 +27,42 @@ const options = { const protocols = [Protocols.Filter, Protocols.Store, Protocols.LightPush]; +const THEMES = { + AuthorName: { + css: { + fontSize: "1.1em", + }, + }, + Message: { + css: { + margin: "0em", + padding: "0em", + fontSize: "0.83em", + }, + }, + MessageText: { + css: { + margin: "0em", + padding: "0.1em", + paddingLeft: "1em", + fontSize: "1.1em", + }, + }, + MessageGroup: { + css: { + margin: "0em", + padding: "0.2em", + }, + }, +}; + ReactDOM.render( - - - + + + + + , document.getElementById("root") );