Skip to content

Commit

Permalink
ADD: palette menu
Browse files Browse the repository at this point in the history
  • Loading branch information
FinelyCao committed Nov 22, 2019
1 parent cf3baf9 commit 3c1d7df
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mb-sketch-ruler",
"version": "1.2.0-dev.10",
"version": "1.2.0-dev.11",
"description": "A sketch like ruler in javascript",
"author": "iny7",
"license": "MIT",
Expand Down
26 changes: 14 additions & 12 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,23 @@ import RulerContextMenu from './RulerContextMenu'

import { StyledRuler } from './styles'

const DEFAULTMENU = {
bgColor: '#fff',
dividerColor: '#DBDBDB',
listItem: {
textColor: '#415058',
hoverTextColor: '#298DF8',
disabledTextColor: 'rgba(65, 80, 88, 0.4)',
bgColor: '#fff',
hoverBgColor: '#F2F2F2'
}
}

export default class SketchRuler extends PureComponent {
constructor (props) {
super(props)
const { ratio, palette } = props
const { menu } = palette || {}
const menu = palette.menu || DEFAULTMENU
this.canvasConfigs = {
ratio,
bgColor: palette.bgColor,
Expand Down Expand Up @@ -184,16 +196,6 @@ SketchRuler.defaultProps = {
lineColor: '#EB5648',
borderColor: '#DADADC',
cornerActiveColor: 'rgb(235, 86, 72, 0.6)',
menu: {
bgColor: '#fff',
dividerColor: '#DBDBDB',
listItem: {
textColor: '#415058',
hoverTextColor: '#298DF8',
disabledTextColor: 'rgba(65, 80, 88, 0.4)',
bgColor: '#fff',
hoverBgColor: '#F2F2F2'
}
}
menu: DEFAULTMENU
}
}

0 comments on commit 3c1d7df

Please sign in to comment.