Add animation to container
This commit is contained in:
parent
42d2d20fd0
commit
6ac76f6619
1 changed files with 8 additions and 1 deletions
|
@ -23,11 +23,18 @@ export class Container extends React.Component<IContainerProps> {
|
||||||
|
|
||||||
public render(): React.ReactNode {
|
public render(): React.ReactNode {
|
||||||
const containersElements = this.props.children.map(child => child.render());
|
const containersElements = this.props.children.map(child => child.render());
|
||||||
const style = Object.assign({}, this.props.properties);
|
const defaultStyle = {
|
||||||
|
transitionProperty: 'all',
|
||||||
|
transitionTimingFunction: 'cubic-bezier(0.4, 0, 0.2, 1)',
|
||||||
|
transitionDuration: '150ms'
|
||||||
|
} as React.CSSProperties;
|
||||||
|
const style = Object.assign(defaultStyle, this.props.properties);
|
||||||
style.x = 0;
|
style.x = 0;
|
||||||
style.y = 0;
|
style.y = 0;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<g
|
<g
|
||||||
|
style={defaultStyle}
|
||||||
transform={`translate(${this.props.properties.x}, ${this.props.properties.y})`}
|
transform={`translate(${this.props.properties.x}, ${this.props.properties.y})`}
|
||||||
key={`container-${this.props.properties.id}`}
|
key={`container-${this.props.properties.id}`}
|
||||||
>
|
>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue