daily pastebin goal
65%
SHARE
TWEET

Untitled

a guest Feb 19th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React, { Component } from 'react';
  2.  
  3. class Note extends Component {
  4. constructor(props) {
  5.     super(props)
  6. }
  7.  
  8. render() {
  9.     console.log(this.props.note);
  10.     const divStyle = {
  11.         flex:1,
  12.         alignSelf:'flex-start',
  13.         margin: ' 0 10px',
  14.         minWidth: '400px',
  15.         display: 'flex',
  16.         flexDirection: 'column',
  17.         alignItems: 'center',
  18.         justifyContent:'center',
  19.     }
  20.  
  21.     const hStyle = {
  22.         alignSelf: 'center',
  23.     }
  24.  
  25.     const pStyle = {
  26.         textIndent: '20px',
  27.     }
  28.  
  29.     if(!this.note) {
  30.         return (<div style={divStyle}>  Note Doesnt exist </div>);
  31.     }
  32.     return(
  33.         <div style={divStyle}>
  34.             <h2 style={hStyle}>{ this.props.note.title }</h2>
  35.             <p style={pStyle}>{ this.props.note.text }</p>
  36.         </div>
  37.     );
  38. }
  39. }
  40. export default Note ;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top