From 39545b5f79e11358927e97745158cd4b0641a03b Mon Sep 17 00:00:00 2001 From: Matthieu Dumont Date: Mon, 18 Apr 2016 13:17:05 +0200 Subject: [PATCH] feat(color): only use one color now BREAKING CHANGES Cannot use the colors parameter anymore, color is the new one. --- app/css/index.scss | 4 ++-- app/src/AlgoliasearchZendeskHC.js | 5 +---- app/src/autocomplete.js | 10 +++++----- app/src/templates.js | 30 +++++++----------------------- 4 files changed, 15 insertions(+), 34 deletions(-) diff --git a/app/css/index.scss b/app/css/index.scss index 42af3bcc..9a7e52e7 100644 --- a/app/css/index.scss +++ b/app/css/index.scss @@ -57,7 +57,7 @@ border: 1px solid #d9d9d9; border-radius: 3px; background-color: #fff; - box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.2), 0 2px 3px 0 rgba(0, 0, 0, 0.1); + box-shadow: 0 1px 0 0 #ccc, 0 2px 3px 0 #e6e6e6; font-size: 14px; padding: 24px; } @@ -65,7 +65,7 @@ .aa-article-hit--category { height: 24px; font-size: 18px; - border-bottom: 1px solid rgba(0, 0, 0, 0.1); + border-bottom: 1px solid #e6e6e6; height: 18px; margin-bottom: 5px; } diff --git a/app/src/AlgoliasearchZendeskHC.js b/app/src/AlgoliasearchZendeskHC.js index 8cd99d34..d65a3404 100644 --- a/app/src/AlgoliasearchZendeskHC.js +++ b/app/src/AlgoliasearchZendeskHC.js @@ -19,10 +19,7 @@ const optionsStructure = {required: true, type: 'Object', children: { hitsPerPage: {type: 'number', value: 5, validators: [hitsPerPageValidator]} }}, baseUrl: {type: 'string', value: '/hc/'}, - colors: {type: 'Object', value: {}, children: { - primary: {type: 'string', value: '#D4D4D4'}, - secondary: {type: 'string', value: '#D4D4D4'} - }}, + color: {type: 'string', value: '#158EC2'}, indexPrefix: {type: 'string', value: 'zendesk_'}, instantsearch: {type: 'Object', value: {}, children: { enabled: {type: 'boolean', value: true}, diff --git a/app/src/autocomplete.js b/app/src/autocomplete.js index 9e996692..037dea90 100644 --- a/app/src/autocomplete.js +++ b/app/src/autocomplete.js @@ -36,7 +36,7 @@ class Autocomplete { inputSelector }, baseUrl, - colors, + color, poweredBy, translations }) { @@ -46,7 +46,7 @@ class Autocomplete { this.locale = require('./I18n.js').locale; - addCSS(templates.autocomplete.css.render({colors})); + addCSS(templates.autocomplete.css.render({color})); this.autocompletes = []; for (let i = 0; i < this.$inputs.length; ++i) { @@ -84,7 +84,7 @@ class Autocomplete { let aa = autocomplete($input, { hint: false, debug: process.env.NODE_ENV === 'development', - templates: this._templates({colors, poweredBy, translations}) + templates: this._templates({poweredBy, translations}) }, [{ source: this._source(params), name: 'articles', @@ -149,10 +149,10 @@ class Autocomplete { return flattenedHits; } - _templates({colors, poweredBy, translations}) { + _templates({poweredBy, translations}) { let res = {}; if (poweredBy === true) { - res.footer = templates.autocomplete.footer.render({colors, translations}); + res.header = templates.autocomplete.poweredBy.render({translations}); } return res; } diff --git a/app/src/templates.js b/app/src/templates.js index 663340eb..18ab376d 100644 --- a/app/src/templates.js +++ b/app/src/templates.js @@ -2,18 +2,6 @@ import Hogan from 'hogan.js'; export default { autocomplete: { - // Autocompletion template for a section - section: Hogan.compile( - `
-
- - {{{ _highlightResult.category.title.value }}} > {{{ _highlightResult.title.value }}} - - ({{ nb_articles_text }}) -
-
{{{ _highlightResult.body.value }}}
-
`), - // Autocompletion template for an article article: Hogan.compile( `
`), // Powered By - footer: Hogan.compile(`