-
Notifications
You must be signed in to change notification settings - Fork 3
add menu person #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 = () => { | ||
| return ( | ||
| <div className="Btn_notification"> | ||
| <button className="notification" onClick = {click}><div className="badge"/></button> | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| </div> | ||
| ); | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| .notification { | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. имена классов не соответствуют имени компонента |
||
| 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; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export * from "./Btn_notification"; |
| 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> | ||
| ); | ||
| }; |
| 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; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export * from "./Btn_sms"; |
| 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 = () => { | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nadya12082012 какая логика у этого копонента? нужен ли он вообще и зачем
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| return ( | ||
| <div className="Btn_down"> | ||
| <button className="BtnDown"><img src={btn_down} className="Down_icon" alt="image"/></button> | ||
|
|
||
| </div> | ||
| ) | ||
|
|
||
|
|
||
| }; | ||
| 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; | ||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export * from "./Btn_down"; |
| 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'); | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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> | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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> | ||
| ) | ||
|
|
||
|
|
||
| }; | ||
| 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 { | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 { | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. дублирование также не имеет смыла. стили из это селектора можно переложить в аналогичных выше (дополнив) |
||
| margin-top: 22px; | ||
| margin-bottom: 28px; | ||
| position: relative; | ||
| background: none; | ||
| border: none; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| /* import "./Dropmenu.scss"; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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> | ||
| ) | ||
|
|
||
|
|
||
| }; */ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| /* .person { | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. аналогично |
||
| width: 32px; | ||
| height: 29px; | ||
| border-radius: 50%; | ||
| border: none; | ||
| } | ||
|
|
||
| */ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| /* export * from "./Dropmenu"; | ||
| */ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export * from "./Dropdown_person.js"; |


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
подобное именование компонентов вызывает вопросы даже у vs vode
