import React, { PropTypes } from 'react';

import RateButton from 'common/button/RateButton';

import styles from './OverallRating.module.css';

import {
  overallRatingDialogMap,
} from '../../common/optionMap';

const handleRatingDialog = rating => (
  overallRatingDialogMap[rating] || '點擊作評分'
);

const OverallRating = ({ overallRating, onChange }) => (
  <div
    style={{
      display: 'flex',
      alignItems: 'center',
    }}
  >
    <RateButton
      max={5}
      rating={overallRating}
      onChange={onChange}
    />
    <div
      className={styles.dialog}
    >
      <p
        className="pS"
      >
        {handleRatingDialog(overallRating)}
      </p>
    </div>
  </div>
);

OverallRating.propTypes = {
  overallRating: PropTypes.number,
  onChange: PropTypes.func,
};

export default OverallRating;


@@ -84,24 +84,74 @@
 teButton';%0A%0A
+import InputTitle from '../../common/InputTitle';%0A
 import style
@@ -184,24 +184,25 @@
 dule.css';%0A%0A
+%0A
 import %7B%0A  o
@@ -412,22 +412,180 @@
 %3Cdiv
+%3E
 %0A    
-style=%7B%7B%0A
+%3Cdiv%0A      style=%7B%7B%0A        marginBottom: '20px',%0A      %7D%7D%0A    %3E%0A      %3CInputTitle%0A        text=%22%E6%95%B4%E9%AB%94%E9%9D%A2%E8%A9%A6%E6%BB%BF%E6%84%8F%E7%A8%8B%E5%BA%A6%22%0A        must%0A      /%3E%0A    %3C/div%3E%0A    %3Cdiv%0A      style=%7B%7B%0A  
     
@@ -599,24 +599,26 @@
 ay: 'flex',%0A
+  
       alignI
@@ -641,15 +641,21 @@
     
+  
 %7D%7D%0A  
+ 
+ 
 %3E%0A
+  
     
@@ -676,16 +676,18 @@
     
+  
 max=%7B5%7D%0A
     
@@ -682,16 +682,18 @@
 max=%7B5%7D%0A
+  
       ra
@@ -713,16 +713,18 @@
 Rating%7D%0A
+  
       on
@@ -741,27 +741,31 @@
 Change%7D%0A    
+  
 /%3E%0A
+  
     %3Cdiv%0A   
@@ -757,24 +757,26 @@
 %0A      %3Cdiv%0A
+  
       classN
@@ -795,26 +795,30 @@
 dialog%7D%0A    
-%3E%0A
+  %3E%0A  
       %3Cp%0A   
@@ -814,16 +814,18 @@
      %3Cp%0A
+  
         
@@ -841,26 +841,30 @@
 =%22pS%22%0A      
+ 
+ 
 %3E%0A
+  
         %7Bhan
@@ -905,13 +905,28 @@
     
+  
 %3C/p%3E%0A
+      %3C/div%3E%0A
     

add input title(must) in overallRating (#150)