Skip to content
Permalink
Browse files
DRYed the code by Consolidating common CSS styles into new object 'ob…
…jStyleCommon'.
  • Loading branch information
maratbn committed Aug 5, 2018
1 parent 92560c3 commit 860d6c519d6ebc6f6a1f1221cddabb3ce699240b
Showing with 9 additions and 6 deletions.
  1. +9 −6 webpack_in/entry.jsx
@@ -10,12 +10,17 @@ import React from 'react';
import ReactDOM from 'react-dom';


const objStyleCommon = {
padding: '1em',
border: 'solid 2px green',
textAlign: 'center'
};


class HelloWidget extends React.Component {
render() {
return (
<div style={{ padding: '1em',
border: 'solid 2px green',
textAlign: 'center' }}>
<div style={ objStyleCommon }>
Hello! I'm a React app!!
</div>
);
@@ -25,9 +30,7 @@ class HelloWidget extends React.Component {
class TextWidget extends React.Component {
render() {
return (
<div style={{ padding: '1em',
border: 'solid 2px green',
textAlign: 'center' }}>
<div style={ objStyleCommon }>
Some text here....
</div>
);

0 comments on commit 860d6c5

Please sign in to comment.