diff --git a/src/components/AboutUs.jsx b/src/components/AboutUs.jsx index de8f670..a937a8a 100644 --- a/src/components/AboutUs.jsx +++ b/src/components/AboutUs.jsx @@ -9,6 +9,8 @@ export const AboutUs = () => { { + const theme = useTheme(); + + return ( + + ); +}; diff --git a/src/components/Discussion.jsx b/src/components/Discussion.jsx new file mode 100644 index 0000000..bc204d2 --- /dev/null +++ b/src/components/Discussion.jsx @@ -0,0 +1,56 @@ +import React from 'react'; +import { Button, Typography, useTheme } from '@mui/material'; +import { useNavigate } from 'react-router'; + +const typographyStyle = { + fontFamily: 'Open Sans', + marginLeft: 4, + marginRight: 4, + fontWeight: 700, + letterSpacing: 1.3, + fontSize: '1.42em', + +}; + +export const Discussion = ({ props }) => { + + const theme = useTheme(); + + const navigate = useNavigate(); + + const hundleOnClick = () => { + navigate(`?id=${props.id}`); + }; + + + return ( + + + ); +}; \ No newline at end of file diff --git a/src/components/DiscussionBoard.jsx b/src/components/DiscussionBoard.jsx new file mode 100644 index 0000000..4c53f18 --- /dev/null +++ b/src/components/DiscussionBoard.jsx @@ -0,0 +1,136 @@ +import { useState, useRef } from 'react'; +// import sendRequest from '../utils/api/api'; +import { Box, useTheme } from '@mui/material'; +import { PageTitle } from './PageTitle.jsx'; +import { Discussion } from './Discussion.jsx'; +import { ActiveControl } from './ActiveControl.jsx'; +import { NewDiscussion } from './NewDiscussion.jsx'; + +export const DiscussionBoard = () => { + const theme = useTheme(); + + const [openDialog, setOpenDialog] = useState(false); + const newDiscussionRef = useRef(null); + + const Open = () => { + setOpenDialog(true); + if (newDiscussionRef.current) { + newDiscussionRef.current.scrollIntoView({ behavior: 'smooth' }); + } + }; + const onclose = ()=>{ + setOpenDialog(false); + }; + + // const allDiscussions = await sendRequest('/subject' , 'GET'); + // setSubjects(allDiscussions); + const allDiscussions = [ + { id: '123', name: 'ressume', comments: [{ date: new Date() }] }, + { id: '123', name: 'salary', comments: [{ date: new Date() }] }, + { id: '123', name: 'activity', comments: [{ date: new Date() }] }, + { id: '123', name: 'ressume', comments: [{ date: new Date() }] }, + { id: '123', name: 'salary', comments: [{ date: new Date() }] }, + { id: '123', name: 'activity', comments: [{ date: new Date() }] }, + { id: '123', name: 'salary', comments: [{ date: new Date() }] }, + { id: '123', name: 'activity', comments: [{ date: new Date() }] }, + ]; + + // return ( + // <> + // + // + // + // + // + // + // {allDiscussions.map((discussion) => ( + // + // ))} + // + + // + // + // + // ); + return ( + + + + + + + + + + + {allDiscussions.map((discussion, index) => ( + + ))} + + + setOpenDialog(false) || onclose} /> + + + ); + +}; \ No newline at end of file diff --git a/src/components/Nav.jsx b/src/components/Nav.jsx index 9493a36..16f51c7 100644 --- a/src/components/Nav.jsx +++ b/src/components/Nav.jsx @@ -14,7 +14,7 @@ const pages = [ export const Nav = () => { return ( <> - + {pages.map((page) => (