Skip to content

Commit

Permalink
Search hints/autocomplete UI (#2971)
Browse files Browse the repository at this point in the history
* Implement UI for autocomplete feature
* Debounce autocompleteStart()
* Fix AMO_CDN env var in dev
  • Loading branch information
willdurand authored Aug 28, 2017
1 parent 9eb45fc commit 9fb119b
Show file tree
Hide file tree
Showing 16 changed files with 980 additions and 295 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"amo:dev": {
"command": "better-npm-run start-dev-proxy",
"env": {
"AMO_CDN": "https://addons-amo-dev-cdn.allizom.org",
"AMO_CDN": "https://addons-dev-cdn.allizom.org",
"PROXY_API_HOST": "https://addons-dev.allizom.org",
"FXA_CONFIG": "local",
"CSP": false,
Expand Down Expand Up @@ -181,6 +181,7 @@
"raven-js": "3.17.0",
"react": "15.6.1",
"react-addons-css-transition-group": "15.6.0",
"react-autosuggest": "9.3.2",
"react-cookie": "1.0.5",
"react-dom": "15.6.1",
"react-helmet": "5.1.3",
Expand Down
111 changes: 0 additions & 111 deletions src/amo/components/SearchForm.js

This file was deleted.

15 changes: 0 additions & 15 deletions src/amo/components/SearchForm.scss

This file was deleted.

27 changes: 27 additions & 0 deletions src/amo/components/SearchForm/Suggestion.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/* @flow */
import React from 'react';

import Icon from 'ui/components/Icon';
import LoadingText from 'ui/components/LoadingText';


type Props = {|
name: string,
iconUrl: string,
loading: boolean,
arrowAlt?: string,
|};

const Suggestion = ({ name, iconUrl, arrowAlt, loading }: Props) => {
return (
<p className="Suggestion">
<img alt={name} className="Suggestion-icon" src={iconUrl} />
<span className="Suggestion-name">
{loading ? <LoadingText minWidth={20} range={12} /> : name}
</span>
<Icon name="arrow-big-blue" alt={arrowAlt} />
</p>
);
};

export default Suggestion;
Loading

0 comments on commit 9fb119b

Please sign in to comment.