diff --git a/src/components/RightBar/CourseCard/index.scss b/src/components/RightBar/CourseCard/index.scss deleted file mode 100644 index 8a15cc8..0000000 --- a/src/components/RightBar/CourseCard/index.scss +++ /dev/null @@ -1,59 +0,0 @@ -.class { - display: flex; - min-height: 50px; - background-color: rgb(100, 181, 246) !important; - align-items: center; - justify-content: center; - flex-direction: column; - margin-top: 10px; - padding-top: 10px; - padding-bottom: 10px; - border-radius: 10px; - cursor: pointer; - align-items: stretch; - &__group { - padding-top: 1px; - padding-bottom: 1px; - &:hover { - cursor: pointer; - transition: 1s; - background-color: #8bc8fb; - } - } - &__name { - padding-top: 10px; - padding-bottom: 10px; - } - &__expandIcon { - margin-top: 5px; - width: 20px; - transition: 0.2s; - } - &__expandIconRotate { - margin-top: 5px; - width: 20px; - transition: 0.5s; - transform: scaleY(-1); - } - .expanded { - max-height: 244px; - overflow-y: auto; - } - .expanded::-webkit-scrollbar-track { - border-radius: 10px; - border-radius: 10px; - background-color: #8bc8fb; - } - - .expanded::-webkit-scrollbar { - width: 12px; - border-radius: 10px; - background-color: #8bc8fb; - } - - .expanded::-webkit-scrollbar-thumb { - border-radius: 10px; - background-color: #d4b851; - border: 1px solid; - } -} diff --git a/src/components/RightBar/CourseCard/index.tsx b/src/components/RightBar/CourseCard/index.tsx index e2ca19c..68c5e98 100644 --- a/src/components/RightBar/CourseCard/index.tsx +++ b/src/components/RightBar/CourseCard/index.tsx @@ -1,10 +1,11 @@ import React, { useContext } from 'react'; -import './index.scss'; import Collapse from '@material-ui/core/Collapse'; import ExpandIcon from './expand.png'; import { Course, Group } from '../../../types/index'; import { coursesContext } from '../../../contexts/CoursesProvider'; import { group } from 'console'; +import styled from 'styled-components'; +import { makeStyles } from '@material-ui/core/styles'; interface CourseCardProps { onGroupMouseOver: (id: number, name: string) => void; @@ -14,7 +15,70 @@ interface CourseCardProps { isSelected: boolean; } +interface ClassExandIconProps { + isSelected: boolean; +} + + +const ClassStyled = styled.div` + display: flex; + min-height: 50px; + background-color: rgb(100, 181, 246) !important; + align-items: center; + justify-content: center; + flex-direction: column; + margin-top: 10px; + padding-top: 10px; + padding-bottom: 10px; + border-radius: 10px; + cursor: pointer; + align-items: stretch; +`; + +const ClassNameStyled = styled.div` + padding-top: 10px; + padding-bottom: 10px; +`; + +const ClassGroupStyled = styled.div` + padding-top: 1px; + padding-bottom: 1px; + :hover { + cursor: pointer; + transition: 1s; + background-color: #8bc8fb; + } +`; + +const ClassExandIconStyled = styled.img` + margin-top: 5px; + width: 20px; + transition: 0.2s; + transform: ${props => props.isSelected ? 'scaleY(-1);' : 'scaleY(1);'}; +` + +const useStyles = makeStyles({ + expanded: { + maxHeight: "244px", + overflowY: "auto", + }, + '@global': { + '*::-webkit-scrollbar': { + width: '0.4em' + }, + '*::-webkit-scrollbar-track': { + '-webkit-box-shadow': 'inset 0 0 6px rgba(1,0,0,0.1)' + }, + '*::-webkit-scrollbar-thumb': { + borderRadius: "10px", + backgroundColor: '#d4b851', + outline: '1px solid slategrey' + } + } +}); + export function CourseCard({ onGroupMouseOver, onCardClick, course, id, isSelected }: CourseCardProps) { + const classes = useStyles(); const { addGroup, courses } = useContext(coursesContext)!; function onGroupClick(group: Group) { @@ -22,14 +86,13 @@ export function CourseCard({ onGroupMouseOver, onCardClick, course, id, isSelect } return ( -
-
{course.name}
- + + {course.name} + {courses.map((course, index) => ( <> {course.groups.map((group, index) => ( -
onGroupMouseOver(group.id, course.name)} onClick={() => onGroupClick(group)} @@ -37,14 +100,14 @@ export function CourseCard({ onGroupMouseOver, onCardClick, course, id, isSelect

{group.time} {group.room}

{group.lecturer}

{' '} -
+ ))} ))}
- expand +
-
+ ); } diff --git a/src/components/TopBar/index.scss b/src/components/TopBar/index.scss deleted file mode 100644 index e31438e..0000000 --- a/src/components/TopBar/index.scss +++ /dev/null @@ -1,71 +0,0 @@ -.top-bar { - background-color: #ffdc61; - height: 80px; - padding: 5px; - font-family: comic sans MS; - font-size: 24px; - font-weight: bold; - display: flex; - justify-content: space-between; - - &__logo { - display: flex; - align-items: center; - flex-grow: 0.5; - justify-content: flex-start; - - &-image { - width: 80px; - height: 80px; - } - } - - &__input { - &-div { - width: 70%; - display: flex; - flex-grow: 3; - } - - &-field { - width: 96%; - margin-top: 10px; - } - - &-icon { - width: 35px; - } - } - - &__icon { - width: 50px; - cursor: pointer; - &-box { - display: flex; - align-items: center; - justify-content: space-around; - flex-grow: 1.5; - } - } - &__menu{ -margin-top: 25px; - } -} -@media only screen and (max-width: 670px) { - .top-bar { - &__tekst { - display: none; - } - &__icon { - width: 35px; - } - &__logo-image { - width: 60px; - height: 60px; - } - - &__input-icon { - width: 25px; - } - } -} diff --git a/src/components/TopBar/index.tsx b/src/components/TopBar/index.tsx index d00f7a6..5556ced 100644 --- a/src/components/TopBar/index.tsx +++ b/src/components/TopBar/index.tsx @@ -1,111 +1,152 @@ -import React from "react"; -import "./index.scss"; -import Transfer from "./transfer.png"; -import Search from "./search.svg"; -import UK from "./UK.png"; -import PL from "./PL.png"; -import User from "./user.png"; -import CloseIcon from "./close.svg"; -import { Profile } from "./Profile"; -import {Results} from "./Results"; +import React from 'react'; +import Transfer from './transfer.png'; +import Search from './search.svg'; +import UK from './UK.png'; +import PL from './PL.png'; +import User from './user.png'; +import CloseIcon from './close.svg'; +import { Profile } from './Profile'; +import { Results } from './Results'; +import styled from 'styled-components'; interface TopBarProps { - handleTransfer: (e: React.MouseEvent) => void; - onLangChange: (lang: boolean) => void; - handleLogout: () => void; + handleTransfer: (e: React.MouseEvent) => void; + onLangChange: (lang: boolean) => void; + handleLogout: () => void; } interface TopBarState { - isPolish: boolean; - anchorEl: HTMLElement | null; + isPolish: boolean; + anchorEl: HTMLElement | null; } +const TopBarTekstStyled = styled.div` + @media only screen and (max-width: 670px) { + display: none; + } +`; + +const TopBarStyled = styled.div` + background-color: #ffdc61; + height: 80px; + padding: 5px; + font-family: comic sans MS; + font-size: 24px; + font-weight: bold; + display: flex; + justify-content: space-between; +`; + +const TopBarLogoStyled = styled.div` + display: flex; + align-items: center; + flex-grow: 0.5; + justify-content: flex-start; +`; + +const TopBarLogoImageStyled = styled.img` + width: 80px; + height: 80px; + @media only screen and (max-width: 670px) { + width: 60px; + height: 60px; + } +`; + +const TopBarInputDivStyled = styled.div` + width: 70%; + display: flex; + flex-grow: 3; +`; + +const TopBarInputFieldStyled = styled.div` + width: 96%; + margin-top: 10px; +`; + +const TopBarInputIconStyled = styled.img` + width: 35px; + @media only screen and (max-width: 670px) { + width: 25px; + } +`; + +const TopBarIcon = styled.img` + width: 50px; + 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; +`; + export default class TopBar extends React.Component { - constructor(props: TopBarProps) { - super(props); - this.handleProfile = this.handleProfile.bind(this); - this.handleClose = this.handleClose.bind(this); - this.onLangChange = this.onLangChange.bind(this); - this.handleTransfer = this.handleTransfer.bind(this); - this.state = { - isPolish: true, - anchorEl: null, - }; - } + constructor(props: TopBarProps) { + super(props); + this.handleProfile = this.handleProfile.bind(this); + this.handleClose = this.handleClose.bind(this); + this.onLangChange = this.onLangChange.bind(this); + this.handleTransfer = this.handleTransfer.bind(this); + this.state = { + isPolish: true, + anchorEl: null, + }; + } - handleTransfer(e: React.MouseEvent) { - this.props.handleTransfer(e); - } + handleTransfer(e: React.MouseEvent) { + this.props.handleTransfer(e); + } - onLangChange(e: React.MouseEvent) { - this.setState({ - isPolish: !this.state.isPolish, - }); - this.props.onLangChange(this.state.isPolish); - } + onLangChange(e: React.MouseEvent) { + this.setState({ + isPolish: !this.state.isPolish, + }); + this.props.onLangChange(this.state.isPolish); + } - handleProfile(event: React.MouseEvent) { - this.setState({ - anchorEl: event.currentTarget, - }); - } + handleProfile(event: React.MouseEvent) { + this.setState({ + anchorEl: event.currentTarget, + }); + } - handleClose() { - this.setState({ - anchorEl: null, - }); - } + handleClose() { + this.setState({ + anchorEl: null, + }); + } - render() { - return ( -
-
- logo -
plan na plan
-
-
- search -
- close -
-
- transfer - change_language - profile - -
-
- ); - } + render() { + return ( + + + + plan na plan + + + + + + + + + + + + + + + + ); + } } diff --git a/src/components/Transfer/index.tsx b/src/components/Transfer/index.tsx index 7f4ba6f..40ed89f 100644 --- a/src/components/Transfer/index.tsx +++ b/src/components/Transfer/index.tsx @@ -3,6 +3,9 @@ import Modal from "@material-ui/core/Modal"; import "./index.scss"; import Fade from '@material-ui/core/Fade'; import Input from "@material-ui/core/Input"; +import { makeStyles } from '@material-ui/core/styles'; +import styled from 'styled-components'; + interface TransferProps { handleClose: (e: React.MouseEvent) => void; isOpen: boolean; @@ -10,6 +13,15 @@ interface TransferProps { interface TransferState {} +const useStyles = makeStyles({ + wrapper: { + display: "flex", + justifyContent: "center", + textAlign: "center", + alignItems: "center", + }, +}); + export default class Transfer extends React.Component< TransferProps, TransferState