rcdexta / react-event-timeline

A responsive event timeline in React.js
https://rcdexta.com/react-event-timeline
MIT License
536 stars 56 forks source link

Bubble size #25

Closed Arahir closed 6 years ago

Arahir commented 6 years ago

Hello, I want to reduce the bubble size to look something like that: bubblesize

I used bubbleStyle to update the width and height but it then looks like that: bug-bubble-size

The solution would be to change the 'left' property of the bubble but it's always overwritte here.

mergeNotificationStyle(iconColor, bubbleStyle, orientation) {
    const iconColorStyle = iconColor ? {...s.eventType, ...{color: iconColor, borderColor: iconColor}} : s.eventType
    const leftOrRight = (orientation === 'right') ? {...s['eventType--right']} : {...s['eventType--left']}
    return {...iconColorStyle, ...bubbleStyle, ...leftOrRight}
  }

the solution seems to be to switch ...bubleStyle and ...leftOrRight.

mergeNotificationStyle(iconColor, bubbleStyle, orientation) {
    const iconColorStyle = iconColor ? {...s.eventType, ...{color: iconColor, borderColor: iconColor}} : s.eventType
    const leftOrRight = (orientation === 'right') ? {...s['eventType--right']} : {...s['eventType--left']}
    return {...iconColorStyle, ...leftOrRight, ...bubbleStyle}
  }

what do you think?