Guest User

Untitled

a guest
Dec 14th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. import * as React from "react";
  2. import { PropertyControls, ControlType } from "framer";
  3.  
  4. // Define type of property
  5. interface Props {
  6. width: number;
  7. listHeaderTitle: string;
  8. }
  9. export class RadioGroup extends React.Component<Props> {
  10. // Set default properties
  11. static defaultProps = {
  12. width: 375,
  13. height: 52
  14. };
  15.  
  16. // Items shown in property panel
  17. static propertyControls: PropertyControls = {
  18. children: {
  19. type: ControlType.Array,
  20. propertyControl: { type: ControlType.ComponentInstance }
  21. }
  22. };
  23.  
  24. render() {
  25. return (
  26. <div
  27. style={{
  28. display: "flex",
  29. width: "100%",
  30. height: "100%",
  31. alignItems: "center",
  32. justifyContent: "space-between"
  33. }}
  34. >
  35. {React.Children.map(this.props.children, child => {
  36. return React.cloneElement(child as any, {
  37. style: { position: "relative" }
  38. });
  39. })}
  40. </div>
  41. );
  42. }
  43. }
  44.  
  45. // Styles
  46. const wrapperStyle: React.CSSProperties = {
  47. width: "100%",
  48. height: "100%",
  49. display: "flex",
  50. background: "rgba(255, 0,0,0.3)"
  51. };
Add Comment
Please, Sign In to add comment