Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit 709a4ab

Browse files
committed
improve UX in searchPanel
1 parent a40c8a2 commit 709a4ab

File tree

5 files changed

+21
-7
lines changed

5 files changed

+21
-7
lines changed

containers/UniversePanel/Pigeon.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ export class SearchService {
6060
}
6161

6262
emptyInput() {
63-
return this.searchTerm.debounceTime(600).filter(isEmptyValue)
63+
return this.searchTerm.filter(isEmptyValue)
6464
}
6565
}

containers/UniversePanel/logic.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,24 @@ const debug = makeDebugger('L:UniversePanel')
88
let store = null
99
let Pigeon = null
1010

11-
const repoData = R.map(
12-
R.pick(['id', 'name', 'description', 'language', 'owner', 'stargazers_count'])
11+
const RLog = x => debug('R log: ', x)
12+
13+
const washItems = R.compose(
14+
R.map(
15+
R.pick([
16+
'id',
17+
'name',
18+
'description',
19+
'language',
20+
'owner',
21+
'stargazers_count',
22+
])
23+
),
24+
R.prop('items')
1325
)
1426

15-
// const RLog = x => debug('R log: ', x)
27+
// TODO: network error or something
28+
const repoData = R.ifElse(R.has('items'), washItems, R.tap(RLog))
1629

1730
const reposIsEmpty = R.compose(R.isEmpty, R.prop('reposData'))
1831
const inputValueIsNotEmpty = R.compose(R.not, R.isEmpty, R.prop('inputValue'))
@@ -46,7 +59,8 @@ export function init(selectedStore) {
4659
store.markState({
4760
searching: false,
4861
})
49-
store.replaceRepos(repoData(res.items))
62+
store.replaceRepos(repoData(res))
63+
// store.replaceRepos([])
5064
})
5165

5266
Pigeon.emptyInput().subscribe(() => {

containers/UniversePanel/styles/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import styled, { keyframes } from 'styled-components'
33
import Img from '../../../components/Img'
44

55
import searchIcon from '../../../static/search.svg'
6-
import loadingIcon from '../../../static/loading.svg'
6+
import loadingIcon from '../../../static/searchLoading.svg'
77

88
const rotate360 = keyframes`
99
from {

static/loading.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

static/searchLoading.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)