productDetail.js 628 Bytes
import { SHOWSIZEBOX, SHOWSHARESHEET, SHOWSNAPSHOT } from '../constants/productDetail'

const INITIAL_STATE = {
  showSizeBox: false,
  showSharesheet: false,
  showSnapshot: false
}

export default function productDetail (state = INITIAL_STATE, action) {
  switch (action.type) {
    case SHOWSIZEBOX:
      return {
        ...state,
        showSizeBox: action.isShow
      }
    case SHOWSHARESHEET:
      return {
        ...state,
        showSharesheet: action.isShow
      }
    case SHOWSNAPSHOT:
      return {
        ...state,
        showSnapshot: action.isShow
      }
      
    default:
       return state
  }
}