Guest User

Untitled

a guest
Feb 24th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. import React, { PureComponent } from "react";
  2. import { render } from "react-dom";
  3. import { css } from "glamor";
  4.  
  5. const flex = {
  6. display: "flex"
  7. };
  8.  
  9. const column = {
  10. flexDirection: "column"
  11. };
  12.  
  13. const justify = where => ({
  14. justifyContent: where
  15. });
  16.  
  17. const padding = px => ({
  18. padding: px
  19. });
  20.  
  21. const mt = px => ({
  22. marginTop: px
  23. });
  24.  
  25. const mb = px => ({
  26. marginBottom: px
  27. });
  28.  
  29. const container = css({
  30. ...flex,
  31. ...column,
  32. ...padding("50px"),
  33. ...justify("center"),
  34. ...mt("10px"),
  35. ...mb("25px")
  36. });
  37.  
  38. class MyComponent extends PureComponent {
  39. render() {
  40. return (
  41. <div {...css(container)}>
  42. <div>I'm a super flexible div</div>
  43. <div>using glamor.</div>
  44. </div>
  45. );
  46. }
  47. }
  48.  
  49. render(<MyComponent />, document.getElementById("root"));
Add Comment
Please, Sign In to add comment