diff --git a/app/assets/stylesheets/administrate/utilities/_variables.scss b/app/assets/stylesheets/administrate/utilities/_variables.scss index c46326612..db8d1a302 100644 --- a/app/assets/stylesheets/administrate/utilities/_variables.scss +++ b/app/assets/stylesheets/administrate/utilities/_variables.scss @@ -43,7 +43,7 @@ $woot-logo-padding: $space-large $space-two; // Colors $color-woot: #1f93ff; $color-gray: #6e6f73; -$color-light-gray: #999a9b; +$color-light-gray: #747677; $color-border: #e0e6ed; $color-border-light: #f0f4f5; $color-background: #f4f6fb; diff --git a/app/javascript/sdk/IFrameHelper.js b/app/javascript/sdk/IFrameHelper.js index ec00e0280..5fcf215c0 100644 --- a/app/javascript/sdk/IFrameHelper.js +++ b/app/javascript/sdk/IFrameHelper.js @@ -142,6 +142,7 @@ export const IFrameHelper = { }, onBubbleToggle: isOpen => { + IFrameHelper.sendMessage('toggle-open', { isOpen }); if (!isOpen) { IFrameHelper.events.resetUnreadMode(); } else { @@ -194,6 +195,10 @@ export const IFrameHelper = { const holderEl = document.querySelector('.woot-widget-holder'); removeClass(holderEl, 'has-unread-view'); }, + + closeChat: () => { + onBubbleClick({ toggleValue: false }); + }, }, pushEvent: eventName => { IFrameHelper.sendMessage('push-event', { eventName }); diff --git a/app/javascript/sdk/bubbleHelpers.js b/app/javascript/sdk/bubbleHelpers.js index fe7b7c078..101f76b5c 100644 --- a/app/javascript/sdk/bubbleHelpers.js +++ b/app/javascript/sdk/bubbleHelpers.js @@ -9,8 +9,8 @@ export const body = document.getElementsByTagName('body')[0]; export const widgetHolder = document.createElement('div'); export const bubbleHolder = document.createElement('div'); -export const chatBubble = document.createElement('div'); -export const closeBubble = document.createElement('div'); +export const chatBubble = document.createElement('button'); +export const closeBubble = document.createElement('button'); export const notificationBubble = document.createElement('span'); export const getBubbleView = type => @@ -64,6 +64,10 @@ export const onBubbleClick = (props = {}) => { toggleClass(closeBubble, 'woot--hide'); toggleClass(widgetHolder, 'woot--hide'); IFrameHelper.events.onBubbleToggle(newIsOpen); + + if (!newIsOpen) { + chatBubble.focus(); + } } }; diff --git a/app/javascript/sdk/sdk.js b/app/javascript/sdk/sdk.js index b5713288a..324b5a835 100644 --- a/app/javascript/sdk/sdk.js +++ b/app/javascript/sdk/sdk.js @@ -25,7 +25,9 @@ export const SDK_CSS = `.woot-widget-holder { .woot-widget-bubble { background: #1f93ff; border-radius: 100px !important; + border-width: 0px; bottom: 20px; + padding: 0px; box-shadow: 0 8px 24px rgba(0, 0, 0, .16) !important; cursor: pointer; height: 64px !important; @@ -40,6 +42,7 @@ export const SDK_CSS = `.woot-widget-holder { display: flex; height: 48px !important; width: auto !important; + align-items: center; } .woot-widget-bubble.woot-widget--expanded div { diff --git a/app/javascript/widget/App.vue b/app/javascript/widget/App.vue index 659082c18..e4c3ba1a2 100755 --- a/app/javascript/widget/App.vue +++ b/app/javascript/widget/App.vue @@ -12,7 +12,7 @@ diff --git a/app/javascript/widget/store/modules/events.js b/app/javascript/widget/store/modules/events.js index 3fa38147d..16ffba869 100644 --- a/app/javascript/widget/store/modules/events.js +++ b/app/javascript/widget/store/modules/events.js @@ -1,5 +1,9 @@ import events from 'widget/api/events'; +const state = { + isOpen: false, +} + const actions = { create: async (_, { name }) => { try { @@ -10,10 +14,16 @@ const actions = { }, }; +const mutations = { + toggleOpen($state) { + $state.isOpen = !$state.isOpen; + } +}; + export default { namespaced: true, - state: {}, + state, getters: {}, actions, - mutations: {}, + mutations, }; diff --git a/app/javascript/widget/views/Home.vue b/app/javascript/widget/views/Home.vue index 1e46f6a21..adb8f137d 100755 --- a/app/javascript/widget/views/Home.vue +++ b/app/javascript/widget/views/Home.vue @@ -5,7 +5,7 @@ > -
+
@@ -227,7 +231,7 @@ export default { } .input-wrap { - padding: 0 $space-normal; + padding: 0 $space-two; } }