File tree Expand file tree Collapse file tree 1 file changed +72
-0
lines changed
Expand file tree Collapse file tree 1 file changed +72
-0
lines changed Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+ import PropTypes from 'prop-types'
3+
4+ export const colorItems = [
5+ "#F38181" ,
6+ "#FCE38A" ,
7+ "#EAFFD0" ,
8+ "#F9FFEA" ,
9+ "#8785A2" ,
10+ "#DBE2EF" ,
11+ "#D4A5A5" ,
12+ "#6EF3D6"
13+ ] ;
14+
15+
16+ function Palette ( { setColor, style, className, disabled } ) {
17+ return (
18+ < span className = "dropdown" >
19+
20+ < button
21+ disabled = { disabled }
22+ className = { `btn ${ className } ` }
23+ style = { style }
24+ type = "button"
25+ id = "dropdownMenuButton"
26+ data-toggle = "dropdown"
27+ aria-haspopup = "true"
28+ aria-expanded = "false"
29+ >
30+ < i className = "bi bi-palette" > </ i >
31+ </ button >
32+
33+ < div className = "dropdown-menu tab-content mt-1" aria-labelledby = "dropdownMenuButton" >
34+ < form >
35+ < div className = "d-flex flex-row flex-wrap justify-content-center" >
36+ { colorItems . map ( ( color , key ) => (
37+ < button
38+ style = { {
39+ borderRadius : "100%" ,
40+ width : "32px" , //поменять на rem
41+ height : "32px" ,
42+ backgroundColor : color ,
43+ } }
44+ type = "button"
45+ key = { key }
46+ className = { `m-1 btn` }
47+ onClick = { ( ) => setColor ( color ) }
48+ >
49+ { ` ` }
50+ </ button >
51+ ) ) }
52+ </ div >
53+ </ form >
54+ </ div >
55+
56+ </ span >
57+ ) ;
58+ }
59+
60+ Palette . propTypes = {
61+ setColor : PropTypes . func ,
62+ style : PropTypes . object ,
63+ className : PropTypes . string ,
64+ }
65+
66+ export default Palette ;
67+
68+
69+
70+
71+
72+
You can’t perform that action at this time.
0 commit comments