Skip to content

Commit

Permalink
Merge pull request #23 from 001elijah/main-plus-dashboard
Browse files Browse the repository at this point in the history
Main plus dashboard
  • Loading branch information
001elijah authored Jun 24, 2023
2 parents 5cd19a4 + 85bfa87 commit b7f01e7
Show file tree
Hide file tree
Showing 21 changed files with 348 additions and 210 deletions.
45 changes: 38 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
]
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"eslint": "^8.42.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
Expand Down
21 changes: 12 additions & 9 deletions src/components/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import { useDispatch } from 'react-redux';
import WelcomePage from 'pages/WelcomePage';
import AuthPage from '../pages/AuthPage';
import { HomePage } from 'pages/HomePage';
import { BoardPage } from 'pages/BoardPage';

import { PrivateRoute, PublicRoute } from './Route/route';

import { currentUser } from 'redux/Auth/authOperations';
import { Loader } from './Loader/Loader';
import { DefaultDashBoard } from './DefaultBoard/DefaultBoard';
import { MainBoard } from './MainBoard/MainBoard';

export const App = () => {
const dispatch = useDispatch();
Expand All @@ -29,14 +30,16 @@ export const App = () => {
path="/auth/:id"
element={<PublicRoute component={<AuthPage />} />}
/>
<Route
path="/home"
element={<PrivateRoute component={<HomePage />} />}
/>
<Route
path="/board"
element={<PrivateRoute component={<BoardPage />} />}
/>
<Route path="/home" element={<PrivateRoute component={<HomePage />} />}>
<Route
index
element={<PrivateRoute component={<DefaultDashBoard />} />}
/>
<Route
path=":boardName"
element={<PrivateRoute component={<MainBoard />} />}
/>
</Route>
<Route path="*" element={<Navigate to="/home" />} />
</Routes>
</>
Expand Down
3 changes: 2 additions & 1 deletion src/components/BoardModalWindow/BoardModalWindow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ export const BoardModalWindow = ({
inputTitle={inputTitle}
modalTitle={modalTitle}
titleModalButton={titleModalButton}
onClick={handleAddBoard}
onSubmit={handleAddBoard}
handleToggleModal={handleToggleModal}
onClick={onClick}
>
<BoxRadioIconGroup valueChange={setIcon} />
<BoxRadioBackgroundGroup valueChange={setBackground} />
Expand Down
57 changes: 57 additions & 0 deletions src/components/DefaultBoard/Default.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
@import '../../assets/styles/vars';
@import '../../assets/styles/mixins';

.BackGround {
height: 100vh;
&.dark {
background-color: #1f1f1f;
}
&.light {
background-color: #f6f6f7;
}
&.colorful {
background-color: #ecedfd;
}
}
.Wrapper {
display: flex;
align-items: center;
justify-content: center;

height: 100%;
}
.DefaultTitle {
font-weight: 400;
font-size: 14px;
line-height: 1.29;
text-align: center;
letter-spacing: -0.02em;
margin-left: auto;
margin-right: auto;

@include mobileSmall {
max-width: 335px;
}
@include mobile {
width: 335px;
}
@include tablet {
width: 486px;
}
&.dark {
color: #ffffff80;
}
&.light,
&.colorful {
color: #161616;
}
}
.DefaultLink {
&.dark,
&.light {
color: #bedbb0;
}
&.colorful {
color: #5255bc;
}
}
29 changes: 29 additions & 0 deletions src/components/DefaultBoard/DefaultBoard.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { selectorTheme } from 'redux/Auth/authSelectors';
import { useSelector } from 'react-redux';
import clsx from 'clsx';
import React from 'react';
import s from './Default.module.scss';
import { HeaderDashBoard } from 'components/HeaderDashBoard/HeaderDashBoard';

export const DefaultDashBoard = () => {
const theme = useSelector(selectorTheme);
return (
<>
<div className={clsx(s.BackGround, s[theme])}>
<HeaderDashBoard />
<div className={s.Wrapper}>
<p className={clsx(s.DefaultTitle, s[theme])}>
Before starting your project, it is essential
<span className={clsx(s.DefaultLink, s[theme])}>
{' '}
to create a board{' '}
</span>
to visualize and track all the necessary tasks and milestones. This
board serves as a powerful tool to organize the workflow and ensure
effective collaboration among team members.
</p>
</div>
</div>
</>
);
};
70 changes: 35 additions & 35 deletions src/components/Header/Header.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import clsx from 'clsx';
import { Container } from 'components/Container';
// import { Container } from 'components/Container';
import { UserInfo } from 'components/UserInfo/UserInfo';
import { selectorTheme } from 'redux/Auth/authSelectors';
import { themeChangeUser } from 'redux/Auth/authOperations';
Expand Down Expand Up @@ -35,45 +35,45 @@ export const Header = () => {
return (
<>
<header className={clsx(s.header, s[theme])}>
<Container>
<div className={s.pageHeader}>
<button onClick={toggleSidebar} className={s.burgerMenu}>
<svg className={clsx(s.burgerIcon, s[theme])}>
<use href={`${icons}#icon-burger-menu`}></use>
{/* <Container> */}
<div className={s.pageHeader}>
<button onClick={toggleSidebar} className={s.burgerMenu}>
<svg className={clsx(s.burgerIcon, s[theme])}>
<use href={`${icons}#icon-burger-menu`}></use>
</svg>
</button>

<div className={s.dropDown}>
<button className={clsx(s.dropBtn, s[theme])}>
Theme
<svg className={clsx(s.arrowIcon, s[theme])}>
<use href={`${icons}#icon-arrow-down`}></use>
</svg>
</button>

<div className={s.dropDown}>
<button className={clsx(s.dropBtn, s[theme])}>
Theme
<svg className={clsx(s.arrowIcon, s[theme])}>
<use href={`${icons}#icon-arrow-down`}></use>
</svg>
</button>
<div className={clsx(s.dropDownContent, s[theme])}>
<div
className={clsx(s.dropDownItem, s[theme])}
onClick={() => changeTheme('light')}
>
Light
</div>
<div
className={clsx(s.dropDownItem, s[theme])}
onClick={() => changeTheme('dark')}
>
Dark
</div>
<div
className={clsx(s.dropDownItem, s[theme])}
onClick={() => changeTheme('colorful')}
>
Colorful
</div>
<div className={clsx(s.dropDownContent, s[theme])}>
<div
className={clsx(s.dropDownItem, s[theme])}
onClick={() => changeTheme('light')}
>
Light
</div>
<div
className={clsx(s.dropDownItem, s[theme])}
onClick={() => changeTheme('dark')}
>
Dark
</div>
<div
className={clsx(s.dropDownItem, s[theme])}
onClick={() => changeTheme('colorful')}
>
Colorful
</div>
</div>
<UserInfo />
</div>
</Container>
<UserInfo />
</div>
{/* </Container> */}
</header>
{showSidebar && (
<SideBarBackDrop toggleSidebar={toggleSidebar}>
Expand Down
5 changes: 1 addition & 4 deletions src/components/HeaderDashBoard/HeaderDashBoard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ export const HeaderDashBoard = ({ title }) => {
</button>
{showModalWindow && (
<BackdropModal closeModal={handleModalWindowClose}>
<ModalFilter
closeModal={handleModalWindowClose}
// color={setColor}
/>
<ModalFilter closeModal={handleModalWindowClose} />
</BackdropModal>
)}
</div>
Expand Down
17 changes: 8 additions & 9 deletions src/components/HeaderDashBoard/HeaderDashBoard.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@
display: flex;
justify-content: space-between;
align-items: flex-end;
background-color: $black-color;
padding: 10px 24px;

&.dark {
background-color: $black-color;
}
&.light,
&.colorful {
background-color: $background-color;
}
// &.dark {
// background-color: $black-color;
// }
// &.light,
// &.colorful {
// background-color: $background-color;
// }
}
.HeaderTitle {
font-weight: 500;
Expand All @@ -32,7 +31,7 @@
.HeaderFilter {
background: transparent;
border: none;

margin-left: auto;
outline: none;

&.dark {
Expand Down
34 changes: 34 additions & 0 deletions src/components/MainBoard/MainBoard.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// import s from './MainBoard.module.scss';
import { Wrapper } from './MainBoard.styled';
import PropTypes from 'prop-types';
import { HeaderDashBoard } from '../HeaderDashBoard/HeaderDashBoard';
import { AddButton } from '../ButtonAddColumn/ButtonAddColumn';
// import {TaskCard} from '../../TaskCard/TaskCard'
// import {TasksColumnHeader} from '../../TasksColumnHeader/TasksColumnHeader'

const BASE_URL_IMG =
'https://res.cloudinary.com/dblzpxfzb/image/upload/v1687449642/background/';
// import { useParams } from 'react-router-dom';

export const MainBoard = ({ imgid }) => {
// const { boardName } = useParams();
//робимо запит на бек за id дошки

return (
<>
<Wrapper imgurl={BASE_URL_IMG} imgid={imgid}>
<HeaderDashBoard title="test" />
<div>
{/* <TasksColumnHeader/>
<TaskCard/> */}
</div>

<AddButton typeOfButton="Card" title="Add another column" />
</Wrapper>
</>
);
};

MainBoard.propTypes = {
imgid: PropTypes.string,
};
Loading

0 comments on commit b7f01e7

Please sign in to comment.