@blocklet/list 0.8.16 → 0.8.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -61,6 +61,9 @@ const Search = _ref => {
61
61
  handleKeyword();
62
62
  };
63
63
 
64
+ (0, _react.useEffect)(() => {
65
+ setSearchStr(filters.keyword || '');
66
+ }, [filters.keyword]);
64
67
  return /*#__PURE__*/_react.default.createElement(StyledSearch, Object.assign({
65
68
  inputProps: {
66
69
  'data-cy': 'search-blocklet'
@@ -242,9 +242,10 @@ function FilterProvider(_ref) {
242
242
  if (!hasDeveloperFilter) {
243
243
  fetchCategories();
244
244
  }
245
- }, [!hasDeveloperFilter]);
245
+ }, [hasDeveloperFilter]);
246
246
  (0, _react.useEffect)(() => {
247
247
  fetchBlocklets();
248
+ fetchCategories();
248
249
  }, [endpoint]);
249
250
  return /*#__PURE__*/_react.default.createElement(Provider, {
250
251
  value: filterStore
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/list",
3
- "version": "0.8.16",
3
+ "version": "0.8.19",
4
4
  "description": "Common ux components of blocklet",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -37,7 +37,7 @@
37
37
  "react": ">=18.1.0"
38
38
  },
39
39
  "dependencies": {
40
- "@arcblock/ux": "^2.1.3",
40
+ "@arcblock/ux": "^2.1.4",
41
41
  "@emotion/react": "^11.9.0",
42
42
  "@emotion/styled": "^11.8.1",
43
43
  "@mui/icons-material": "^5.6.2",
@@ -58,5 +58,5 @@
58
58
  "babel-plugin-inline-react-svg": "^2.0.1",
59
59
  "babel-plugin-styled-components": "^1.10.7"
60
60
  },
61
- "gitHead": "5f5a20003947fadab688b32a18ba38826d8c3369"
61
+ "gitHead": "229d2be0ef4c4aa2bafcd41d8444c60ca1e45772"
62
62
  }
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react';
1
+ import React, { useEffect, useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import SearchIcon from '@mui/icons-material/Search';
4
4
  import CloseIcon from '@mui/icons-material/Close';
@@ -22,6 +22,10 @@ const Search = ({ placeholder, ...rest }) => {
22
22
  setSearchStr('');
23
23
  handleKeyword();
24
24
  };
25
+ useEffect(() => {
26
+ setSearchStr(filters.keyword || '');
27
+ }, [filters.keyword]);
28
+
25
29
  return (
26
30
  <StyledSearch
27
31
  inputProps={{
@@ -169,10 +169,11 @@ function FilterProvider({
169
169
  if (!hasDeveloperFilter) {
170
170
  fetchCategories();
171
171
  }
172
- }, [!hasDeveloperFilter]);
172
+ }, [hasDeveloperFilter]);
173
173
 
174
174
  useEffect(() => {
175
175
  fetchBlocklets();
176
+ fetchCategories();
176
177
  }, [endpoint]);
177
178
 
178
179
  return <Provider value={filterStore}>{children}</Provider>;