MCPcopy Index your code
hub / github.com/flyfloor/react-component / calcPositionStyle

Function calcPositionStyle

component/SlideMenu.js:23–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21 },
22
23 calcPositionStyle(){
24 const {position, width} = this.props
25 const {display} = this.state;
26 let cord = display ? 0 : width;
27
28 switch(position){
29 case 'left':
30 return {transform: `translate3d(${-cord}px, 0, 0)`,
31 width: `${width}px`,
32 left: 0,
33 top: 0}
34 case 'top':
35 return {transform: `translate3d(0, ${-cord}px, 0)`,
36 height: `${width}px`,
37 left: 0,
38 top: 0}
39 case 'bottom':
40 return {transform: `translate3d(0, ${cord}px, 0)`,
41 height: `${width}px`,
42 left: 0,
43 bottom: 0}
44 default:
45 return {transform: `translate3d(${cord}px, 0, 0)`,
46 width: `${width}px`,
47 right:0,
48 top:0}
49 }
50 },
51
52 open(){
53 this.setState({

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…