From 148156fdca0ecc3b2a60d3d200c93ef40d116ac3 Mon Sep 17 00:00:00 2001 From: maciekglowacki Date: Wed, 21 Oct 2020 20:42:18 +0200 Subject: [PATCH 01/19] Auth done --- src/components/CourseCard.tsx | 6 ++---- src/components/Dropdown.tsx | 21 ++++++++++----------- src/contexts/CoursesProvider.tsx | 6 ++++-- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/components/CourseCard.tsx b/src/components/CourseCard.tsx index ad7d482..46ce574 100644 --- a/src/components/CourseCard.tsx +++ b/src/components/CourseCard.tsx @@ -1,7 +1,7 @@ import React, { useState, useContext, MouseEvent } from 'react'; import Collapse from '@material-ui/core/Collapse'; import ExpandIcon from '../assets/expand.png'; -import { Course, Group, GroupType } from '../types/index'; +import { Course, Group } from '../types/index'; import { coursesContext } from '../contexts/CoursesProvider'; import styled from 'styled-components'; import { makeStyles } from '@material-ui/core/styles'; @@ -35,9 +35,7 @@ padding-left:35px; padding-right:35px; `; -interface ClassGroupProps { - groupType: GroupType; -} + const ClassGroupStyled = styled.div` position:relative; diff --git a/src/components/Dropdown.tsx b/src/components/Dropdown.tsx index b270f2d..0160e2b 100644 --- a/src/components/Dropdown.tsx +++ b/src/components/Dropdown.tsx @@ -1,20 +1,19 @@ import React, { useState, useContext, useEffect, MouseEvent, ChangeEvent } from 'react'; -import axios from 'axios'; import { Input } from '@material-ui/core'; import ClickAwayListener from '@material-ui/core/ClickAwayListener'; import { coursesContext } from '../contexts/CoursesProvider'; -import { Course, Basket } from '../types'; +import { Course } from '../types'; import styled from 'styled-components'; import { makeStyles } from '@material-ui/core/styles'; -const DropdownStyled = styled.div` +const DropdownContainer = styled.div` max-height: 420px; overflow-y: auto; scroll-snap-type: y mandatory; scroll-behavior: smooth; z-index: 100; - position: relative; - border-radius:0px 0px 0px 15px; + position: relative; + border-radius: 0px 0px 0px 15px; ::-webkit-scrollbar-track { border-radius: 10px; background-color: #f5f5f5; @@ -30,7 +29,7 @@ const DropdownStyled = styled.div` } `; -const CourseStyled = styled.div` +const CourseContainer = styled.div` position: relative; z-index: 10; padding: 5px; @@ -39,7 +38,7 @@ const CourseStyled = styled.div` font-size: 18px; font-family: Lato; scroll-snap-align: end; - border-bottom:1px solid; + border-bottom: 1px solid; :hover { background-color: #d4b851; cursor: pointer; @@ -113,13 +112,13 @@ export const Dropdown = ({ clearInput, handleClearInput }: DropdownProps) => { value={input} /> {open && ( - + {filteredCourses.map(({ name, id }, index) => ( - +

{name}

-
+ ))} -
+ )} diff --git a/src/contexts/CoursesProvider.tsx b/src/contexts/CoursesProvider.tsx index 56d7de7..bfcecb2 100644 --- a/src/contexts/CoursesProvider.tsx +++ b/src/contexts/CoursesProvider.tsx @@ -26,18 +26,20 @@ export const CoursesProvider = ({ children }: CoursesProviderProps) => { const token = CAS?.user?.token; const addToBasket = (course: Course) => { - const courseToBasket = { + const courseToBasket: Basket = { name: course.name, id: course.id, classes: course.classes[0], lecture: course.lectures !== undefined ? course.lectures[0] : undefined, - } as Basket; + }; setBasket([...basket, courseToBasket]); }; + const deleteFromBasket = (id: number) => setBasket(basket.filter((course) => course.id !== id)); const saveBasket = async () => { try { + //to be deleted let data = [7, 43, 54]; let json = JSON.stringify(data); let post_data = { json_data: json }; From 770a5f09d3cb85d255985d1e6a71dc4265dec854 Mon Sep 17 00:00:00 2001 From: maciekglowacki Date: Thu, 22 Oct 2020 23:04:00 +0200 Subject: [PATCH 02/19] normalize polish signs --- src/components/Dropdown.tsx | 17 ++++++++++++++--- src/components/Topbar.tsx | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/components/Dropdown.tsx b/src/components/Dropdown.tsx index 0160e2b..84df6aa 100644 --- a/src/components/Dropdown.tsx +++ b/src/components/Dropdown.tsx @@ -60,19 +60,30 @@ interface DropdownProps { export const Dropdown = ({ clearInput, handleClearInput }: DropdownProps) => { const classes = useStyles(); - const [open, setOpen] = React.useState(false); - const [input, setInput] = useState(''); + const [open, setOpen] = useState(false); + const [input, setInput] = useState(''); //courses - choosenCourses const [filteredCourses, setFilteredCourses] = useState>([]); + const { courses, basket, addToBasket } = useContext(coursesContext)!; useEffect(() => { const filterCourses = (input: string) => { const choosenCoursesNames = basket.map(({ name }) => name.trim()); const filteredCourses = courses.filter( - ({ name }) => name.toLowerCase().includes(input.toLowerCase()) && !choosenCoursesNames.includes(name), + ({ name }) => + name + .toLowerCase() + .normalize('NFD') + .replace(/[\u0300-\u036f]/g, '') + .includes( + input + .toLowerCase() + .normalize('NFD') + .replace(/[\u0300-\u036f]/g, ''), + ) && !choosenCoursesNames.includes(name), ); setFilteredCourses(filteredCourses); }; diff --git a/src/components/Topbar.tsx b/src/components/Topbar.tsx index 1b2f0f5..42794bb 100644 --- a/src/components/Topbar.tsx +++ b/src/components/Topbar.tsx @@ -107,7 +107,7 @@ export default function ({ handleTransfer }: TopbarProps) { - + {/* */} From 9d1cf2011c7f8d7e3379ab6bb27cb6f2e94e2a60 Mon Sep 17 00:00:00 2001 From: wrzesinski-hubert Date: Mon, 26 Oct 2020 19:40:03 +0100 Subject: [PATCH 03/19] changes to new package --- src/contexts/CoursesProvider.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/contexts/CoursesProvider.tsx b/src/contexts/CoursesProvider.tsx index 56d7de7..3cac1c4 100644 --- a/src/contexts/CoursesProvider.tsx +++ b/src/contexts/CoursesProvider.tsx @@ -73,14 +73,15 @@ export const CoursesProvider = ({ children }: CoursesProviderProps) => { useEffect(() => { const fetchData = async () => { - const { data } = await axios.get }>>( + const { data } = await axios.get, classes:Array }>>( `${process.env.REACT_APP_API_URL}/api/v1/courses/getCoursesWithGroups`, ); - const courses = data.map(({ id, name, groups }) => ({ - id: parseInt(id), - name, - lectures: groups.filter(({ type }) => type === GroupType.LECTURE), - classes: groups.filter(({ type }) => type === GroupType.CLASS), + console.log(data); + const courses = data.map(({ id, name, lectures, classes }) => ({ + id, + name, + lectures, + classes, })) as Array; courses.sort((a: Course, b: Course) => (a.name > b.name ? 1 : -1)); From 8ceef555d1f6dc864af9c43529f87f5c905b2d56 Mon Sep 17 00:00:00 2001 From: maciekglowacki Date: Mon, 26 Oct 2020 23:14:23 +0100 Subject: [PATCH 04/19] updated classes fetching endpoint --- src/components/Dropdown.tsx | 1 - src/components/SchedulerRow.tsx | 16 ++++++++-------- src/contexts/CoursesProvider.tsx | 10 +--------- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/src/components/Dropdown.tsx b/src/components/Dropdown.tsx index 84df6aa..985bb63 100644 --- a/src/components/Dropdown.tsx +++ b/src/components/Dropdown.tsx @@ -66,7 +66,6 @@ export const Dropdown = ({ clearInput, handleClearInput }: DropdownProps) => { //courses - choosenCourses const [filteredCourses, setFilteredCourses] = useState>([]); - const { courses, basket, addToBasket } = useContext(coursesContext)!; useEffect(() => { diff --git a/src/components/SchedulerRow.tsx b/src/components/SchedulerRow.tsx index cb45953..e7b80f3 100644 --- a/src/components/SchedulerRow.tsx +++ b/src/components/SchedulerRow.tsx @@ -1,4 +1,4 @@ -import React, { MouseEvent, useEffect, useState } from 'react'; +import React, { MouseEvent, useState } from 'react'; import { Group, GroupType } from '../types'; import styled from 'styled-components/macro'; import Popover from '@material-ui/core/Popover'; @@ -35,7 +35,7 @@ const SchedulerEvent = styled.div` z-index: 2; `; -interface ClassesProps{ +interface ClassesProps { cellWidth: number; cellHeight: number; groupType: GroupType; @@ -47,15 +47,15 @@ const Classes = styled.div` align-items: center; z-index: 2; border-radius: 10px; - - font-size:0.90vw; + + font-size: 0.9vw; /* background-color: rgb(100, 181, 246); */ width: ${({ cellWidth }) => (cellWidth * 2.5) / 3}px; height: ${({ cellHeight }) => (cellHeight * 2 * 3) / 4}px; margin-right: 5px; text-align: center; - background-color:${({groupType})=>groupType === "CLASS" ? "#FFDC61" : "#A68820"}; - box-shadow: 9px 9px 8px -2px rgba(0,0,0,0.59); + background-color: ${({ groupType }) => (groupType === 'CLASS' ? '#FFDC61' : '#A68820')}; + box-shadow: 9px 9px 8px -2px rgba(0, 0, 0, 0.59); `; interface SchedulerRowProps { @@ -98,7 +98,7 @@ export const SchedulerRow = ({ groups, indexRow, cellTop, cellWidth, cellHeight {groups.map( (group, index) => group.day === eventIndex && ( - <> +
{groups[index].room}

- +
), )} diff --git a/src/contexts/CoursesProvider.tsx b/src/contexts/CoursesProvider.tsx index 444a461..e347eec 100644 --- a/src/contexts/CoursesProvider.tsx +++ b/src/contexts/CoursesProvider.tsx @@ -75,18 +75,10 @@ export const CoursesProvider = ({ children }: CoursesProviderProps) => { useEffect(() => { const fetchData = async () => { - const { data } = await axios.get, classes:Array }>>( + const { data: courses } = await axios.get>( `${process.env.REACT_APP_API_URL}/api/v1/courses/getCoursesWithGroups`, ); - console.log(data); - const courses = data.map(({ id, name, lectures, classes }) => ({ - id, - name, - lectures, - classes, - })) as Array; courses.sort((a: Course, b: Course) => (a.name > b.name ? 1 : -1)); - setCourses(courses); }; fetchData(); From 157dc2f35ede8d7d82ebb29167fb1d09850fc73b Mon Sep 17 00:00:00 2001 From: maciekglowacki Date: Tue, 27 Oct 2020 01:24:35 +0100 Subject: [PATCH 05/19] Save timetable button connected to backend --- package-lock.json | 9 ++++++ package.json | 1 + src/components/Rightbar.tsx | 33 +++------------------ src/contexts/CoursesProvider.tsx | 51 ++++++++++++++++++++------------ src/index.tsx | 21 +++++++++---- 5 files changed, 61 insertions(+), 54 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8205261..d62ce59 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8794,6 +8794,15 @@ "sort-keys": "^1.0.0" } }, + "notistack": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/notistack/-/notistack-1.0.1.tgz", + "integrity": "sha512-2T1WkokzRCM8N9EdueaXja160IMFIMHVhRu0fGkDje7qCzwBHlTMZY2NULQzB2GFOO6iGVzl5GCX2XrJIzI8bw==", + "requires": { + "clsx": "^1.1.0", + "hoist-non-react-statics": "^3.3.0" + } + }, "npm-run-path": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", diff --git a/package.json b/package.json index f0c6554..3bc6b39 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "@testing-library/react": "^9.5.0", "@testing-library/user-event": "^7.2.1", "axios": "^0.19.2", + "notistack": "^1.0.1", "react": "^16.13.1", "react-dom": "^16.13.1", "react-scripts": "3.4.1", diff --git a/src/components/Rightbar.tsx b/src/components/Rightbar.tsx index ec93536..9796681 100644 --- a/src/components/Rightbar.tsx +++ b/src/components/Rightbar.tsx @@ -1,10 +1,8 @@ import React, { useContext } from 'react'; -import Snackbar from '@material-ui/core/Snackbar'; import { CourseCard } from './CourseCard'; import { coursesContext } from '../contexts/CoursesProvider'; -import MuiAlert, { AlertProps } from '@material-ui/lab/Alert'; import styled from 'styled-components'; -import { debounce } from "lodash"; +import { debounce } from 'lodash'; const RightbarStyled = styled.div` padding-top: 10px; @@ -47,18 +45,12 @@ const SaveButton = styled.div` &:hover { color: white; } - box-shadow: 6px 6px 6px -2px rgba(0,0,0,0.59); + box-shadow: 6px 6px 6px -2px rgba(0, 0, 0, 0.59); `; -function Alert(props: AlertProps) { - return ; -} - export const Rightbar = () => { const { courses, basket, saveBasket } = useContext(coursesContext)!; - const [open, setOpen] = React.useState(false); - const getBasketGroups = () => { const names = basket.map(({ name }) => name); return courses.filter(({ name }) => names.includes(name)); @@ -66,19 +58,7 @@ export const Rightbar = () => { const filteredCourses = getBasketGroups(); - const save = debounce(() => { - saveBasket(); - setOpen(true); - console.log("zmiana") - },500); - - const handleClose = (event?: React.SyntheticEvent, reason?: string) => { - if (reason === 'clickaway') { - return; - } - - setOpen(false); - }; + const handleSave = debounce(() => saveBasket(), 500); //need to insert student name from db and course maybe based on current time or from db too return ( @@ -88,16 +68,11 @@ export const Rightbar = () => { Hubert Wrzesiński

Semestr zimowy 2020/2021

- ZAPISZ + ZAPISZ {filteredCourses.map((course, index) => ( ))} - - - Zapisano plan! - - ); }; diff --git a/src/contexts/CoursesProvider.tsx b/src/contexts/CoursesProvider.tsx index e347eec..c78b870 100644 --- a/src/contexts/CoursesProvider.tsx +++ b/src/contexts/CoursesProvider.tsx @@ -1,7 +1,8 @@ import React, { useState, createContext, useEffect, ReactNode, useContext } from 'react'; import { Course, Group, Basket, GroupType } from '../types'; import axios from 'axios'; -import { CASContext, CASProvider } from './CASProvider'; +import { CASContext } from './CASProvider'; +import { useSnackbar } from 'notistack'; interface CourseContext { courses: Array; @@ -22,9 +23,18 @@ export const CoursesProvider = ({ children }: CoursesProviderProps) => { const [courses, setCourses] = useState>([]); const [basket, setBasket] = useState>([]); + const { enqueueSnackbar } = useSnackbar(); + const CAS = useContext(CASContext)!; const token = CAS?.user?.token; + const selectBasketIds = (basket: Array) => { + const classesIds = basket.map((course) => course.classes.id); + const lecturesIds = basket.map((course) => course?.lecture?.id); + + return lecturesIds[0] === undefined ? classesIds : [...classesIds, ...lecturesIds]; + }; + const addToBasket = (course: Course) => { const courseToBasket: Basket = { name: course.name, @@ -38,30 +48,33 @@ export const CoursesProvider = ({ children }: CoursesProviderProps) => { const deleteFromBasket = (id: number) => setBasket(basket.filter((course) => course.id !== id)); const saveBasket = async () => { + const basketIds = selectBasketIds(basket); + + const config = { + method: 'post' as const, + url: `${process.env.REACT_APP_API_URL}/api/v1/commisions/add?`, + headers: { + Authorization: `Bearer ${token}`, + 'Content-Type': 'application/json', + }, + data: JSON.stringify(basketIds), + }; + try { - //to be deleted - let data = [7, 43, 54]; - let json = JSON.stringify(data); - let post_data = { json_data: json }; - const ech = await axios.post>( - `${process.env.REACT_APP_API_URL}/api/v1/commisions/add?`, - [7, 43, 54], - { - headers: { - Authorization: `Bearer ${token}`, - }, - }, - ); - console.log('api response;', ech); + await axios.request(config); + enqueueSnackbar('Plan został zapisany', { + variant: 'success', + }); } catch (e) { - console.log(e); + enqueueSnackbar('Zapisywanie planu nie powiodło się', { + variant: 'error', + }); } - console.log('saving to basket'); }; const addGroup = (choosenGroup: Group, id: number) => { const basketCourse = basket.filter((course) => course.id === id)[0]; - const type = choosenGroup.type; + const { type } = choosenGroup; if (type === GroupType.CLASS) { setBasket( basket.map((basket) => (basket.id === basketCourse.id ? { ...basket, classes: choosenGroup } : basket)), @@ -78,7 +91,7 @@ export const CoursesProvider = ({ children }: CoursesProviderProps) => { const { data: courses } = await axios.get>( `${process.env.REACT_APP_API_URL}/api/v1/courses/getCoursesWithGroups`, ); - courses.sort((a: Course, b: Course) => (a.name > b.name ? 1 : -1)); + courses.sort((a, b) => (a.name > b.name ? 1 : -1)); setCourses(courses); }; fetchData(); diff --git a/src/index.tsx b/src/index.tsx index d3ecd06..0e9ee27 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -4,15 +4,24 @@ import { App } from './components/App'; import { CASProvider } from './contexts/CASProvider'; import { CoursesProvider } from './contexts/CoursesProvider'; import { GlobalStyles } from './styles/GlobalStyles'; +import { SnackbarProvider } from 'notistack'; ReactDOM.render( <> - - - - - - + + + + + + + + , document.getElementById('root'), ); From c16561cfd11eb6f421455e2cabffb7571e3a5e32 Mon Sep 17 00:00:00 2001 From: maciekglowacki Date: Tue, 27 Oct 2020 10:42:22 +0100 Subject: [PATCH 06/19] added mocked fetch newest timetable --- src/contexts/CoursesProvider.tsx | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/contexts/CoursesProvider.tsx b/src/contexts/CoursesProvider.tsx index c78b870..035971a 100644 --- a/src/contexts/CoursesProvider.tsx +++ b/src/contexts/CoursesProvider.tsx @@ -86,15 +86,33 @@ export const CoursesProvider = ({ children }: CoursesProviderProps) => { } }; - useEffect(() => { - const fetchData = async () => { + const getNewestTimetable = async () => { + //todo + try { + const { data: basket } = await axios.get( + `${process.env.REACT_APP_API_URL}/api/v1/assignments/getCurrentAssignments`, + ); + // setBasket(basket); + } catch (e) { + console.log(e); + } + }; + + const fetchClasses = async () => { + try { const { data: courses } = await axios.get>( `${process.env.REACT_APP_API_URL}/api/v1/courses/getCoursesWithGroups`, ); courses.sort((a, b) => (a.name > b.name ? 1 : -1)); setCourses(courses); - }; - fetchData(); + } catch (e) { + console.log(e); + } + }; + + useEffect(() => { + fetchClasses(); + getNewestTimetable(); }, []); return ( From 0ea3ed69d1dbaeaff90b44a08983d3352d410aa5 Mon Sep 17 00:00:00 2001 From: wrzesinski-hubert Date: Wed, 28 Oct 2020 00:07:23 +0100 Subject: [PATCH 07/19] 123 --- package-lock.json | 2 +- src/contexts/CoursesProvider.tsx | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index d62ce59..970889e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2062,7 +2062,7 @@ "dependencies": { "semver": { "version": "7.3.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "resolved": "https://npm.mlabs.pl:443/semver/-/semver-7.3.2.tgz", "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", "dev": true } diff --git a/src/contexts/CoursesProvider.tsx b/src/contexts/CoursesProvider.tsx index 035971a..a04795d 100644 --- a/src/contexts/CoursesProvider.tsx +++ b/src/contexts/CoursesProvider.tsx @@ -24,6 +24,7 @@ export const CoursesProvider = ({ children }: CoursesProviderProps) => { const [basket, setBasket] = useState>([]); const { enqueueSnackbar } = useSnackbar(); + const { closeSnackbar } = useSnackbar(); const CAS = useContext(CASContext)!; const token = CAS?.user?.token; @@ -60,14 +61,28 @@ export const CoursesProvider = ({ children }: CoursesProviderProps) => { data: JSON.stringify(basketIds), }; + const action = (key: any) => ( + <> + + + ); + try { await axios.request(config); enqueueSnackbar('Plan został zapisany', { variant: 'success', + action, }); } catch (e) { enqueueSnackbar('Zapisywanie planu nie powiodło się', { variant: 'error', + action, }); } }; From 30ae3c73eb38b49ebf4c235b46d5e1ec579f8784 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciek=20G=C5=82owacki?= Date: Fri, 30 Oct 2020 00:42:40 +0100 Subject: [PATCH 08/19] initial topbar and dropdown redesign --- public/index.html | 35 ++++++----- src/assets/PL.png | Bin 10420 -> 0 bytes src/assets/UK.png | Bin 10852 -> 0 bytes src/assets/account.svg | 1 + src/assets/poland.svg | 42 +++++++++++++ src/assets/united-kingdom.svg | 115 ++++++++++++++++++++++++++++++++++ src/assets/user.png | Bin 18927 -> 0 bytes src/components/Dropdown.tsx | 57 ++++++++--------- src/components/Rightbar.tsx | 5 -- src/components/Topbar.tsx | 108 +++++++++++++++++-------------- src/components/Transfer.tsx | 1 - src/styles/GlobalStyles.ts | 2 +- 12 files changed, 268 insertions(+), 98 deletions(-) delete mode 100644 src/assets/PL.png delete mode 100644 src/assets/UK.png create mode 100644 src/assets/account.svg create mode 100644 src/assets/poland.svg create mode 100644 src/assets/united-kingdom.svg delete mode 100644 src/assets/user.png diff --git a/public/index.html b/public/index.html index 2a7a20a..30b6ea6 100644 --- a/public/index.html +++ b/public/index.html @@ -1,22 +1,23 @@ - - - - - - - - + + + + + + + + + + + PlanNaPlan + + + + +
+ - PlanNaPlan - - - -
- \ No newline at end of file diff --git a/src/assets/PL.png b/src/assets/PL.png deleted file mode 100644 index 656d382b29e4a4046047e2b3680ff0cc58ab1320..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10420 zcmZX4c{tQx^#6PIVK8GK``9HiqO37vUo)0I$<~l0Wh*4>EVf7}Wh;gdEvP86%^+(D zrIawFNMY=<{(OJSU%&f2_uTWG*S+^S=kCk7K{{#4%Pr0g006JGm6;O&fItUP0tq>g z%*V5i9wd;fCe|)UByx1pfqj7eN3wGHhdapjznT9F z{6FFUpB5ApR99CY$g{Jv59q^(4-aS%7w>fx+6#et`t)g#3xjZ z7JmHr@w@bls;a8@qSBvAO8XR4%gf70U)OhWY7(@AH5DQ_hqdCHaa!fvwZ7rY46P&Y#48p^ zX~fmxE#pm}z4-a^QUkZwy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ji6FIuz!nTd=K$V`}lMiwnv{A`n83wK@J zvgONbYrhJ&nAMxWDb(Bx@lF6(jQ&BVW-sBLXYAvTexuc?3Kt0JOeU7GD?i#)40*> z*|Qfu1Y5XkrF-Xw4c$@jCfMmt>04YlvUlwU@K-5*?b4+)W-LUYTB!mh12Ce{$c!0F zzialYxjT1mSiASgh3-wd;J>P^V^xJ=Fbu;OYpF@ViXw{OxvMONz=6<72)H;2A}(2+ zlfk`vuFBCn@atctgE|Rf-#N?k{S?~P%O+_BeRKTXVQsBaTlmq20}3jdCe?5@>>Egf>TFn7NSoh;{wguj&n1 uf1FFX6k^4BLUFzlVku=l?z7=nPkjSGkl0K6 \ No newline at end of file diff --git a/src/assets/poland.svg b/src/assets/poland.svg new file mode 100644 index 0000000..d5a386e --- /dev/null +++ b/src/assets/poland.svg @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/united-kingdom.svg b/src/assets/united-kingdom.svg new file mode 100644 index 0000000..60da99a --- /dev/null +++ b/src/assets/united-kingdom.svg @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/user.png b/src/assets/user.png deleted file mode 100644 index 4b429a0588c4185a8553c90e763e0bcf9da3f391..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18927 zcmeI4c|4Te`^WFGRJJ5bmMo1mVa8a7v1dm1oywLmGnis#GE>mfeO)m3vG*oJqkw- z)xzS*0R*jxPztC90AsTV3KqA6KvM`H1QAIl(DAA|r~(mh0^O|V0C%8R5`u}=QDFqP zC`Wf()DD~>9%^RFZybRF1B4Q2ScQnt5E2y?VFF!>ivsP%W*AgqNkZFU0<~BiP+^OM zvw|f#jG&;WrLT#D>mwDAhFaQsNTe=OLjeKT)`P)yU^;M3gbqpSg}JX|YWM~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D`t@jO*OIR3U_VefT0EUxc+|X5eeuG^7ZczE^ov$;Fk#Q_eBN|+vhtJ(@O8h3t_kGszC`}fTsJ$mHsRaGgIyo(NwNjC&-)t+Vm{)S>{Ey3VAg*1beI3pvY zAgD8wIX32)nVHFa@dC5>0e*wk&Oi-~jNI;?kZqrKC)t#|c`?>xTbOxEBujGmOJjHuOq_U=6L!Tm3d3KU}tC04B>aNwa+k^7fDj&@t z^HP-p`ER%K8jda-95@NfsVeeCUzLZ{Rit9bkDjt8ixN_j*>!E#4uNN>k1+yj1rD#26o6V6Ol^Yj&kkhdX2-=05+WlkB rpZtI~Q%)}@fa>h{Dvk2ig_S_gN~NzZJ{>`e|B}fD { - const classes = useStyles(); const [open, setOpen] = useState(false); const [input, setInput] = useState(''); @@ -111,12 +114,10 @@ export const Dropdown = ({ clearInput, handleClearInput }: DropdownProps) => { }; return ( - -
+ // + <> { ))} )} -
-
+ + // ); }; diff --git a/src/components/Rightbar.tsx b/src/components/Rightbar.tsx index 9796681..92f97b2 100644 --- a/src/components/Rightbar.tsx +++ b/src/components/Rightbar.tsx @@ -9,7 +9,6 @@ const RightbarStyled = styled.div` padding-left: 15px; padding-right: 15px; text-align: center; - font-family: Lato; height: 100%; width: 300px; overflow-y: scroll; @@ -64,10 +63,6 @@ export const Rightbar = () => { return ( -

- Hubert Wrzesiński

- Semestr zimowy 2020/2021 -

ZAPISZ
{filteredCourses.map((course, index) => ( diff --git a/src/components/Topbar.tsx b/src/components/Topbar.tsx index 42794bb..eae6651 100644 --- a/src/components/Topbar.tsx +++ b/src/components/Topbar.tsx @@ -1,80 +1,94 @@ import React, { useState, MouseEvent } from 'react'; import Transfer from '../assets/transfer.png'; import Search from '../assets/search.svg'; -import UK from '../assets/UK.png'; -import PL from '../assets/PL.png'; -import User from '../assets/user.png'; import CloseIcon from '../assets/close.svg'; +import ProfileIcon from '../assets/account.svg'; import { Profile } from './Profile'; import { Dropdown } from './Dropdown'; -import styled from 'styled-components'; +import PolishIcon from '../assets/poland.svg'; +import EnglishIcon from '../assets/united-kingdom.svg'; +import styled from 'styled-components/macro'; + -const TopbarTextStyled = styled.div` - @media only screen and (max-width: 670px) { - display: none; - } -`; const Topbar = styled.div` - background-color: #ffdc61; + background-color:#ECEEF4; height: 80px; padding: 5px; - font-family: comic sans MS; font-size: 24px; font-weight: bold; display: flex; justify-content: space-between; `; -const TopbarLogoWrapperStyled = styled.div` +const LogoWrapper = styled.div` display: flex; align-items: center; flex-grow: 0.5; justify-content: flex-start; `; -const TopbarLogoStyled = styled.img` - width: 80px; - height: 80px; +const Logo = styled.img` + flex-grow: 1; + width: 70px; + height: 70px; @media only screen and (max-width: 670px) { width: 60px; height: 60px; } `; -const TopbarInputStyled = styled.div` - width: 70%; +const Text = styled.div` + flex-grow: 2; + @media only screen and (max-width: 670px) { + display: none; + } +`; + +const InputWrapper = styled.div` display: flex; - flex-grow: 3; + align-items: center; + justify-content: center; + margin: 10px; + flex-grow: 9; + background-color:#f2f4f7; + border-radius: 5px; `; -const TopbarInputFieldStyled = styled.div` - width: 96%; - margin-top: 10px; +const Input = styled.div` +width: 100%; `; -const TopbarInputIconStyled = styled.img` - width: 35px; +const InputIcon = styled.img` + width: 30px; @media only screen and (max-width: 670px) { width: 25px; } cursor: pointer; `; -const TopbarIcon = styled.img` - width: 50px; +const IconWrapper = styled.div` + display: flex; + align-items: center; + justify-content: space-around; + flex-grow: 0.5; +`; + +const Icon = styled.img` + width: 40px; cursor: pointer; @media only screen and (max-width: 670px) { width: 35px; } `; -const TopbarIconBox = styled.div` - display: flex; - align-items: center; - justify-content: space-around; - flex-grow: 1.5; -`; + + +const VerticalLine = styled.div` + border-left: 1px solid black; + height: 30px; +` + interface TopbarProps { handleTransfer: (e: MouseEvent) => void; @@ -95,23 +109,25 @@ export default function ({ handleTransfer }: TopbarProps) { return ( - - - plan na plan - - - - + + + plan na plan + + + - - - - - {/* */} - - + + + + + + + {/* */} + + - + nasz student + ); } diff --git a/src/components/Transfer.tsx b/src/components/Transfer.tsx index 58442b4..4c542b4 100644 --- a/src/components/Transfer.tsx +++ b/src/components/Transfer.tsx @@ -53,7 +53,6 @@ const TransferReceiveStyled = styled.div` `; const TransferTextStyled = styled.div` - font-family: Lato; font-size: 30px; margin-bottom: 10px; `; diff --git a/src/styles/GlobalStyles.ts b/src/styles/GlobalStyles.ts index 4f68eaa..b0ec048 100644 --- a/src/styles/GlobalStyles.ts +++ b/src/styles/GlobalStyles.ts @@ -11,7 +11,7 @@ export const GlobalStyles = createGlobalStyle` margin: 0; padding: 0; line-height: 24px; - + font-family: 'B612', sans-serif; } body::-webkit-scrollbar { From 2b1aad7a08adee0b5726e71df67c88e343601501 Mon Sep 17 00:00:00 2001 From: maciekglowacki Date: Sun, 1 Nov 2020 20:57:08 +0100 Subject: [PATCH 09/19] get newest plan is working correctly --- src/contexts/CoursesProvider.tsx | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/contexts/CoursesProvider.tsx b/src/contexts/CoursesProvider.tsx index a04795d..29f2650 100644 --- a/src/contexts/CoursesProvider.tsx +++ b/src/contexts/CoursesProvider.tsx @@ -102,12 +102,19 @@ export const CoursesProvider = ({ children }: CoursesProviderProps) => { }; const getNewestTimetable = async () => { - //todo + const config = { + method: 'get' as const, + url: `${process.env.REACT_APP_API_URL}/api/v1/assignments/getCurrentAssignments`, + headers: { + Authorization: `Bearer ${token}`, + }, + }; try { - const { data: basket } = await axios.get( - `${process.env.REACT_APP_API_URL}/api/v1/assignments/getCurrentAssignments`, - ); - // setBasket(basket); + let { data: basket } = await axios.request(config); + if (basket === '') { + basket = []; + } + setBasket(basket); } catch (e) { console.log(e); } @@ -127,8 +134,10 @@ export const CoursesProvider = ({ children }: CoursesProviderProps) => { useEffect(() => { fetchClasses(); - getNewestTimetable(); - }, []); + if (token) { + getNewestTimetable(); + } + }, [token]); return ( From ab9f99df1f980dd6b3730c7be2ea137f09313706 Mon Sep 17 00:00:00 2001 From: maciekglowacki Date: Sun, 1 Nov 2020 21:13:00 +0100 Subject: [PATCH 10/19] removed eslint, not working properly --- .eslintrc.js | 56 ++++++++++++++++++++-------------------- package-lock.json | 65 ----------------------------------------------- package.json | 1 - 3 files changed, 28 insertions(+), 94 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 45af087..072442c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,28 +1,28 @@ -module.exports = { - parser: '@typescript-eslint/parser', - extends: [ - 'plugin:react/recommended', - 'plugin:@typescript-eslint/recommended', - 'prettier/@typescript-eslint', - 'plugin:prettier/recommended', - 'plugin:react-hooks/recommended', - ], - parserOptions: { - ecmaVersion: 2020, - sourceType: 'module', - ecmaFeatures: { - jsx: true, - }, - }, - rules: { - '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_|^req|^next' }], - '@typescript-eslint/no-explicit-any': 0, - '@typescript-eslint/explicit-function-return-type': 0, - 'react/prop-types': 0, - }, - settings: { - react: { - version: 'detect', - }, - }, -}; +// module.exports = { +// parser: '@typescript-eslint/parser', +// extends: [ +// 'plugin:react/recommended', +// 'plugin:@typescript-eslint/recommended', +// 'prettier/@typescript-eslint', +// 'plugin:prettier/recommended', +// 'plugin:react-hooks/recommended', +// ], +// parserOptions: { +// ecmaVersion: 2020, +// sourceType: 'module', +// ecmaFeatures: { +// jsx: true, +// }, +// }, +// rules: { +// '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_|^req|^next' }], +// '@typescript-eslint/no-explicit-any': 0, +// '@typescript-eslint/explicit-function-return-type': 0, +// 'react/prop-types': 0, +// }, +// settings: { +// react: { +// version: 'detect', +// }, +// }, +// }; diff --git a/package-lock.json b/package-lock.json index 970889e..988f68a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2012,71 +2012,6 @@ "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-15.0.0.tgz", "integrity": "sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==" }, - "@typescript-eslint/experimental-utils": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.9.1.tgz", - "integrity": "sha512-lkiZ8iBBaYoyEKhCkkw4SAeatXyBq9Ece5bZXdLe1LWBUwTszGbmbiqmQbwWA8cSYDnjWXp9eDbXpf9Sn0hLAg==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/types": "3.9.1", - "@typescript-eslint/typescript-estree": "3.9.1", - "eslint-scope": "^5.0.0", - "eslint-utils": "^2.0.0" - } - }, - "@typescript-eslint/parser": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.9.1.tgz", - "integrity": "sha512-y5QvPFUn4Vl4qM40lI+pNWhTcOWtpZAJ8pOEQ21fTTW4xTJkRplMjMRje7LYTXqVKKX9GJhcyweMz2+W1J5bMg==", - "dev": true, - "requires": { - "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "3.9.1", - "@typescript-eslint/types": "3.9.1", - "@typescript-eslint/typescript-estree": "3.9.1", - "eslint-visitor-keys": "^1.1.0" - } - }, - "@typescript-eslint/types": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-3.9.1.tgz", - "integrity": "sha512-15JcTlNQE1BsYy5NBhctnEhEoctjXOjOK+Q+rk8ugC+WXU9rAcS2BYhoh6X4rOaXJEpIYDl+p7ix+A5U0BqPTw==", - "dev": true - }, - "@typescript-eslint/typescript-estree": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.9.1.tgz", - "integrity": "sha512-IqM0gfGxOmIKPhiHW/iyAEXwSVqMmR2wJ9uXHNdFpqVvPaQ3dWg302vW127sBpAiqM9SfHhyS40NKLsoMpN2KA==", - "dev": true, - "requires": { - "@typescript-eslint/types": "3.9.1", - "@typescript-eslint/visitor-keys": "3.9.1", - "debug": "^4.1.1", - "glob": "^7.1.6", - "is-glob": "^4.0.1", - "lodash": "^4.17.15", - "semver": "^7.3.2", - "tsutils": "^3.17.1" - }, - "dependencies": { - "semver": { - "version": "7.3.2", - "resolved": "https://npm.mlabs.pl:443/semver/-/semver-7.3.2.tgz", - "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", - "dev": true - } - } - }, - "@typescript-eslint/visitor-keys": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-3.9.1.tgz", - "integrity": "sha512-zxdtUjeoSh+prCpogswMwVUJfEFmCOjdzK9rpNjNBfm6EyPt99x3RrJoBOGZO23FCt0WPKUCOL5mb/9D5LjdwQ==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^1.1.0" - } - }, "@webassemblyjs/ast": { "version": "1.8.5", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.8.5.tgz", diff --git a/package.json b/package.json index 3bc6b39..b02dc56 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,6 @@ "@types/react": "^16.9.46", "@types/react-dom": "^16.9.8", "@types/styled-components": "^5.1.2", - "@typescript-eslint/parser": "^3.9.1", "prettier": "^2.0.5", "typescript": "^3.9.7" }, From 4276d20319458f535905eab0e205ba7de4a34711 Mon Sep 17 00:00:00 2001 From: maciekglowacki Date: Sun, 1 Nov 2020 21:41:16 +0100 Subject: [PATCH 11/19] updated card expand styles --- src/components/CourseCard.tsx | 63 ++++++++++++++++++----------------- src/components/Rightbar.tsx | 12 ++----- 2 files changed, 35 insertions(+), 40 deletions(-) diff --git a/src/components/CourseCard.tsx b/src/components/CourseCard.tsx index 46ce574..b5511bd 100644 --- a/src/components/CourseCard.tsx +++ b/src/components/CourseCard.tsx @@ -7,10 +7,6 @@ import styled from 'styled-components'; import { makeStyles } from '@material-ui/core/styles'; import { ReactComponent as CloseIcon } from '../assets/close.svg'; -interface ClassExandIconProps { - isSelected: boolean; -} - const CourseStyled = styled.div` display: flex; min-height: 40px; @@ -20,51 +16,58 @@ const CourseStyled = styled.div` flex-direction: column; margin-top: 10px; padding-top: 10px; - padding-bottom: 10px; border-radius: 10px; cursor: pointer; align-items: stretch; position: relative; - box-shadow: 9px 9px 8px -2px rgba(0,0,0,0.59); + box-shadow: 9px 9px 8px -2px rgba(0, 0, 0, 0.59); `; const CourseNameStyled = styled.div` -padding-top:20px; -padding-bottom:10px; -padding-left:35px; -padding-right:35px; + padding-top: 25px; + padding-bottom: 5px; + font-size: 16px; `; - - const ClassGroupStyled = styled.div` -position:relative; + position: relative; padding-top: 1px; padding-bottom: 1px; :hover { cursor: pointer; - background-color:#9ED3FF; + background-color: #9ed3ff; } `; -const ClassExandIconStyled = styled.img` - margin-top: 5px; +interface ExpandIconProps { + isSelected: boolean; +} + +const Flexbox = styled.div` + padding-bottom: 5px; + padding-top: 5px; + display: flex; + justify-content: center; + align-items: center; +`; + +const Expand = styled.img` width: 20px; transition: 0.2s; transform: ${(props) => (props.isSelected ? 'scaleY(-1);' : 'scaleY(1);')}; `; const TypeClass = styled.div` - font-size:12px; - position:absolute; - border-radius:15px; - background-color:#00506B; - border:2px solid; - min-width:45px; - top:5px; - left:5px; - color:white; - font-weight:bold; + font-size: 12px; + position: absolute; + border-radius: 15px; + background-color: #00506b; + border: 2px solid; + min-width: 45px; + top: 5px; + left: 5px; + color: white; + font-weight: bold; `; const useStyles = makeStyles({ @@ -117,16 +120,16 @@ export const CourseCard = ({ course }: CourseCardProps) => { .sort((a, b) => b.type.localeCompare(a.type)) .map((group, index) => ( onGroupClick(group, course.id)}> - {group.type==="CLASS"? "Ćw." : "Wyk."} + {group.type === 'CLASS' ? 'Ćw.' : 'Wyk.'}

{group.time} {group.room}

{group.lecturer}

))} -
setSelected(!isSelected)}> - -
+ setSelected(!isSelected)}> + + ); }; diff --git a/src/components/Rightbar.tsx b/src/components/Rightbar.tsx index 92f97b2..9d79658 100644 --- a/src/components/Rightbar.tsx +++ b/src/components/Rightbar.tsx @@ -26,20 +26,14 @@ const RightbarStyled = styled.div` border: 1px solid; } `; -const RightbarTextStyled = styled.div` - display: flex; - flex-direction: column; -`; - const SaveButton = styled.div` display: flex; justify-content: center; align-items: center; - background-color: #417cab !important; + background-color: #417cab; border-radius: 10px; cursor: pointer; height: 40px; - background-color: red; margin-bottom: 10px; &:hover { color: white; @@ -62,9 +56,7 @@ export const Rightbar = () => { //need to insert student name from db and course maybe based on current time or from db too return ( - - ZAPISZ - + ZAPISZ {filteredCourses.map((course, index) => ( ))} From 3cbd961d3ae26e665354ec46323f5ae93c2bfb23 Mon Sep 17 00:00:00 2001 From: maciekglowacki Date: Mon, 2 Nov 2020 00:15:30 +0100 Subject: [PATCH 12/19] topbar working correctly --- package-lock.json | 5 ++ package.json | 1 + src/components/Dropdown.tsx | 105 +++++++++++++++--------------------- src/components/Topbar.tsx | 74 +++++++++++++++++-------- 4 files changed, 100 insertions(+), 85 deletions(-) diff --git a/package-lock.json b/package-lock.json index 988f68a..7433740 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10580,6 +10580,11 @@ "whatwg-fetch": "^3.0.0" } }, + "react-click-away-listener": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/react-click-away-listener/-/react-click-away-listener-1.4.3.tgz", + "integrity": "sha512-c7d6mfZuHu/rIdnEHnovX/QsScQXlqtdAynSnZUyyH+6kPOAyB40k2c5br56c/qp4KBkHD0JQV4C7rVuAmroMw==" + }, "react-dev-utils": { "version": "10.2.1", "resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-10.2.1.tgz", diff --git a/package.json b/package.json index b02dc56..a5ee4b5 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "axios": "^0.19.2", "notistack": "^1.0.1", "react": "^16.13.1", + "react-click-away-listener": "^1.4.3", "react-dom": "^16.13.1", "react-scripts": "3.4.1", "styled-components": "^5.1.1" diff --git a/src/components/Dropdown.tsx b/src/components/Dropdown.tsx index e6a4df0..008ebaa 100644 --- a/src/components/Dropdown.tsx +++ b/src/components/Dropdown.tsx @@ -1,19 +1,19 @@ -import React, { useState, useContext, useEffect, MouseEvent, ChangeEvent } from 'react'; -import ClickAwayListener from '@material-ui/core/ClickAwayListener'; +import React, { useState, useContext, useEffect, MouseEvent, forwardRef } from 'react'; import { coursesContext } from '../contexts/CoursesProvider'; import { Course } from '../types'; import styled from 'styled-components'; +const WrapperIchuj = styled.div` + max-width: 1200px; +`; + const DropdownContainer = styled.div` - position: absolute; - left: 280px; - top: 65px; - z-index: 99; - min-width: 70%; - max-height: 420px; - border-radius:3px; - overflow-y: auto; - box-shadow: 0.05em 0.2em 0.6em rgba(0,0,0,.2); + position: relative; + z-index: 99999999; + max-height: 420px; + border-radius: 3px; + overflow-y: auto; + box-shadow: 0.05em 0.2em 0.6em rgba(0, 0, 0, 0.2); scroll-snap-type: y mandatory; scroll-behavior: smooth; ::-webkit-scrollbar-track { @@ -39,38 +39,35 @@ const CourseContainer = styled.div` font-weight: 500; scroll-snap-align: end; :hover { - background-color: #ECEEF4; + background-color: #eceef4; cursor: pointer; } `; -const Input = styled.input` - background-color: #F1F2F5; - font-size: 20px; - height: 100%; - width: 100%; - border: none; - &:focus { - outline: none; - } - -` - interface DropdownProps { - clearInput: boolean; - handleClearInput: () => void; + open: boolean; + input: string; + handleCloseDropdown: () => void; } -export const Dropdown = ({ clearInput, handleClearInput }: DropdownProps) => { - - const [open, setOpen] = useState(false); - const [input, setInput] = useState(''); - +export const Dropdown = forwardRef(({ open, input, handleCloseDropdown }: DropdownProps, ref: any) => { //courses - choosenCourses const [filteredCourses, setFilteredCourses] = useState>([]); const { courses, basket, addToBasket } = useContext(coursesContext)!; + useEffect(() => { + console.log('wut'); + }, [open, input, handleCloseDropdown]); + + useEffect(() => { + console.log('input is: ', input); + }, [input]); + + useEffect(() => { + console.log('is open: ', open); + }, [open]); + useEffect(() => { const filterCourses = (input: string) => { const choosenCoursesNames = basket.map(({ name }) => name.trim()); @@ -90,17 +87,7 @@ export const Dropdown = ({ clearInput, handleClearInput }: DropdownProps) => { setFilteredCourses(filteredCourses); }; filterCourses(input); - }, [input, open, basket]); - - useEffect(() => { - clearInput && (setInput(''), handleClearInput()); - }, [clearInput]); - - const handleChange = (event: ChangeEvent) => setInput(event.target.value); - - const handleClick = () => setOpen(true); - - const handleClickAway = () => setOpen(false); + }, [input, basket]); const onCourseClick = async (event: MouseEvent) => { const target = event.currentTarget; @@ -109,29 +96,21 @@ export const Dropdown = ({ clearInput, handleClearInput }: DropdownProps) => { console.log('added course is'); console.log(course); addToBasket(course); - setOpen(false); + handleCloseDropdown(); } }; return ( - // - <> - - {open && ( - - {filteredCourses.map(({ name, id }, index) => ( - -

{name}

-
- ))} -
- )} - - //
+ + {open && ( + + {filteredCourses.map(({ name, id }, index) => ( + +

{name}

+
+ ))} +
+ )} +
); -}; +}); diff --git a/src/components/Topbar.tsx b/src/components/Topbar.tsx index eae6651..f94f8bc 100644 --- a/src/components/Topbar.tsx +++ b/src/components/Topbar.tsx @@ -1,4 +1,4 @@ -import React, { useState, MouseEvent } from 'react'; +import React, { useState, MouseEvent, ChangeEvent, useEffect } from 'react'; import Transfer from '../assets/transfer.png'; import Search from '../assets/search.svg'; import CloseIcon from '../assets/close.svg'; @@ -8,11 +8,10 @@ import { Dropdown } from './Dropdown'; import PolishIcon from '../assets/poland.svg'; import EnglishIcon from '../assets/united-kingdom.svg'; import styled from 'styled-components/macro'; - - +import ClickAwayListener from 'react-click-away-listener'; const Topbar = styled.div` - background-color:#ECEEF4; + background-color: #eceef4; height: 80px; padding: 5px; font-size: 24px; @@ -45,18 +44,32 @@ const Text = styled.div` } `; +const FlexboxColumn = styled.div` + display: flex; + flex-direction: column; + flex-grow: 9; + max-width: 1200px; +`; + const InputWrapper = styled.div` display: flex; align-items: center; - justify-content: center; - margin: 10px; - flex-grow: 9; - background-color:#f2f4f7; - border-radius: 5px; + justify-content: center; + margin-top: 15px; + background-color: #f2f4f7; + border-radius: 6px; `; -const Input = styled.div` -width: 100%; +const Input = styled.input` + background-color: #f1f2f5; + font-size: 20px; + height: 40px; + width: 100%; + margin-left: 5px; + border: none; + &:focus { + outline: none; + } `; const InputIcon = styled.img` @@ -82,12 +95,11 @@ const Icon = styled.img` } `; - - const VerticalLine = styled.div` border-left: 1px solid black; height: 30px; -` +`; + interface TopbarProps { @@ -98,6 +110,8 @@ export default function ({ handleTransfer }: TopbarProps) { const [clearInput, setClearInput] = useState(false); const [isPolish, setIsPolish] = useState(false); const [anchorEl, setAnchorEl] = useState(null); + const [open, setOpen] = useState(false); + const [input, setInput] = useState(''); const onLangChange = () => setIsPolish(!isPolish); @@ -107,20 +121,36 @@ export default function ({ handleTransfer }: TopbarProps) { const handleClearInput = () => setClearInput(!clearInput); + const handleChange = (event: ChangeEvent) => setInput(event.target.value); + + const handleClick = () => setOpen(true); + + const handleCloseDropdown = () => setOpen(false); + + const handleClickAway = () => setOpen(false); + + useEffect(() => { + clearInput && (setInput(''), handleClearInput()); + }, [clearInput]); + return ( plan na plan - - - - - - - - + + + + + + + + + + + + {/* */} From 0f155e928bb69beed1dce158acdce6725928f2df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciek=20G=C5=82owacki?= Date: Tue, 3 Nov 2020 00:59:42 +0100 Subject: [PATCH 13/19] dropdown working correctly --- public/index.html | 3 ++- src/components/Dropdown.tsx | 5 +++-- src/components/SchedulerRow.tsx | 20 ++++++++------------ src/components/Topbar.tsx | 2 +- src/constants/index.ts | 3 +++ src/styles/GlobalStyles.ts | 2 +- 6 files changed, 18 insertions(+), 17 deletions(-) diff --git a/public/index.html b/public/index.html index 30b6ea6..cbfdddb 100644 --- a/public/index.html +++ b/public/index.html @@ -10,7 +10,8 @@ - + + PlanNaPlan diff --git a/src/components/Dropdown.tsx b/src/components/Dropdown.tsx index 008ebaa..1f82b1c 100644 --- a/src/components/Dropdown.tsx +++ b/src/components/Dropdown.tsx @@ -4,7 +4,7 @@ import { Course } from '../types'; import styled from 'styled-components'; const WrapperIchuj = styled.div` - max-width: 1200px; + max-width: 1400px; `; const DropdownContainer = styled.div` @@ -86,8 +86,9 @@ export const Dropdown = forwardRef(({ open, input, handleCloseDropdown }: Dropdo ); setFilteredCourses(filteredCourses); }; + console.log("filtering courses"); filterCourses(input); - }, [input, basket]); + }, [open, input, basket]); const onCourseClick = async (event: MouseEvent) => { const target = event.currentTarget; diff --git a/src/components/SchedulerRow.tsx b/src/components/SchedulerRow.tsx index e7b80f3..8c5a53b 100644 --- a/src/components/SchedulerRow.tsx +++ b/src/components/SchedulerRow.tsx @@ -47,13 +47,10 @@ const Classes = styled.div` align-items: center; z-index: 2; border-radius: 10px; - - font-size: 0.9vw; - /* background-color: rgb(100, 181, 246); */ width: ${({ cellWidth }) => (cellWidth * 2.5) / 3}px; height: ${({ cellHeight }) => (cellHeight * 2 * 3) / 4}px; - margin-right: 5px; - text-align: center; + padding-left: 10px; + text-align: left; background-color: ${({ groupType }) => (groupType === 'CLASS' ? '#FFDC61' : '#A68820')}; box-shadow: 9px 9px 8px -2px rgba(0, 0, 0, 0.59); `; @@ -98,7 +95,7 @@ export const SchedulerRow = ({ groups, indexRow, cellTop, cellWidth, cellHeight {groups.map( (group, index) => group.day === eventIndex && ( -
+ <> handlePopoverOpen(e)} onMouseLeave={handlePopoverClose} > -

- {groups[index].name} -

- {groups[index].room} -

+
+

{groups[index].name}

+ {groups[index].room} +
{groups[index].room}

-
+ ), )} diff --git a/src/components/Topbar.tsx b/src/components/Topbar.tsx index f94f8bc..28d8b1f 100644 --- a/src/components/Topbar.tsx +++ b/src/components/Topbar.tsx @@ -48,7 +48,7 @@ const FlexboxColumn = styled.div` display: flex; flex-direction: column; flex-grow: 9; - max-width: 1200px; + max-width: 1400px; `; const InputWrapper = styled.div` diff --git a/src/constants/index.ts b/src/constants/index.ts index cd6753a..12084db 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -20,3 +20,6 @@ export const hours = [ "18:00", "19:00", ]; + + +export const MONDAY_TO_FRIDAY = 5; \ No newline at end of file diff --git a/src/styles/GlobalStyles.ts b/src/styles/GlobalStyles.ts index b0ec048..91281b6 100644 --- a/src/styles/GlobalStyles.ts +++ b/src/styles/GlobalStyles.ts @@ -11,7 +11,7 @@ export const GlobalStyles = createGlobalStyle` margin: 0; padding: 0; line-height: 24px; - font-family: 'B612', sans-serif; + font-family: 'Roboto', sans-serif; } body::-webkit-scrollbar { From c8edf6496390b33c6392af824f53ce064ece7212 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciek=20G=C5=82owacki?= Date: Sun, 8 Nov 2020 13:40:11 +0100 Subject: [PATCH 14/19] topbar dropdown width aligned with input wrapper width --- src/components/Dropdown.tsx | 12 +++++------- src/components/SchedulerRow.tsx | 4 ++-- src/components/Topbar.tsx | 17 ++++++----------- 3 files changed, 13 insertions(+), 20 deletions(-) diff --git a/src/components/Dropdown.tsx b/src/components/Dropdown.tsx index 1f82b1c..206ce34 100644 --- a/src/components/Dropdown.tsx +++ b/src/components/Dropdown.tsx @@ -3,9 +3,7 @@ import { coursesContext } from '../contexts/CoursesProvider'; import { Course } from '../types'; import styled from 'styled-components'; -const WrapperIchuj = styled.div` - max-width: 1400px; -`; + const DropdownContainer = styled.div` position: relative; @@ -102,16 +100,16 @@ export const Dropdown = forwardRef(({ open, input, handleCloseDropdown }: Dropdo }; return ( - + {open && ( - + <> {filteredCourses.map(({ name, id }, index) => (

{name}

))} -
+ )} -
+ ); }); diff --git a/src/components/SchedulerRow.tsx b/src/components/SchedulerRow.tsx index 8c5a53b..9a04014 100644 --- a/src/components/SchedulerRow.tsx +++ b/src/components/SchedulerRow.tsx @@ -51,7 +51,7 @@ const Classes = styled.div` height: ${({ cellHeight }) => (cellHeight * 2 * 3) / 4}px; padding-left: 10px; text-align: left; - background-color: ${({ groupType }) => (groupType === 'CLASS' ? '#FFDC61' : '#A68820')}; + background-color: ${({ groupType }) => (groupType === 'CLASS' ? '#FFDC61' : '#9ed3ff')}; box-shadow: 9px 9px 8px -2px rgba(0, 0, 0, 0.59); `; @@ -109,7 +109,7 @@ export const SchedulerRow = ({ groups, indexRow, cellTop, cellWidth, cellHeight >

{groups[index].name}

- {groups[index].room} +

{groups[index].room}

- {/* */} + From 7f019483cf9c35b5405572dfcba238a96ae5c16c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciek=20G=C5=82owacki?= Date: Sun, 8 Nov 2020 14:54:54 +0100 Subject: [PATCH 15/19] course card refactor --- src/assets/bin.svg | 1 + src/assets/expand.png | Bin 535 -> 0 bytes src/assets/expand.svg | 41 ++++++++++++++++++ src/components/CourseCard.tsx | 79 ++++++++++++++++++---------------- src/components/Rightbar.tsx | 3 +- src/components/Topbar.tsx | 3 +- 6 files changed, 88 insertions(+), 39 deletions(-) create mode 100644 src/assets/bin.svg delete mode 100644 src/assets/expand.png create mode 100644 src/assets/expand.svg diff --git a/src/assets/bin.svg b/src/assets/bin.svg new file mode 100644 index 0000000..cbfe7d7 --- /dev/null +++ b/src/assets/bin.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/expand.png b/src/assets/expand.png deleted file mode 100644 index 239474f92cd6e1e7dc3dca1926ca72b4c97dbd11..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 535 zcmV+y0_gpTP)0*13?gmzo_pd;>9NrFRr-nMvWWdh9C$c2qK6ef`}K< zXYrog^{6M~%`6^f8k0E5bUD+R2=zfhE>-n^6PR=w6h%=KMNt%`#pwi|fh^FQaF$AX zfgE18PTQt#-~%Z8RRAVjq!Tg(eDRa(6X*$Rs+BQS1g0DXwPA#687rwSARo|FDK+OX zbUo($-Su+i@v{FS*PzK%30QI(znUd~XIQRmQ1iP*qmjxulrUtllPLplK?Bm3&8D`T zsd%#`S<-P0I&>hjEzEEbHgHoo@H9r59pUbM+rb;c!Es0(33u*E7pw~xoJEj17Vg^p z>!L;M-!x_597qXwoCxNZ@E&v|7LZ9@V<(jYE`%~`QDqGC$fRz7wh)<1p-k+*eNw4g zf~8Wxl~86iZW%+^xvI7vfR2j(cHmAZv*Jp|FpEs;5l^ZexEIPSyOuFXUldP%Nn{q9 zC1aRD_DxA->YmM9GfliwiOLw_l4|yUt%ghyO{#= + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/components/CourseCard.tsx b/src/components/CourseCard.tsx index b5511bd..8fae122 100644 --- a/src/components/CourseCard.tsx +++ b/src/components/CourseCard.tsx @@ -1,32 +1,51 @@ import React, { useState, useContext, MouseEvent } from 'react'; import Collapse from '@material-ui/core/Collapse'; -import ExpandIcon from '../assets/expand.png'; +import { ReactComponent as Expand } from '../assets/expand.svg'; import { Course, Group } from '../types/index'; import { coursesContext } from '../contexts/CoursesProvider'; import styled from 'styled-components'; import { makeStyles } from '@material-ui/core/styles'; -import { ReactComponent as CloseIcon } from '../assets/close.svg'; +import { ReactComponent as Bin } from '../assets/bin.svg'; -const CourseStyled = styled.div` +const CourseCardWrapper = styled.div` + position: relative; display: flex; min-height: 40px; - background-color: rgb(100, 181, 246) !important; + background-color: rgb(100, 181, 246); align-items: center; justify-content: center; flex-direction: column; margin-top: 10px; - padding-top: 10px; - border-radius: 10px; + border-radius: 10px; cursor: pointer; align-items: stretch; - position: relative; box-shadow: 9px 9px 8px -2px rgba(0, 0, 0, 0.59); `; -const CourseNameStyled = styled.div` - padding-top: 25px; - padding-bottom: 5px; + +const TitleWrapper = styled.div` + display: flex; + align-items: center; + justify-content: space-between; + padding: 10px; +` + +const BinIcon = styled(Bin)` + width: 20px; + height: 20px; + max-width: 20px; + min-width: 20px; + cursor: pointer; + &:hover { + fill: white; + } +`; + +const CourseName = styled.div` + padding-left: 3px; + padding-right: 3px; font-size: 16px; + user-select: none; `; const ClassGroupStyled = styled.div` @@ -43,18 +62,13 @@ interface ExpandIconProps { isSelected: boolean; } -const Flexbox = styled.div` - padding-bottom: 5px; - padding-top: 5px; - display: flex; - justify-content: center; - align-items: center; -`; - -const Expand = styled.img` +const ExpandIcon = styled(Expand) ` width: 20px; + height: 20px; + max-width: 20px; + min-width: 20px; transition: 0.2s; - transform: ${(props) => (props.isSelected ? 'scaleY(-1);' : 'scaleY(1);')}; + transform: ${({ isSelected }) => (isSelected ? 'scaleY(-1);' : 'scaleY(1);')}; `; const TypeClass = styled.div` @@ -88,16 +102,7 @@ const useStyles = makeStyles({ }, }); -const DeleteFromBasketIcon = styled(CloseIcon)` - width: 20px; - cursor: pointer; - position: absolute; - left: 230px; - top: -5px; - &:hover { - fill: white; - } -`; + interface CourseCardProps { course: Course; @@ -112,9 +117,12 @@ export const CourseCard = ({ course }: CourseCardProps) => { const onGroupClick = (group: Group, id: number) => addGroup(group, id); return ( - - deleteFromBasket(course.id)}> - setSelected(!isSelected)}>{course.name} + + + deleteFromBasket(course.id)}> + setSelected(!isSelected)}>{course.name} + setSelected(!isSelected)} isSelected={isSelected} /> + {groups .sort((a, b) => b.type.localeCompare(a.type)) @@ -127,9 +135,6 @@ export const CourseCard = ({ course }: CourseCardProps) => { ))} - setSelected(!isSelected)}> - - - + ); }; diff --git a/src/components/Rightbar.tsx b/src/components/Rightbar.tsx index 9d79658..78cce70 100644 --- a/src/components/Rightbar.tsx +++ b/src/components/Rightbar.tsx @@ -22,7 +22,7 @@ const RightbarStyled = styled.div` } ::-webkit-scrollbar-thumb { border-radius: 10px; - background-color: #d4b851; + background-color: black; border: 1px solid; } `; @@ -30,6 +30,7 @@ const SaveButton = styled.div` display: flex; justify-content: center; align-items: center; + user-select: none; background-color: #417cab; border-radius: 10px; cursor: pointer; diff --git a/src/components/Topbar.tsx b/src/components/Topbar.tsx index 33a9308..02a0c7c 100644 --- a/src/components/Topbar.tsx +++ b/src/components/Topbar.tsx @@ -37,6 +37,7 @@ const Logo = styled.img` `; const Text = styled.div` + user-select: none; @media only screen and (max-width: 670px) { display: none; } @@ -151,7 +152,7 @@ export default function ({ handleTransfer }: TopbarProps) { - nasz student + nasz student
); From 26d6056a2bb254d0370ba397ce5e16d6bb871fba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciek=20G=C5=82owacki?= Date: Sun, 8 Nov 2020 15:49:10 +0100 Subject: [PATCH 16/19] working on table borders --- src/components/Scheduler.tsx | 44 ++++++++++++++++++++---------------- src/constants/index.ts | 12 ++++++++++ 2 files changed, 36 insertions(+), 20 deletions(-) diff --git a/src/components/Scheduler.tsx b/src/components/Scheduler.tsx index 1db75bd..febad0c 100644 --- a/src/components/Scheduler.tsx +++ b/src/components/Scheduler.tsx @@ -6,7 +6,7 @@ import styled from 'styled-components/macro'; const SchedulerWrapper = styled.div` border-collapse: collapse; - flex-grow: 1; + flex: 1; `; const TableBody = styled.div` @@ -26,22 +26,26 @@ const TableHead = styled.div` interface TableCellProps { height: number; + isHourColumn?: boolean; } const TableCell = styled.div` height: ${({ height }) => height}px; - border: 1px solid #ddd; + /* border: ${({ isHourColumn }) => !isHourColumn && '1px solid #ddd'}; */ + border-width: ${({ isHourColumn }) => !isHourColumn && '1px'}; + border-style: ${({ isHourColumn }) => !isHourColumn && 'solid dotted dotted dotted'}; + /* border-bottom: ${({ isHourColumn }) => !isHourColumn && '1px dotted #ddd'}; */ + margin-top: ${({ isHourColumn, height }) => isHourColumn ? -(height / 2) : 0}px; display: flex; align-items: center; - justify-content: center; - flex: 1; - font-size: 1.25vw; + justify-content: ${({ isHourColumn }) => isHourColumn ? 'flex-end' : 'center'}; + flex: ${({ isHourColumn }) => isHourColumn ? '1' : '5'}; + margin-right: ${({ isHourColumn }) => isHourColumn ? '10px' : '0px'}; + font-size: 0.75vw; + user-select: none; + border-collapse:collapse; `; -const T = styled.table` - width: 100%; - height: 100%; -`; export const Scheduler = () => { const cellRef = useRef(null); @@ -69,14 +73,14 @@ export const Scheduler = () => { {days.map((day, indexCell) => indexCell === 0 ? ( - + {day} ) : ( - - {day} - - ), + + {day} + + ), )} @@ -84,19 +88,19 @@ export const Scheduler = () => { {[hour, '', '', '', '', ''].map((value, indexCell) => indexCell === 0 ? ( - + {value} ) : ( - - {value} - - ), + + {value} + + ), )} ))} - + ); diff --git a/src/constants/index.ts b/src/constants/index.ts index 12084db..7b6cd9d 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -8,17 +8,29 @@ export const days = [ ]; export const hours = [ "8:00", + "8:30", "9:00", + "9:30", "10:00", + "10:30", "11:00", + "11:30", "12:00", + "12:30", "13:00", + "13:30", "14:00", + "14:30", "15:00", + "15:30", "16:00", + "16:30", "17:00", + "17:30", "18:00", + "18:30", "19:00", + "19:30", ]; From cdbbeecc70e5080c1489c0666c623f2b43a59851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciek=20G=C5=82owacki?= Date: Sun, 8 Nov 2020 18:05:21 +0100 Subject: [PATCH 17/19] table ready --- src/components/App.tsx | 2 ++ src/components/Profile.tsx | 5 ++-- src/components/Rightbar.tsx | 3 +++ src/components/Scheduler.tsx | 46 ++++++++++++++++++++++++++---------- src/components/Topbar.tsx | 41 +++++++++++++++++++------------- src/constants/index.ts | 24 +++++++++---------- 6 files changed, 77 insertions(+), 44 deletions(-) diff --git a/src/components/App.tsx b/src/components/App.tsx index 5390571..ff473d8 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -8,6 +8,8 @@ import styled from 'styled-components'; const Wrapper = styled.div` display: flex; height: calc(100vh - 80px); + background-color: #ECEEF4; + padding: 20px; `; export const App = () => { diff --git a/src/components/Profile.tsx b/src/components/Profile.tsx index cb97783..c50de4b 100644 --- a/src/components/Profile.tsx +++ b/src/components/Profile.tsx @@ -12,9 +12,8 @@ export const Profile = ({ anchorEl, handleClose }: ProfileProps) => { return ( - Profile - My account - Logout + Profil + Wyloguj ); }; diff --git a/src/components/Rightbar.tsx b/src/components/Rightbar.tsx index 78cce70..66554f3 100644 --- a/src/components/Rightbar.tsx +++ b/src/components/Rightbar.tsx @@ -25,6 +25,9 @@ const RightbarStyled = styled.div` background-color: black; border: 1px solid; } + background-color: white; + border-radius: 5px; + box-shadow: 3px 3px 3px -2px rgba(0, 0, 0, 0.59); `; const SaveButton = styled.div` display: flex; diff --git a/src/components/Scheduler.tsx b/src/components/Scheduler.tsx index febad0c..6746765 100644 --- a/src/components/Scheduler.tsx +++ b/src/components/Scheduler.tsx @@ -5,8 +5,17 @@ import { days, hours } from '../constants/index'; import styled from 'styled-components/macro'; const SchedulerWrapper = styled.div` + display: flex; border-collapse: collapse; flex: 1; + background-color: white; + padding: 5px 15px 5px 5px; + border-radius: 5px; + margin-right: 20px; + flex-direction: column; + justify-content: center; + align-items: center; + box-shadow: 3px 3px 3px -2px rgba(0, 0, 0, 0.59); `; const TableBody = styled.div` @@ -31,10 +40,9 @@ interface TableCellProps { const TableCell = styled.div` height: ${({ height }) => height}px; - /* border: ${({ isHourColumn }) => !isHourColumn && '1px solid #ddd'}; */ - border-width: ${({ isHourColumn }) => !isHourColumn && '1px'}; - border-style: ${({ isHourColumn }) => !isHourColumn && 'solid dotted dotted dotted'}; - /* border-bottom: ${({ isHourColumn }) => !isHourColumn && '1px dotted #ddd'}; */ + border-width: ${({ isHourColumn }) => !isHourColumn && '2px'}; + border-style: ${({ isHourColumn }) => !isHourColumn && 'none solid dotted none'}; + border-color: rgb(242, 243, 245); margin-top: ${({ isHourColumn, height }) => isHourColumn ? -(height / 2) : 0}px; display: flex; align-items: center; @@ -43,8 +51,12 @@ const TableCell = styled.div` margin-right: ${({ isHourColumn }) => isHourColumn ? '10px' : '0px'}; font-size: 0.75vw; user-select: none; - border-collapse:collapse; -`; + border-collapse:collapse; + :nth-child(2) { + border-left: 2px solid rgb(242, 243, 245); + } + font-weight: bold; + `; export const Scheduler = () => { @@ -77,7 +89,7 @@ export const Scheduler = () => { {day} ) : ( - + {day} ), @@ -91,11 +103,21 @@ export const Scheduler = () => { {value} - ) : ( - - {value} - - ), + ) : indexRow === 23 ? ( + + {value} + + ) : indexCell === 5 ? ( + + {value} + + ) : indexRow % 2 !== 0 ? ( + + {value} + + ) : + {value} + )} ))} diff --git a/src/components/Topbar.tsx b/src/components/Topbar.tsx index 02a0c7c..a7789ff 100644 --- a/src/components/Topbar.tsx +++ b/src/components/Topbar.tsx @@ -1,7 +1,7 @@ import React, { useState, MouseEvent, ChangeEvent, useEffect } from 'react'; import Transfer from '../assets/transfer.png'; import Search from '../assets/search.svg'; -import CloseIcon from '../assets/close.svg'; +import { ReactComponent as Close } from '../assets/close.svg'; import ProfileIcon from '../assets/account.svg'; import { Profile } from './Profile'; import { Dropdown } from './Dropdown'; @@ -11,7 +11,7 @@ import styled from 'styled-components/macro'; import ClickAwayListener from 'react-click-away-listener'; const Topbar = styled.div` - background-color: #eceef4; + background-color: #E3E5ED; height: 80px; padding: 5px; font-size: 24px; @@ -22,9 +22,10 @@ const Topbar = styled.div` const LogoWrapper = styled.div` display: flex; - justify-content: center; + justify-content: flex-start; align-items: center; flex: 2; + margin-left: 10px; `; const Logo = styled.img` @@ -37,6 +38,8 @@ const Logo = styled.img` `; const Text = styled.div` + margin-left: 10px; + font-size: 1.4rem; user-select: none; @media only screen and (max-width: 670px) { display: none; @@ -46,7 +49,7 @@ const Text = styled.div` const FlexboxColumn = styled.div` display: flex; flex-direction: column; - flex: 9; + flex: 12; `; const InputWrapper = styled.div` @@ -54,6 +57,7 @@ const InputWrapper = styled.div` margin-top: 15px; background-color: #f2f4f7; border-radius: 6px; + align-items: center; `; const Input = styled.input` @@ -61,40 +65,45 @@ const Input = styled.input` font-size: 20px; height: 40px; width: 100%; - margin-left: 5px; border: none; + margin-left: 5px; + border-top-left-radius: 6px; + border-bottom-left-radius: 6px; &:focus { outline: none; } `; -const InputIcon = styled.img` +const CloseIcon = styled(Close)` width: 30px; + height: 30px; + margin-right: 5px; @media only screen and (max-width: 670px) { width: 25px; } cursor: pointer; + :hover { + fill: grey; + } `; const IconWrapper = styled.div` display: flex; - justify-content: center; + justify-content: flex-end; align-items: center; - flex: 2; + width: 335px; `; const Icon = styled.img` width: 40px; + margin: 5px; cursor: pointer; @media only screen and (max-width: 670px) { width: 35px; } `; -const VerticalLine = styled.div` - border-left: 1px solid black; - height: 30px; -`; + @@ -139,20 +148,18 @@ export default function ({ handleTransfer }: TopbarProps) { - - - + - + {/* Maciej Głowacki */} + {/* */} - nasz student ); diff --git a/src/constants/index.ts b/src/constants/index.ts index 7b6cd9d..7898ca9 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -8,29 +8,29 @@ export const days = [ ]; export const hours = [ "8:00", - "8:30", + "", "9:00", - "9:30", + "", "10:00", - "10:30", + "", "11:00", - "11:30", + "", "12:00", - "12:30", + "", "13:00", - "13:30", + "", "14:00", - "14:30", + "", "15:00", - "15:30", + "", "16:00", - "16:30", + "", "17:00", - "17:30", + "", "18:00", - "18:30", + "", "19:00", - "19:30", + "", ]; From 49341b025b2ac5c57ded674706421a3bf9aa3127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciek=20G=C5=82owacki?= Date: Fri, 13 Nov 2020 23:05:10 +0100 Subject: [PATCH 18/19] change change change --- src/components/Scheduler.tsx | 60 +++++++++++++++++++----------- src/components/SchedulerEvents.tsx | 26 ++++++------- src/components/SchedulerRow.tsx | 8 ++-- 3 files changed, 56 insertions(+), 38 deletions(-) diff --git a/src/components/Scheduler.tsx b/src/components/Scheduler.tsx index 6746765..c5d4795 100644 --- a/src/components/Scheduler.tsx +++ b/src/components/Scheduler.tsx @@ -1,11 +1,10 @@ -import React, { useEffect, MouseEvent, useRef } from 'react'; +import React, { useEffect, MouseEvent, useRef, useCallback, useLayoutEffect } from 'react'; import { useState } from 'react'; import { SchedulerEvents } from './SchedulerEvents'; import { days, hours } from '../constants/index'; import styled from 'styled-components/macro'; const SchedulerWrapper = styled.div` - display: flex; border-collapse: collapse; flex: 1; background-color: white; @@ -66,30 +65,46 @@ export const Scheduler = () => { const wrapperRef = useRef(null); const [wrapperHeight, setWrapperHeight] = useState(0); + const [, updateState] = useState(); + const forceUpdate = useCallback(() => updateState({}), []); + useEffect(() => { const handleResize = () => { - if (cellRef.current && wrapperRef.current) { + if (cellRef.current) { setCellWidth(cellRef.current.getBoundingClientRect().width); setCellTop(cellRef.current.getBoundingClientRect().top); - setWrapperHeight(wrapperRef.current.getBoundingClientRect().height); + cellRef.current.style.backgroundColor = "blue"; + console.log("XDDD") } + }; handleResize(); - window.addEventListener('resize', handleResize); }, []); + useEffect(() => { + const handleWrapperResize = () => { + if (wrapperRef.current) { + setWrapperHeight(wrapperRef.current.getBoundingClientRect().height); + } + } + window.addEventListener('resize', handleWrapperResize); + return () => window.removeEventListener('resize', handleWrapperResize); + + }, []) + + return ( <> {days.map((day, indexCell) => indexCell === 0 ? ( - + {day} ) : ( - + {day} ), @@ -102,22 +117,25 @@ export const Scheduler = () => { indexCell === 0 ? ( {value} - - ) : indexRow === 23 ? ( - + ) + : (indexRow === 0 && indexCell === 1) ? ( {value} - ) : indexCell === 5 ? ( - - {value} - - ) : indexRow % 2 !== 0 ? ( - - {value} - - ) : - {value} - + ) : indexRow === 23 ? ( + + {value} + + ) : indexCell === 5 ? ( + + {value} + + ) : indexRow % 2 !== 0 ? ( + + {value} + + ) : + {value} + )} ))} diff --git a/src/components/SchedulerEvents.tsx b/src/components/SchedulerEvents.tsx index da8c9db..8131d5e 100644 --- a/src/components/SchedulerEvents.tsx +++ b/src/components/SchedulerEvents.tsx @@ -11,7 +11,7 @@ interface SchedulerEventsProps { export const SchedulerEvents = ({ cellTop, cellWidth, cellHeight }: SchedulerEventsProps) => { const { basket } = useContext(coursesContext)!; - + console.log(`values: cellTop: ${cellTop}, cellWidth: ${cellWidth}, cellHeight: ${cellHeight}`); const [choosenGroupsMappedToEvents, setChoosenGroupsMappedToEvents] = useState([]); interface GroupTimeToEventRowMapping { @@ -33,7 +33,7 @@ export const SchedulerEvents = ({ cellTop, cellWidth, cellHeight }: SchedulerEve const merged = [...classes, ...lectures]; //deleted if statement, maybe it is needed - const groupsMapped = merged.map(({ id, day, lecturer, room, time, name,type }) => ({ + const groupsMapped = merged.map(({ id, day, lecturer, room, time, name, type }) => ({ id, day, lecturer, @@ -56,18 +56,18 @@ export const SchedulerEvents = ({ cellTop, cellWidth, cellHeight }: SchedulerEve indexRow={index} cellTop={ index === 0 - ? cellTop + (cellHeight + cellHeight * 2 * index + cellHeight / 4) + ? cellTop + cellHeight/2 : index === 1 - ? cellTop + (cellHeight + cellHeight * 2 * index) - : index === 2 - ? cellTop + (cellHeight + cellHeight * 2 * index - cellHeight / 4) - : index === 3 - ? cellTop + (cellHeight + cellHeight * 2 * index - cellHeight / 4) - : index === 4 - ? cellTop + (cellHeight + cellHeight * 2 * index - cellHeight / 2) - : index === 5 - ? cellTop + (cellHeight + cellHeight * 2 * index - (cellHeight * 3) / 4) - : 0 + ? cellTop + (cellHeight + cellHeight * 2 * index) + : index === 2 + ? cellTop + (cellHeight + cellHeight * 2 * index - cellHeight / 2) + : index === 3 + ? cellTop + (cellHeight + cellHeight * 2 * index - cellHeight / 2) + : index === 4 + ? cellTop + (cellHeight + cellHeight * 2 * index - cellHeight) + : index === 5 + ? cellTop + (cellHeight + cellHeight * 2 * index - (cellHeight * 3) / 2) + : 0 } cellWidth={cellWidth} cellHeight={cellHeight} diff --git a/src/components/SchedulerRow.tsx b/src/components/SchedulerRow.tsx index 9a04014..fbb14ab 100644 --- a/src/components/SchedulerRow.tsx +++ b/src/components/SchedulerRow.tsx @@ -31,7 +31,7 @@ const SchedulerEvent = styled.div` top: ${({ cellTop }) => cellTop}px; left: ${({ cellWidth, eventIndex }) => cellWidth + 5 + cellWidth * eventIndex}px; width: ${({ cellWidth }) => (cellWidth * 2.5) / 3}px; - height: ${({ cellHeight }) => (cellHeight * 2 * 3) / 4}px; + height: ${({ cellHeight }) => cellHeight * 3}px; z-index: 2; `; @@ -48,7 +48,7 @@ const Classes = styled.div` z-index: 2; border-radius: 10px; width: ${({ cellWidth }) => (cellWidth * 2.5) / 3}px; - height: ${({ cellHeight }) => (cellHeight * 2 * 3) / 4}px; + height: ${({ cellHeight }) => (cellHeight * 2 * 3) / 2}px; padding-left: 10px; text-align: left; background-color: ${({ groupType }) => (groupType === 'CLASS' ? '#FFDC61' : '#9ed3ff')}; @@ -82,7 +82,7 @@ export const SchedulerRow = ({ groups, indexRow, cellTop, cellWidth, cellHeight const open = Boolean(anchorEl); return ( - <> +
{[...Array(5)].map((_, eventIndex) => ( ))} - +
); }; From 96ed785c291a0207bba989a517775e1df3b9a565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciek=20G=C5=82owacki?= Date: Thu, 19 Nov 2020 21:57:34 +0100 Subject: [PATCH 19/19] table and events finally working :') --- src/components/Scheduler.tsx | 103 +++++++++++++---------------- src/components/SchedulerEvents.tsx | 27 ++++---- src/components/SchedulerRow.tsx | 26 ++++---- 3 files changed, 71 insertions(+), 85 deletions(-) diff --git a/src/components/Scheduler.tsx b/src/components/Scheduler.tsx index c5d4795..b37e12d 100644 --- a/src/components/Scheduler.tsx +++ b/src/components/Scheduler.tsx @@ -8,7 +8,7 @@ const SchedulerWrapper = styled.div` border-collapse: collapse; flex: 1; background-color: white; - padding: 5px 15px 5px 5px; + padding: 10px 40px 25px 10px; border-radius: 5px; margin-right: 20px; flex-direction: column; @@ -18,96 +18,84 @@ const SchedulerWrapper = styled.div` `; const TableBody = styled.div` + position: relative; width: 100%; display: flex; flex-direction: column; + height: calc(100% * 25 / 26); `; const TableRow = styled.div` display: flex; + height: 100%; `; const TableHead = styled.div` display: flex; width: 100%; + height: calc(100% / 26); `; interface TableCellProps { - height: number; + cellHeight?: number; isHourColumn?: boolean; } const TableCell = styled.div` - height: ${({ height }) => height}px; border-width: ${({ isHourColumn }) => !isHourColumn && '2px'}; border-style: ${({ isHourColumn }) => !isHourColumn && 'none solid dotted none'}; - border-color: rgb(242, 243, 245); - margin-top: ${({ isHourColumn, height }) => isHourColumn ? -(height / 2) : 0}px; + border-color: rgb(242, 243, 245); display: flex; align-items: center; - justify-content: ${({ isHourColumn }) => isHourColumn ? 'flex-end' : 'center'}; - flex: ${({ isHourColumn }) => isHourColumn ? '1' : '5'}; - margin-right: ${({ isHourColumn }) => isHourColumn ? '10px' : '0px'}; - font-size: 0.75vw; + justify-content: ${({ isHourColumn }) => (isHourColumn ? 'flex-end' : 'center')}; + flex: ${({ isHourColumn }) => (isHourColumn ? '1' : '5')}; + margin-right: ${({ isHourColumn }) => (isHourColumn ? '10px' : '0px')}; + margin-top: ${({ isHourColumn, cellHeight }) => (isHourColumn ? `-${cellHeight}px` : '0px')}; + font-size: 0.75vw; user-select: none; - border-collapse:collapse; + border-collapse: collapse; :nth-child(2) { border-left: 2px solid rgb(242, 243, 245); } font-weight: bold; - `; - +`; export const Scheduler = () => { const cellRef = useRef(null); const [cellWidth, setCellWidth] = useState(0); const [cellTop, setCellTop] = useState(0); + const [cellHeight, setCellHeight] = useState(0); - const wrapperRef = useRef(null); - const [wrapperHeight, setWrapperHeight] = useState(0); - const [, updateState] = useState(); - const forceUpdate = useCallback(() => updateState({}), []); - + console.log('cell height: ', cellHeight); useEffect(() => { const handleResize = () => { if (cellRef.current) { setCellWidth(cellRef.current.getBoundingClientRect().width); setCellTop(cellRef.current.getBoundingClientRect().top); - cellRef.current.style.backgroundColor = "blue"; - console.log("XDDD") + setCellHeight(cellRef.current.getBoundingClientRect().height); + cellRef.current.style.backgroundColor = 'blue'; } - }; handleResize(); + window.addEventListener('resize', handleResize); + return () => window.removeEventListener('resize', handleResize); }, []); - useEffect(() => { - const handleWrapperResize = () => { - if (wrapperRef.current) { - setWrapperHeight(wrapperRef.current.getBoundingClientRect().height); - } - } - window.addEventListener('resize', handleWrapperResize); - return () => window.removeEventListener('resize', handleWrapperResize); - - }, []) - - return ( <> - + {days.map((day, indexCell) => indexCell === 0 ? ( - + {day} ) : ( - - {day} - - ), + + {day} + + ), )} @@ -115,32 +103,31 @@ export const Scheduler = () => { {[hour, '', '', '', '', ''].map((value, indexCell) => indexCell === 0 ? ( - - {value} - ) - : (indexRow === 0 && indexCell === 1) ? ( + {value} - ) : indexRow === 23 ? ( - - {value} - - ) : indexCell === 5 ? ( - - {value} - - ) : indexRow % 2 !== 0 ? ( - - {value} - - ) : - {value} - + ) : indexRow === 0 && indexCell === 1 ? ( + + {value} + + ) : indexRow === 23 ? ( + + {value} + + ) : indexCell === 5 ? ( + {value} + ) : indexRow % 2 !== 0 ? ( + + {value} + + ) : ( + {value} + ), )} ))} + - ); diff --git a/src/components/SchedulerEvents.tsx b/src/components/SchedulerEvents.tsx index 8131d5e..75a7048 100644 --- a/src/components/SchedulerEvents.tsx +++ b/src/components/SchedulerEvents.tsx @@ -14,10 +14,7 @@ export const SchedulerEvents = ({ cellTop, cellWidth, cellHeight }: SchedulerEve console.log(`values: cellTop: ${cellTop}, cellWidth: ${cellWidth}, cellHeight: ${cellHeight}`); const [choosenGroupsMappedToEvents, setChoosenGroupsMappedToEvents] = useState([]); - interface GroupTimeToEventRowMapping { - [time: string]: number; - } - const groupTimeToEventRowMapping: GroupTimeToEventRowMapping = { + const groupTimeToEventRowMapping: { [time: string]: number } = { '8.15': 0, '10.00': 1, '11.45': 2, @@ -56,18 +53,18 @@ export const SchedulerEvents = ({ cellTop, cellWidth, cellHeight }: SchedulerEve indexRow={index} cellTop={ index === 0 - ? cellTop + cellHeight/2 + ? cellHeight / 2 : index === 1 - ? cellTop + (cellHeight + cellHeight * 2 * index) - : index === 2 - ? cellTop + (cellHeight + cellHeight * 2 * index - cellHeight / 2) - : index === 3 - ? cellTop + (cellHeight + cellHeight * 2 * index - cellHeight / 2) - : index === 4 - ? cellTop + (cellHeight + cellHeight * 2 * index - cellHeight) - : index === 5 - ? cellTop + (cellHeight + cellHeight * 2 * index - (cellHeight * 3) / 2) - : 0 + ? cellHeight * 4 + : index === 2 + ? cellHeight * 7.5 + : index === 3 + ? cellHeight * 11.5 + : index === 4 + ? cellHeight * 15 + : index === 5 + ? cellHeight * 18.5 + : 0 } cellWidth={cellWidth} cellHeight={cellHeight} diff --git a/src/components/SchedulerRow.tsx b/src/components/SchedulerRow.tsx index fbb14ab..5c0aced 100644 --- a/src/components/SchedulerRow.tsx +++ b/src/components/SchedulerRow.tsx @@ -18,38 +18,38 @@ const useStyles = makeStyles((theme: Theme) => }), ); -interface SchedulerEventProps { +interface ClassesWrapperProps { eventIndex: number; cellTop: number; cellWidth: number; cellHeight: number; } -const SchedulerEvent = styled.div` +const ClassesWrapper = styled.div` position: absolute; display: flex; top: ${({ cellTop }) => cellTop}px; - left: ${({ cellWidth, eventIndex }) => cellWidth + 5 + cellWidth * eventIndex}px; - width: ${({ cellWidth }) => (cellWidth * 2.5) / 3}px; + left: ${({ cellWidth, eventIndex }) => (cellWidth * 1) / 5 + 15 + cellWidth * eventIndex}px; + width: ${({ cellWidth }) => cellWidth - 10}px; height: ${({ cellHeight }) => cellHeight * 3}px; z-index: 2; + padding-left: 10px; `; interface ClassesProps { - cellWidth: number; cellHeight: number; groupType: GroupType; } const Classes = styled.div` display: flex; + flex: 1; justify-content: center; align-items: center; z-index: 2; border-radius: 10px; - width: ${({ cellWidth }) => (cellWidth * 2.5) / 3}px; - height: ${({ cellHeight }) => (cellHeight * 2 * 3) / 2}px; - padding-left: 10px; + height: ${({ cellHeight }) => cellHeight * 3}px; + margin-right: 5px; text-align: left; background-color: ${({ groupType }) => (groupType === 'CLASS' ? '#FFDC61' : '#9ed3ff')}; box-shadow: 9px 9px 8px -2px rgba(0, 0, 0, 0.59); @@ -84,7 +84,7 @@ export const SchedulerRow = ({ groups, indexRow, cellTop, cellWidth, cellHeight return (
{[...Array(5)].map((_, eventIndex) => ( - { + console.log('group: ', group); + }} groupType={group.type} - cellWidth={cellWidth} cellHeight={cellHeight} id={`eventRow${indexRow}eventCol${eventIndex}${index}`} key={index} @@ -109,7 +111,7 @@ export const SchedulerRow = ({ groups, indexRow, cellTop, cellWidth, cellHeight >

{groups[index].name}

-

{groups[index].room}

+

{groups[index].room}

), )} -
+ ))}
);