Mantine rewrite
This commit is contained in:
parent
5b782f998c
commit
9eb850a969
8 changed files with 308 additions and 840 deletions
|
@ -9,12 +9,16 @@
|
||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@chakra-ui/react": "^2.2.4",
|
|
||||||
"@emotion/react": "^11.10.0",
|
"@emotion/react": "^11.10.0",
|
||||||
"@emotion/styled": "^11.10.0",
|
"@mantine/core": "^5.0.2",
|
||||||
"framer-motion": "^6.5.1",
|
"@mantine/dates": "^5.0.2",
|
||||||
|
"@mantine/hooks": "^5.0.2",
|
||||||
|
"@mantine/modals": "^5.0.2",
|
||||||
|
"@mantine/notifications": "^5.0.2",
|
||||||
|
"dayjs": "^1.11.4",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0"
|
"react-dom": "^18.2.0",
|
||||||
|
"react-feather": "^2.0.10"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/react": "^18.0.15",
|
"@types/react": "^18.0.15",
|
||||||
|
|
|
@ -1,18 +1,28 @@
|
||||||
import { Box, Flex } from '@chakra-ui/react'
|
import { AppShell, Box, Grid, Stack } from "@mantine/core"
|
||||||
import { useState } from 'react'
|
import ChannelList from "./components/ChannelList"
|
||||||
|
import Header from "./components/Header"
|
||||||
|
import MemberList from "./components/MemberList"
|
||||||
|
import Message from "./components/Message"
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
return (
|
return (
|
||||||
<>
|
<AppShell
|
||||||
<Flex direction="column" height="100%">
|
padding="md"
|
||||||
<Box bg="red" flexGrow="1">
|
navbar={<ChannelList />}
|
||||||
<h1>Hello World!</h1>
|
header={<Header />}>
|
||||||
</Box>
|
<Grid>
|
||||||
<Box>
|
<Grid.Col span={10}>
|
||||||
<h1>Hello</h1>
|
<Stack sx={{ overflowY: "scroll" }}>
|
||||||
</Box>
|
{[...Array(10)].map((e, i) => (
|
||||||
</Flex>
|
<Message />
|
||||||
</>
|
))}
|
||||||
|
</Stack>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={2}>
|
||||||
|
<MemberList />
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
</AppShell>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
14
frontend/src/components/ChannelList.tsx
Normal file
14
frontend/src/components/ChannelList.tsx
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
import { Navbar, NavLink } from "@mantine/core";
|
||||||
|
import { Hash } from "react-feather";
|
||||||
|
|
||||||
|
function ChannelList() {
|
||||||
|
return (
|
||||||
|
<Navbar width={{ base: 300 }} p="xs">
|
||||||
|
{[...Array(4)].map((e, i) => (
|
||||||
|
<NavLink label={`Channel ${i+1}`} icon={<Hash />}/>
|
||||||
|
))}
|
||||||
|
</Navbar>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ChannelList
|
17
frontend/src/components/Header.tsx
Normal file
17
frontend/src/components/Header.tsx
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
import { Header as MHeader, Group, Text, Space } from '@mantine/core';
|
||||||
|
|
||||||
|
function Header() {
|
||||||
|
return (
|
||||||
|
<MHeader height={60} p="xs" sx={(theme) => ({
|
||||||
|
backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[6] : theme.colors.blue[6],
|
||||||
|
color: 'white'
|
||||||
|
})}>
|
||||||
|
<Group sx={{ height: "100%" }}>
|
||||||
|
<Text size="xl" my="auto" sx={{ width: "280px" }}>Echo Web</Text>
|
||||||
|
<Text size="md" my="auto">Channel 1</Text>
|
||||||
|
</Group>
|
||||||
|
</MHeader>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Header
|
9
frontend/src/components/MemberList.tsx
Normal file
9
frontend/src/components/MemberList.tsx
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
import { Navbar, NavLink } from "@mantine/core"
|
||||||
|
|
||||||
|
function MemberList() {
|
||||||
|
return (
|
||||||
|
<p>Member List</p>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default MemberList
|
21
frontend/src/components/Message.tsx
Normal file
21
frontend/src/components/Message.tsx
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
import { Avatar, Box, Group, Stack, Text } from "@mantine/core"
|
||||||
|
|
||||||
|
function Message() {
|
||||||
|
return (
|
||||||
|
<Group sx={{ flexWrap: "nowrap" }}>
|
||||||
|
<Avatar color="cyan" radius="xl" sx={{ flexGrow: 0, flexShrink: 0, marginBottom: "auto" }}>LS</Avatar>
|
||||||
|
<Stack spacing="xs" sx={{ flexGrow: 1, flexShrink: 1 }}>
|
||||||
|
<Text>
|
||||||
|
Author
|
||||||
|
{' '}
|
||||||
|
<Text component="span" size="sm" my="auto" color="dimmed">at 4:13pm</Text>
|
||||||
|
</Text>
|
||||||
|
<Text>
|
||||||
|
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Doloribus nemo nisi saepe quasi eaque laudantium autem aliquid eligendi, nihil aut id sunt iusto nulla. Modi ut provident obcaecati quibusdam veritatis?
|
||||||
|
</Text>
|
||||||
|
</Stack>
|
||||||
|
</Group>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Message
|
|
@ -1,13 +1,13 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import ReactDOM from 'react-dom/client'
|
import ReactDOM from 'react-dom/client'
|
||||||
import { ChakraProvider } from '@chakra-ui/react'
|
import { MantineProvider } from '@mantine/core';
|
||||||
import App from './App'
|
import App from './App'
|
||||||
import './index.css';
|
import './index.css';
|
||||||
|
|
||||||
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
|
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<ChakraProvider>
|
<MantineProvider withGlobalStyles withNormalizeCSS>
|
||||||
<App />
|
<App />
|
||||||
</ChakraProvider>
|
</MantineProvider>
|
||||||
</React.StrictMode>
|
</React.StrictMode>
|
||||||
)
|
)
|
||||||
|
|
1035
frontend/yarn.lock
1035
frontend/yarn.lock
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue