└── lesson_1_(25.06.2021)
├── Plan
└── university
├── .gitignore
├── README.md
├── package.json
├── public
├── favicon.ico
├── images
│ └── logo.png
├── index.html
├── logo192.png
├── logo512.png
├── manifest.json
└── robots.txt
├── src
├── App.css
├── App.jsx
├── components
│ ├── Button
│ │ ├── Button.jsx
│ │ └── Button.styled.jsx
│ ├── Card
│ │ ├── Card.jsx
│ │ └── Card.styles.jsx
│ ├── Cities
│ │ ├── Cities.jsx
│ │ ├── Cities.styled.jsx
│ │ ├── CitiesList
│ │ │ ├── CitiesList.jsx
│ │ │ └── CitiesList.styled.jsx
│ │ └── img
│ │ │ └── pin.png
│ ├── Departments
│ │ ├── Departments.jsx
│ │ ├── Departments.styled.jsx
│ │ ├── DepartmentsList
│ │ │ ├── DepartmentsList.jsx
│ │ │ └── DepartmentsList.styled.jsx
│ │ └── img
│ │ │ └── robot.png
│ ├── Info
│ │ ├── Info.jsx
│ │ └── Info.styles.jsx
│ ├── Main
│ │ ├── Main.jsx
│ │ └── Main.styles.jsx
│ ├── PageHeader
│ │ ├── PageHeader.jsx
│ │ └── PageHeader.styles.jsx
│ ├── Paper
│ │ ├── Paper.jsx
│ │ └── Paper.styles.jsx
│ ├── Sidebar
│ │ ├── Sidebar.jsx
│ │ └── Sidebar.styles.jsx
│ ├── Tutors
│ │ ├── Tutors.jsx
│ │ ├── Tutors.styled.jsx
│ │ ├── TutorsList
│ │ │ ├── TutorsList.jsx
│ │ │ └── TutorsList.styled.jsx
│ │ └── img
│ │ │ └── cat.png
│ └── Wrapper
│ │ ├── Wrapper.jsx
│ │ └── Wrapper.styles.jsx
├── data
│ └── university.json
├── index.css
├── index.js
└── utils
│ └── menu.js
└── yarn.lock
/lesson_1_(25.06.2021)/Plan:
--------------------------------------------------------------------------------
1 | 1) Обзор файлов
2 | React snipets
3 | 2) Обзор макета
4 | 3) Создание папки с компонентами
5 | 4) Разбиение макета на компоненты
6 | 5) Работа с колекциями
7 | 6) Работа с пропсами
8 | 7) prop-types
9 | 8) conditional render
10 |
11 |
12 | Wrapper
13 | Paper
14 | Sidebar
15 | header
16 | menu
17 | userInfo
18 | Main
19 | Info
20 | Card
21 | Description
22 | tutors
23 | cities
24 | departments
25 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/README.md:
--------------------------------------------------------------------------------
1 | # Getting Started with Create React App
2 |
3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
4 |
5 | ## Available Scripts
6 |
7 | In the project directory, you can run:
8 |
9 | ### `yarn start`
10 |
11 | Runs the app in the development mode.\
12 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
13 |
14 | The page will reload if you make edits.\
15 | You will also see any lint errors in the console.
16 |
17 | ### `yarn test`
18 |
19 | Launches the test runner in the interactive watch mode.\
20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21 |
22 | ### `yarn build`
23 |
24 | Builds the app for production to the `build` folder.\
25 | It correctly bundles React in production mode and optimizes the build for the best performance.
26 |
27 | The build is minified and the filenames include the hashes.\
28 | Your app is ready to be deployed!
29 |
30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31 |
32 | ### `yarn eject`
33 |
34 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
35 |
36 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37 |
38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
39 |
40 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
41 |
42 | ## Learn More
43 |
44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45 |
46 | To learn React, check out the [React documentation](https://reactjs.org/).
47 |
48 | ### Code Splitting
49 |
50 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
51 |
52 | ### Analyzing the Bundle Size
53 |
54 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
55 |
56 | ### Making a Progressive Web App
57 |
58 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
59 |
60 | ### Advanced Configuration
61 |
62 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
63 |
64 | ### Deployment
65 |
66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
67 |
68 | ### `yarn build` fails to minify
69 |
70 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
71 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "university",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@emotion/react": "^11.4.0",
7 | "@emotion/styled": "^11.3.0",
8 | "@testing-library/jest-dom": "^5.11.4",
9 | "@testing-library/react": "^11.1.0",
10 | "@testing-library/user-event": "^12.1.10",
11 | "prop-types": "^15.7.2",
12 | "react": "^17.0.2",
13 | "react-dom": "^17.0.2",
14 | "react-icons": "^4.2.0",
15 | "react-scripts": "4.0.3",
16 | "web-vitals": "^1.0.1"
17 | },
18 | "scripts": {
19 | "start": "react-scripts start",
20 | "build": "react-scripts build",
21 | "test": "react-scripts test",
22 | "eject": "react-scripts eject"
23 | },
24 | "eslintConfig": {
25 | "extends": [
26 | "react-app",
27 | "react-app/jest"
28 | ]
29 | },
30 | "browserslist": {
31 | "production": [
32 | ">0.2%",
33 | "not dead",
34 | "not op_mini all"
35 | ],
36 | "development": [
37 | "last 1 chrome version",
38 | "last 1 firefox version",
39 | "last 1 safari version"
40 | ]
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VovaMelnyk/React30/8c747330e7b5ae3a89434ced65a3f29bb5b72c93/lesson_1_(25.06.2021)/university/public/favicon.ico
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/public/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VovaMelnyk/React30/8c747330e7b5ae3a89434ced65a3f29bb5b72c93/lesson_1_(25.06.2021)/university/public/images/logo.png
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
17 |
18 |
19 |
20 |
21 |
30 | React App
31 |
32 |
33 |
34 |
35 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VovaMelnyk/React30/8c747330e7b5ae3a89434ced65a3f29bb5b72c93/lesson_1_(25.06.2021)/university/public/logo192.png
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VovaMelnyk/React30/8c747330e7b5ae3a89434ced65a3f29bb5b72c93/lesson_1_(25.06.2021)/university/public/logo512.png
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/App.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VovaMelnyk/React30/8c747330e7b5ae3a89434ced65a3f29bb5b72c93/lesson_1_(25.06.2021)/university/src/App.css
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/App.jsx:
--------------------------------------------------------------------------------
1 | import Wrapper from "./components/Wrapper/Wrapper";
2 | import "./App.css";
3 |
4 | function App() {
5 | return ;
6 | }
7 |
8 | export default App;
9 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/Button/Button.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { CustomButton } from "./Button.styled";
3 | function Button({ text, onClick }) {
4 | return {text};
5 | }
6 |
7 | export default Button;
8 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/Button/Button.styled.jsx:
--------------------------------------------------------------------------------
1 | import styled from "@emotion/styled";
2 |
3 | export const CustomButton = styled.button`
4 | background-color: #ff6b0a;
5 | border: none;
6 | outline: none;
7 | padding: 8px 16px;
8 | color: #fff;
9 | font-weight: bold;
10 | font-size: 14px;
11 | line-height: 24px;
12 | text-transform: uppercase;
13 | cursor: pointer;
14 | `;
15 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/Card/Card.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { HiPencilAlt, HiTrash } from "react-icons/hi";
3 | import PropTypes from "prop-types";
4 | import Paper from "../Paper/Paper";
5 | import { OrganizationType, Name, Actions, Image } from "./Card.styles";
6 |
7 | function Card({ name }) {
8 | return (
9 |
10 |
11 | университет
12 | {name}
13 |
14 |
15 |
16 |
17 |
18 | );
19 | }
20 |
21 | Card.propTypes = {
22 | name: PropTypes.string.isRequired,
23 | };
24 |
25 | export default Card;
26 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/Card/Card.styles.jsx:
--------------------------------------------------------------------------------
1 | import styled from "@emotion/styled";
2 |
3 | export const Image = styled.img`
4 | width: 80px;
5 | height: 80px;
6 | margin-bottom: 8px;
7 | display: block;
8 | `;
9 | export const OrganizationType = styled.p`
10 | font-weight: normal;
11 | font-size: 12px;
12 | line-height: 16px;
13 | text-align: center;
14 | margin-bottom: 8px;
15 | `;
16 |
17 | export const Name = styled.p`
18 | font-weight: bold;
19 | font-size: 14px;
20 | line-height: 24px;
21 | text-align: center;
22 | margin-bottom: 8px;
23 | `;
24 |
25 | export const Actions = styled.div`
26 | display: grid;
27 | grid-template-columns: repeat(2, 24px);
28 | grid-column-gap: 32px;
29 | `;
30 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/Cities/Cities.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import Button from "../Button/Button";
3 | import { Container, Box, Img, Title } from "./Cities.styled";
4 | import CitiesList from "./CitiesList/CitiesList";
5 | import src from "./img/pin.png";
6 | function Cities() {
7 | return (
8 |
9 |
10 |
11 | Города
12 |
13 |
14 |
15 |
16 | );
17 | }
18 |
19 | export default Cities;
20 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/Cities/Cities.styled.jsx:
--------------------------------------------------------------------------------
1 | import styled from "@emotion/styled";
2 |
3 | export const Container = styled.div`
4 | margin-bottom: 24px;
5 | `;
6 |
7 | export const Box = styled.div`
8 | display: grid;
9 | grid-template-columns: 24px auto;
10 | grid-column-gap: 8px;
11 | margin-bottom: 40px;
12 | `;
13 |
14 | export const Title = styled.h2`
15 | font-weight: bold;
16 | font-size: 14px;
17 | line-height: 24px;
18 | text-transform: uppercase;
19 | `;
20 |
21 | export const Img = styled.img`
22 | width: 24px;
23 | height: 24px;
24 | `;
25 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/Cities/CitiesList/CitiesList.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import Paper from "../../Paper/Paper";
3 | import data from "../../../data/university.json";
4 | import { Container, Text } from "./CitiesList.styled";
5 | function CitiesList() {
6 | return (
7 |
8 | {data.cities.map((city) => (
9 |
10 | {city}
11 |
12 | ))}
13 |
14 | );
15 | }
16 |
17 | export default CitiesList;
18 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/Cities/CitiesList/CitiesList.styled.jsx:
--------------------------------------------------------------------------------
1 | import styled from "@emotion/styled";
2 |
3 | export const Container = styled.div`
4 | display: grid;
5 | grid-template-columns: repeat(3, minmax(auto, 370px));
6 | grid-column-gap: 24px;
7 | margin-bottom: 24px;
8 | `;
9 |
10 | export const Text = styled.p`
11 | font-weight: normal;
12 | font-size: 16px;
13 | line-height: 24px;
14 | `;
15 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/Cities/img/pin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VovaMelnyk/React30/8c747330e7b5ae3a89434ced65a3f29bb5b72c93/lesson_1_(25.06.2021)/university/src/components/Cities/img/pin.png
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/Departments/Departments.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import Button from "../Button/Button";
3 | import { Container, Box, Img, Title } from "./Departments.styled";
4 | import DepartmentsList from "../Departments/DepartmentsList/DepartmentsList";
5 | import src from "./img/robot.png";
6 | function Departments() {
7 | return (
8 |
9 |
10 |
11 | Факультет
12 |
13 |
14 |
15 |
16 | );
17 | }
18 |
19 | export default Departments;
20 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/Departments/Departments.styled.jsx:
--------------------------------------------------------------------------------
1 | import styled from "@emotion/styled";
2 |
3 | export const Container = styled.div`
4 | margin-bottom: 24px;
5 | `;
6 |
7 | export const Box = styled.div`
8 | display: grid;
9 | grid-template-columns: 24px auto;
10 | grid-column-gap: 8px;
11 | margin-bottom: 40px;
12 | `;
13 |
14 | export const Title = styled.h2`
15 | font-weight: bold;
16 | font-size: 14px;
17 | line-height: 24px;
18 | text-transform: uppercase;
19 | `;
20 |
21 | export const Img = styled.img`
22 | width: 24px;
23 | height: 24px;
24 | `;
25 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/Departments/DepartmentsList/DepartmentsList.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import Paper from "../../Paper/Paper";
3 | import data from "../../../data/university.json";
4 | import { Container, Text } from "./DepartmentsList.styled";
5 | function DepartmentsList() {
6 | return (
7 |
8 | {data.department.map((department) => (
9 |
10 | {department.name}
11 |
12 | ))}
13 |
14 | );
15 | }
16 |
17 | export default DepartmentsList;
18 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/Departments/DepartmentsList/DepartmentsList.styled.jsx:
--------------------------------------------------------------------------------
1 | import styled from "@emotion/styled";
2 |
3 | export const Container = styled.div`
4 | display: grid;
5 | grid-template-columns: repeat(3, minmax(auto, 370px));
6 | grid-column-gap: 24px;
7 | margin-bottom: 24px;
8 | `;
9 |
10 | export const Text = styled.p`
11 | font-weight: normal;
12 | font-size: 16px;
13 | line-height: 24px;
14 | `;
15 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/Departments/img/robot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VovaMelnyk/React30/8c747330e7b5ae3a89434ced65a3f29bb5b72c93/lesson_1_(25.06.2021)/university/src/components/Departments/img/robot.png
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/Info/Info.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import Card from "../Card/Card";
3 | import data from "../../data/university.json";
4 | import { Container, Text } from "./Info.styles";
5 | import Paper from "../Paper/Paper";
6 |
7 | function Info() {
8 | return (
9 |
10 |
11 |
12 | {data.description}
13 |
14 |
15 | );
16 | }
17 |
18 | export default Info;
19 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/Info/Info.styles.jsx:
--------------------------------------------------------------------------------
1 | import styled from "@emotion/styled";
2 |
3 | export const Container = styled.div`
4 | display: grid;
5 | grid-template-columns: 144px auto;
6 | grid-column-gap: 32px;
7 | margin-bottom: 32px;
8 | `;
9 |
10 | export const Text = styled.p`
11 | font-weight: normal;
12 | font-size: 16px;
13 | line-height: 24px;
14 | `;
15 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/Main/Main.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { MainContainer } from "./Main.styles";
3 | import Info from "../Info/Info";
4 | import PageHeader from "../PageHeader/PageHeader";
5 | import Tutors from "../Tutors/Tutors";
6 | import Cities from "../Cities/Cities";
7 | import Departments from "../Departments/Departments";
8 | function Main() {
9 | return (
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | );
18 | }
19 |
20 | export default Main;
21 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/Main/Main.styles.jsx:
--------------------------------------------------------------------------------
1 | import styled from "@emotion/styled";
2 |
3 | export const MainContainer = styled.main`
4 | padding: 32px;
5 | `;
6 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/PageHeader/PageHeader.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Header } from "./PageHeader.styles";
3 | function PageHeader() {
4 | return Информация о университете;
5 | }
6 |
7 | export default PageHeader;
8 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/PageHeader/PageHeader.styles.jsx:
--------------------------------------------------------------------------------
1 | import styled from "@emotion/styled";
2 |
3 | export const Header = styled.header`
4 | font-weight: bold;
5 | font-size: 14px;
6 | line-height: 24px;
7 | text-align: right;
8 | color: #010101;
9 | margin-bottom: 32px;
10 | text-transform: uppercase;
11 | `;
12 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/Paper/Paper.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import PropTypes from "prop-types";
3 | import { PaperContainer } from "./Paper.styles";
4 | function Paper({ children, gap }) {
5 | return {children};
6 | }
7 |
8 | Paper.propTypes = {
9 | children: PropTypes.node.isRequired,
10 | gap: PropTypes.number,
11 | };
12 |
13 | Paper.defaultProps = {
14 | gap: 16,
15 | };
16 |
17 | export default Paper;
18 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/Paper/Paper.styles.jsx:
--------------------------------------------------------------------------------
1 | import styled from "@emotion/styled";
2 |
3 | export const PaperContainer = styled.div`
4 | padding: ${(props) => props.gap}px;
5 | background-color: #fff;
6 | `;
7 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/Sidebar/Sidebar.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Aside, Header, MenuItem, Menu, Text } from "./Sidebar.styles";
3 | import { menuConfig } from "../../utils/menu";
4 | function Sidebar() {
5 | console.log("menuConfig :>> ", menuConfig);
6 | return (
7 |
17 | );
18 | }
19 |
20 | export default Sidebar;
21 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/Sidebar/Sidebar.styles.jsx:
--------------------------------------------------------------------------------
1 | import styled from "@emotion/styled";
2 |
3 | export const Aside = styled.aside`
4 | background-color: #fff;
5 | `;
6 |
7 | export const Header = styled.header`
8 | background-color: #161d2a;
9 | height: 80px;
10 | `;
11 |
12 | export const Menu = styled.ul`
13 | list-style: none;
14 | padding: 24px;
15 | `;
16 |
17 | export const MenuItem = styled.li`
18 | display: flex;
19 | align-items: center;
20 | cursor: pointer;
21 | font-style: normal;
22 | font-weight: bold;
23 | font-size: 14px;
24 | line-height: 24px;
25 | text-transform: uppercase;
26 | margin-bottom: 24px;
27 |
28 | & svg {
29 | fill: #ff6b0a;
30 | width: 24px;
31 | height: 24px;
32 | }
33 | `;
34 |
35 | export const Text = styled.span`
36 | font-size: 14px;
37 | font-weight: 700;
38 | color: #010101;
39 | margin-left: 16px;
40 |
41 | &:hover {
42 | color: #ff6b0a;
43 | }
44 | `;
45 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/Tutors/Tutors.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import TutorList from "./TutorsList/TutorsList";
3 | import Button from "../Button/Button";
4 | import { Container, Box, Title, Img } from "./Tutors.styled";
5 | import src from "./img/cat.png";
6 | function Tutors() {
7 | return (
8 |
9 |
10 |
11 | Преподаватели
12 |
13 |
14 |
15 |
16 | );
17 | }
18 |
19 | export default Tutors;
20 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/Tutors/Tutors.styled.jsx:
--------------------------------------------------------------------------------
1 | import styled from "@emotion/styled";
2 |
3 | export const Container = styled.div`
4 | margin-bottom: 24px;
5 | `;
6 |
7 | export const Box = styled.div`
8 | display: grid;
9 | grid-template-columns: 24px auto;
10 | grid-column-gap: 8px;
11 | margin-bottom: 40px;
12 | `;
13 |
14 | export const Title = styled.h2`
15 | font-weight: bold;
16 | font-size: 14px;
17 | line-height: 24px;
18 | text-transform: uppercase;
19 | `;
20 |
21 | export const Img = styled.img`
22 | width: 24px;
23 | height: 24px;
24 | `;
25 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/Tutors/TutorsList/TutorsList.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import data from "../../../data/university.json";
3 | import {
4 | Container,
5 | Item,
6 | ItemContact,
7 | ItemContacts,
8 | ItemInfo,
9 | Options,
10 | } from "./TutorsList.styled";
11 | function TutorsList() {
12 | const { tutors } = data;
13 | return (
14 |
15 | {tutors.map((tutor) => (
16 | -
17 |
18 | {tutor.lastName} {tutor.firstName} {tutor.patronymic}
19 |
20 |
21 | {tutor.phone}
22 | {tutor.email}
23 | {tutor.city}
24 |
25 | {tutor.options}
26 |
27 | ))}
28 |
29 | );
30 | }
31 |
32 | export default TutorsList;
33 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/Tutors/TutorsList/TutorsList.styled.jsx:
--------------------------------------------------------------------------------
1 | import styled from "@emotion/styled";
2 |
3 | export const Container = styled.div`
4 | margin-bottom: 24px;
5 | `;
6 |
7 | export const Item = styled.div`
8 | display: grid;
9 | grid-template-columns: 130px 270px 1fr;
10 | grid-column-gap: 24px;
11 | align-items: center;
12 | margin-bottom: 24px;
13 | background-color: #fff;
14 | padding: 16px;
15 | `;
16 |
17 | export const ItemInfo = styled.p`
18 | font-weight: normal;
19 | font-size: 16px;
20 | line-height: 24px;
21 | `;
22 |
23 | export const ItemContacts = styled.div`
24 | margin-bottom: 8px;
25 | `;
26 |
27 | export const ItemContact = styled.p`
28 | font-weight: normal;
29 | font-size: 16px;
30 | line-height: 24px;
31 | `;
32 |
33 | export const Options = styled.p`
34 | font-style: normal;
35 | font-weight: normal;
36 | font-size: 16px;
37 | line-height: 24px;
38 | `;
39 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/Tutors/img/cat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VovaMelnyk/React30/8c747330e7b5ae3a89434ced65a3f29bb5b72c93/lesson_1_(25.06.2021)/university/src/components/Tutors/img/cat.png
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/Wrapper/Wrapper.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import Sidebar from "../Sidebar/Sidebar";
3 | import Main from "../Main/Main";
4 | import { Container } from "./Wrapper.styles";
5 | const Wrapper = () => {
6 | return (
7 |
8 |
9 |
10 |
11 | );
12 | };
13 |
14 | export default Wrapper;
15 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/components/Wrapper/Wrapper.styles.jsx:
--------------------------------------------------------------------------------
1 | import styled from "@emotion/styled";
2 |
3 | export const Container = styled.div`
4 | background-color: #f5f5f5;
5 | display: grid;
6 | grid-template-columns: 320px auto;
7 | `;
8 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/data/university.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "MIT",
3 | "description": "Опыт, концентрат знаний и возможность избежать большинство ошибок при приеме на работу. Мы знаем, что хотят большинство локальных и иностранных компаний и можем вам это дать. А еще мы постоянно совершенствуем наши курсы программирования, добавляя туда что-то новое. Вы можете лично ознакомиться с историями успеха наших выпускников, чтобы убедиться в эффективности нашей методики обучения. Да, мы начнем с азов и самой простой информации. Знаем, что большинство людей приходят к нам с нулевыми знаниями. ",
4 | "tutors": [
5 | {
6 | "firstName" : "Мария",
7 | "lastName" : "Руденко",
8 | "patronymic" : "Александровна",
9 | "phone": "+38(097) 448 73 11",
10 | "email" : "rudenko.mail@gmail.com",
11 | "city": "Полтава",
12 | "options" : "Создание групп"
13 | },
14 | {
15 | "firstName" : "Елена",
16 | "lastName" : "Иванова",
17 | "patronymic" : "Александровна",
18 | "phone": "+38(093) 443 43 51",
19 | "email" : "ivanova.mail@gmail.com",
20 | "city": "Берлин",
21 | "options" : "Создание групп, редактировани профилей преподавателей"
22 | }
23 | ],
24 | "cities": [
25 | "Киев", "Лондон", "Берлин"
26 | ],
27 | "department": [
28 | {"name" : "Факультет информатики и выычислительной техники"},
29 | {"name": "Факультет искуственого интелекта"},
30 | {"name": "Факультет аналитики"}
31 |
32 | ]
33 | }
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/index.css:
--------------------------------------------------------------------------------
1 | @import-normalize; /* bring in normalize.css styles */
2 |
3 | body {
4 | margin: 0;
5 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
6 | "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
7 | sans-serif;
8 | -webkit-font-smoothing: antialiased;
9 | -moz-osx-font-smoothing: grayscale;
10 | }
11 |
12 | code {
13 | font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
14 | monospace;
15 | }
16 |
17 | * {
18 | font-family: "Montserrat", sans-serif;
19 | padding: 0;
20 | margin: 0;
21 | }
22 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom";
3 | import "./index.css";
4 | import App from "./App.jsx";
5 |
6 | ReactDOM.render(
7 |
8 |
9 | ,
10 | document.getElementById("root")
11 | );
12 |
--------------------------------------------------------------------------------
/lesson_1_(25.06.2021)/university/src/utils/menu.js:
--------------------------------------------------------------------------------
1 | import { HiBookOpen, HiAcademicCap } from "react-icons/hi";
2 |
3 | export const menuConfig = [
4 | {
5 | name: "Университет",
6 | icon: ,
7 | },
8 |
9 | {
10 | name: "Факультеты",
11 | icon: ,
12 | },
13 | ];
14 |
--------------------------------------------------------------------------------