Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/assets/bell.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/assets/image 51.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/assets/image 53.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/assets/image 54.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/assets/image 55.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/sms.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions src/components/Btn_notification/Btn_notification.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import "./Btn_notification.scss";


const click = () => console.log ("Кнопка нажата");

export const Btn_notification = () => {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

подобное именование компонентов вызывает вопросы даже у vs vode
Screenshot 2022-11-26 at 13 00 35

return (
<div className="Btn_notification">
<button className="notification" onClick = {click}><div className="badge"/></button>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не вижу чтобы в badge можно было прокинуть цифру.
компонент не принимает props

скриншот из задачи
Screenshot 2022-11-26 at 13 02 10

</div>
);
};
21 changes: 21 additions & 0 deletions src/components/Btn_notification/Btn_notification.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.notification {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

имена классов не соответствуют имени компонента
аналогичные имена классов могут появиться и в других компонентах при таком подходе.
что вызовет переопределение css

position: absolute;
background: url(../../assets/bell.svg) no-repeat;
width:24px;
Height: 24px;
margin-left: 23px;
margin-top: 28px;
border:none;
cursor:pointer;
}

.badge {
position:relative;
background: #FE6470;
width: 6px;
height: 6px;
border-radius: 50px;
margin-left: 9px;
margin-bottom: 15px;
}

1 change: 1 addition & 0 deletions src/components/Btn_notification/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./Btn_notification";
12 changes: 12 additions & 0 deletions src/components/Btn_sms/Btn_sms.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import "./Btn_sms.scss";


const clickSms = () => console.log ("Кнопка смс нажата");

export const Btn_sms = () => {
return (
<div className="Btn_sms">
<button className="sms" onClick = {clickSms}/>
</div>
);
};
10 changes: 10 additions & 0 deletions src/components/Btn_sms/Btn_sms.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.sms {
position: absolute;
background: url(../../assets/sms.svg) no-repeat;
width:24px;
height: 24px;
margin-left: 67px;
margin-top: 29px;
border:none;
cursor:pointer;
}
1 change: 1 addition & 0 deletions src/components/Btn_sms/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./Btn_sms";
16 changes: 16 additions & 0 deletions src/components/Dropdown_person/Btn_down/Btn_down.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import "./Btn_down.scss";
import btn_down from "../../../assets/down.svg";



export const Btn_down = () => {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nadya12082012 какая логика у этого копонента? нужен ли он вообще и зачем

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2022-11-26 at 13 06 37

судя по макету это должна быть стрелочка вниз, но я не вижу её когда в проекте.


return (
<div className="Btn_down">
<button className="BtnDown"><img src={btn_down} className="Down_icon" alt="image"/></button>

</div>
)


};
9 changes: 9 additions & 0 deletions src/components/Dropdown_person/Btn_down/Btn_down.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.BtnDown{
width: 40px;
height: 40px;
background: none;
border:none;
margin-top: 15px;
cursor:pointer;

}
1 change: 1 addition & 0 deletions src/components/Dropdown_person/Btn_down/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./Btn_down";
51 changes: 51 additions & 0 deletions src/components/Dropdown_person/Dropdown_person.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import "./Dropdown_person.scss";
import React, { useState } from 'react';
import person from "../../assets/image 51.svg";
/* import {Dropmenu} from "./Dropmenu"; */
import {Btn_sms} from "../Btn_sms";
import {Btn_notification} from "../Btn_notification";
import {Btn_down} from "./Btn_down";
import personOne from "../../assets/image 54.svg";
import personTwo from "../../assets/image 54.svg";
import persona from "../../assets/image 55.svg";




export const Dropdown_person = () => {

const [open, setOpen] = React.useState(false);

const handleOpen = () => {
setOpen(!open);
};
const iconOupen = function () {
console.log('../../assets/image 54.svg');

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это не метод который выводит адрес картинки по которой нажила. это метод который имитирует метод.
реальный метод должен выглядеть так

const handleIconClick = (person) => {
  console.log(person.icon);
} 

при этом метод должен быть 1 для всех элементов списка

};
const iconOupenTwo = function () {
console.log('../../assets/image 54.svg');
};
const iconOupenThree = function () {
console.log('../../assets/image 55.svg');
};

return (
<div className="Dropdown_person">
<Btn_notification />
<Btn_sms />
<button id="menu" className={open ? 'Dropdown-Button active' : 'Dropdown-Button'} onClick={handleOpen}><img src={person} className="person" alt="image"/>
{open ? (
<div className="New">
<div onClick={iconOupen} className="submenu-dropdown"><img src={personOne} className="person" alt="image"/></div>
<div onClick={iconOupenTwo} className="submenu-dropdown" ><img src={personTwo} className="person" alt="image"/></div>
<div onClick={iconOupenThree} className="submenu-dropdown" ><img src={persona} className="person" alt="image"/></div>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

три дива сверху 39,40,41 строки
это обсолено идентичные элементы, где использование компонентного подхода?
если элементы повторяются по разметке и логике, то должны быть реализованы как отдельная единица

{persons.map((person) =>  
            (<li onClick={() => 
                   handleIconClick(person)} className="DropdownPerson-Submenu" >
                           <img src={person.icon} className="DropdownPerson-Image" alt={person.name} />
              </li>))}

</div>
) : null}
</button>

<Btn_down />
</div>
)


};
28 changes: 28 additions & 0 deletions src/components/Dropdown_person/Dropdown_person.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.Dropdown_person {
display: flex;
max-width: 300px;
margin-left: 980px
}
#menu {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

и вот когда правила не соблюдаются и появляется несколько классов .menu начинают появляться баги.
А вместо решения этих багов начинаю нарушаться новые правила.

Мы не используем ID для вёрстки id атрибут для этого не предназначен

margin-left: 200px;
margin-bottom: 28px;
background: none;
border: none;
cursor:pointer;

}

.person {
width: 32px;
height: 29px;
border-radius: 50%;
border: none;
}
#menu {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

дублирование также не имеет смыла. стили из это селектора можно переложить в аналогичных выше (дополнив)

margin-top: 22px;
margin-bottom: 28px;
position: relative;
background: none;
border: none;
}

26 changes: 26 additions & 0 deletions src/components/Dropdown_person/Dropmenu/Dropmenu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* import "./Dropmenu.scss";

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

если код закомментированный, то ему нет места в проекте.
Удаляем 😄

import personOne from "../../../assets/image 53.svg";
import personTwo from "../../../assets/image 54.svg";
import persona from "../../../assets/image 55.svg";





export const Dropmenu = () => {
let clickIcon = console.assertl ('../../../assets/image 53.svg');
let clickIconTwo = console.log ('../../../assets/image 54.svg')
let clickIconThree = console.log ('../../../assets/image 55.svg')

return (
<div className="Dropmenu">
<div className="wrapper_drop">
<div onClick={clickIcon} className="submenu-dropdown"><img src={personOne} className="person" alt="image"/></div>
<div onClick={clickIconTwo} className="submenu-dropdown" ><img src={personTwo} className="person" alt="image"/></div>
<div onClick={clickIconThree} className="submenu-dropdown" ><img src={persona} className="person" alt="image"/></div>
</div>
</div>
)


}; */
8 changes: 8 additions & 0 deletions src/components/Dropdown_person/Dropmenu/Dropmenu.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* .person {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

аналогично

width: 32px;
height: 29px;
border-radius: 50%;
border: none;
}

*/
2 changes: 2 additions & 0 deletions src/components/Dropdown_person/Dropmenu/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* export * from "./Dropmenu";
*/
1 change: 1 addition & 0 deletions src/components/Dropdown_person/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./Dropdown_person.js";
2 changes: 2 additions & 0 deletions src/pages/Home/Home.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import "./Home.scss";
import { LeftMenu } from "../../components/LeftMenu/LeftMenu";
import {Dropdown_person} from "../../components/Dropdown_person"

export const Home = () => {
return (

<div className="Home">
<LeftMenu />
<Dropdown_person />


</div>
Expand Down