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&kAI)%8j2PRrC4fyow^J?b2juXya*ClW6{nHf5!n5l&Ug|&9)X%S(m(qi-M4Hb4
z%b1&}s_S~gJ+Ef|{CThAW^!Y%o01oK|0*oJoa$YC{8PimhWhy_ec5Bu{D<=q70{9#=RNO{(y&m#<%p;$Y2a-vp7yPO3M#%TjxFOb;5hK1$mwm3>
z$>f2JpqnwS2f6I^HpLera6ROSM|Mn`Hf5h1*U%h?z_Vq^JP+#+I%$U{3aR2nvINkRS&jtugBdzuM(Y3
zxa{?I-hWM~eP=V@Va%)2*DYDHWS`c9U;iF&ra*+B&j3TRWFzBVZEOHryZ7Pl)>Nd!
zJGT#c|2sv+Z52LM`sM33t=p{hf}eapc{1Kg0>27;i~$R>REtc0rP#{78FzQ3!nhT@
zZE=y;6w<1TA78s;$Cgd&)@|Mly(s>dNyudFM<8TKmS_Yw{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.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F=radB~cP*9Lf!wyLA8QaN)>+V=0krTYF=~gIRx0J>9(wD7zajy<6T1LgdIm^5%?9}=de~M
zAe`=YpNu1!9!PAE#FP;JmBrZlE
zOVC1UN3a`saX0DVoZcf>nbo-F7%pM5I
zK&heNT}5e7XJEgExx4%6t66VUHzMY^)sSV_=((vJQB}t)k%0;zy}3{0
z!%TQ^gUKfZc1mN7nVH$#$9{63vto05dtP?7g7U}x7>v6aTb>-_h$ER
zbP`W9*a;;B243qr-rUiVPkflaK5{g|Ebil_&^KoRMv1F{c1SP$NnNZNxQVU3D!>y0
z8ocSdx{fVJL^HI-eSx*k6qn|{zOyNs-d13lbv+zCF^oBK;)DtkiOdT+H!p53?CEZ}
zF-OKNd#0=;H&;nrOH0D`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 (
);
};
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}
),
)}
-
+
))}
);