refactor: add tailwindcss

This commit is contained in:
Tristan Yang
2022-10-26 08:31:38 +08:00
parent 0560170484
commit 23320ab637
11 changed files with 105 additions and 151 deletions
+3
View File
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
+1 -3
View File
@@ -1,14 +1,12 @@
import ReactDOM from "react-dom/client";
import { Reset } from "styled-reset";
import Embed from "./embed/index";
import "./assets/base.css";
import './assets/index.css';
import MarkdownStyleOverride from "./common/component/MarkdownStyleOverride";
const root = ReactDOM.createRoot(document.getElementById("root") as HTMLElement);
root.render(
<>
<Reset />
<Embed />
<MarkdownStyleOverride />
</>
+3 -7
View File
@@ -1,13 +1,9 @@
import React from "react";
import styled from "styled-components";
const Styled = styled.section`
width: 800px;
height: 800px;
`;
// import React from "react";
type Props = {};
const Chat = (props: Props) => {
return <Styled>Chat</Styled>;
return <div className=" bg-black">Chat</div>;
};
export default Chat;
+3 -7
View File
@@ -1,21 +1,17 @@
import { useState } from "react";
import styled from "styled-components";
const Styled = styled.aside`
pointer-events: all;
`;
import Chat from "./Chat";
type Props = {};
function Embed({}: Props) {
function Embed({ }: Props) {
const [visible, setVisible] = useState(false);
const toggleVisible = () => {
setVisible((prev) => !prev);
};
return (
<Styled>
<div className="bg-slate-400 w-12 h-12">
<button onClick={toggleVisible}>{visible ? "close" : "open"}</button>
{visible && <Chat />}
</Styled>
</div>
);
}