diff --git a/src/components/Chat/Sidebar.tsx b/src/components/Chat/Sidebar.tsx new file mode 100644 index 0000000..55aa13f --- /dev/null +++ b/src/components/Chat/Sidebar.tsx @@ -0,0 +1,12 @@ +import React from 'react'; +import { GridItem, GridItemProps } from '@chakra-ui/react'; + +const Sidebar: React.FC = props => { + return ( + + {props.children} + + ); +}; + +export { Sidebar }; diff --git a/src/components/Chat/Window.tsx b/src/components/Chat/Window.tsx new file mode 100644 index 0000000..125d022 --- /dev/null +++ b/src/components/Chat/Window.tsx @@ -0,0 +1,8 @@ +import React from 'react'; +import { GridItem, GridItemProps } from '@chakra-ui/react'; + +const Window: React.FC = props => { + return {props.children}; +}; + +export { Window }; diff --git a/src/components/Chat/index.tsx b/src/components/Chat/index.tsx new file mode 100644 index 0000000..780ad16 --- /dev/null +++ b/src/components/Chat/index.tsx @@ -0,0 +1,22 @@ +import React from 'react'; +import { Grid, GridItemProps, GridProps } from '@chakra-ui/react'; +import { Sidebar } from './Sidebar'; +import { Window } from './Window'; + +interface IChatComposition { + Sidebar: React.FC; + Window: React.FC; +} + +const Chat: React.FC & IChatComposition = props => { + return ( + + {props.children} + + ); +}; + +Chat.Sidebar = Sidebar; +Chat.Window = Window; + +export { Chat }; diff --git a/src/components/Layout/Layout.tsx b/src/components/Layout/Layout.tsx index afc38bd..d2a41e9 100644 --- a/src/components/Layout/Layout.tsx +++ b/src/components/Layout/Layout.tsx @@ -81,7 +81,7 @@ const Layout: React.FC = ({ children, roles }) => { - + }> {(() => { /** @@ -98,12 +98,12 @@ const Layout: React.FC = ({ children, roles }) => { if (!userContainRoles(me.roles, roles)) return ; return children; - } else { - /** - * Return children if "roles" prop is not defined - */ - return children; } + + /** + * Return children if "roles" prop is not defined + */ + return children; })()} diff --git a/src/components/LoadingPage/LoadingPage.tsx b/src/components/LoadingPage/LoadingPage.tsx index 6d85845..2c01af9 100644 --- a/src/components/LoadingPage/LoadingPage.tsx +++ b/src/components/LoadingPage/LoadingPage.tsx @@ -3,7 +3,7 @@ import React from 'react'; const LoadingPage: React.FC = () => { return ( - + diff --git a/src/components/PageElements/index.tsx b/src/components/PageElements/index.tsx index b11f8c6..bfe58a9 100644 --- a/src/components/PageElements/index.tsx +++ b/src/components/PageElements/index.tsx @@ -8,7 +8,11 @@ interface IPageComposition { } const Page: React.FC & IPageComposition = props => { - return {props.children}; + return ( + + {props.children} + + ); }; interface IPageHeadingProps { @@ -27,16 +31,12 @@ Page.Heading = props => { {description && {description}} {props.children} - + ); }; -Page.Content = props => ( - - {props.children} - -); +Page.Content = props => {props.children}; Page.Footer = props => ( diff --git a/src/pages/course/course.tsx b/src/pages/course/course.tsx index 38dd412..4122d4c 100644 --- a/src/pages/course/course.tsx +++ b/src/pages/course/course.tsx @@ -50,7 +50,7 @@ const CoursePage: React.FC = () => { const handleEditCourse = () => history.push(`/courses/edit/${course.id}`); return ( - + {course.title} diff --git a/src/pages/main/components/index.tsx b/src/pages/main/components/index.tsx index 585a174..596c54d 100644 --- a/src/pages/main/components/index.tsx +++ b/src/pages/main/components/index.tsx @@ -24,7 +24,7 @@ export const CourseCardList: React.FC = props => ( mt='4' templateColumns={{ base: '1fr', - md: 'repeat(auto-fill, minmax(320px, 1fr))', + md: 'repeat(auto-fill, minmax(400px, 1fr))', }} spacing={'6'} {...props} diff --git a/src/pages/messages/messages.tsx b/src/pages/messages/messages.tsx index b78ffdf..8f22d5a 100644 --- a/src/pages/messages/messages.tsx +++ b/src/pages/messages/messages.tsx @@ -1,16 +1,110 @@ import React from 'react'; -import { Box, Heading } from '@chakra-ui/react'; +import { + Avatar, + AvatarBadge, + Box, + Flex, + Heading, + WrapItem, + Text, + Stack, + Input, + Icon, + Button, + HStack, + InputGroup, + InputLeftElement, + useColorModeValue, +} from '@chakra-ui/react'; +import { Link as ReactRouterLink } from 'react-router-dom'; import { Page } from '@educt/components/PageElements'; import { IPageProps } from '@educt/interfaces'; +import { MdOutlineChat } from 'react-icons/md'; +import { LinkBox, LinkOverlay } from '@chakra-ui/react'; +import { SearchIcon } from '@chakra-ui/icons'; +import { Chat } from '@educt/components/Chat'; /** * Messages page */ const MessagesPage: React.FC = () => { return ( - - + + + + + + + Chats + + + + + + + + + + + + + + {Array(20) + .fill(0) + .map((e, i) => i) + .map(n => ( + + + + + + + + + + + Sergey Yarkov
+ + Sergey: hello, how you doing? + +
+
+
+ + + 2h + + +
+
+ ))} +
+
+ + + + + + Select a chat to start messaging + + + + +
+
); }; diff --git a/src/pages/profile/profile.tsx b/src/pages/profile/profile.tsx index d85df00..cdc5278 100644 --- a/src/pages/profile/profile.tsx +++ b/src/pages/profile/profile.tsx @@ -30,7 +30,7 @@ const ProfilePage: React.FC = () => { if (me === null) return ; return ( - + diff --git a/src/theme.ts b/src/theme.ts index 2af47ec..5035380 100644 --- a/src/theme.ts +++ b/src/theme.ts @@ -11,10 +11,7 @@ export const theme = extendTheme({ width: '5px', height: '5px', }, - '::-webkit-scrollbar-track': { - backgroundColor: 'gray.100', - borderRadius: '100px', - }, + '::-webkit-scrollbar-thumb': { background: 'blue.600', borderRadius: '100px',