Created
December 14, 2018 08:57
-
-
Save PavelLaptev/c96a62429382d4c5b3875f0027e07966 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from "react"; | |
import { PropertyControls, ControlType } from "framer"; | |
// Define type of property | |
interface Props { | |
width: number; | |
listHeaderTitle: string; | |
} | |
export class RadioGroup extends React.Component<Props> { | |
// Set default properties | |
static defaultProps = { | |
width: 375, | |
height: 52 | |
}; | |
// Items shown in property panel | |
static propertyControls: PropertyControls = { | |
children: { | |
type: ControlType.Array, | |
propertyControl: { type: ControlType.ComponentInstance } | |
} | |
}; | |
render() { | |
return ( | |
<div | |
style={{ | |
display: "flex", | |
width: "100%", | |
height: "100%", | |
alignItems: "center", | |
justifyContent: "space-between" | |
}} | |
> | |
{React.Children.map(this.props.children, child => { | |
return React.cloneElement(child as any, { | |
style: { position: "relative" } | |
}); | |
})} | |
</div> | |
); | |
} | |
} | |
// Styles | |
const wrapperStyle: React.CSSProperties = { | |
width: "100%", | |
height: "100%", | |
display: "flex", | |
background: "rgba(255, 0,0,0.3)" | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment