ywana-core8 0.0.704 → 0.0.706

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ywana-core8",
3
- "version": "0.0.704",
3
+ "version": "0.0.706",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -1,5 +1,5 @@
1
- import React, { useContext, useEffect, useState } from 'react'
2
- import { Icon, Tooltip } from '../html'
1
+ import React, { Fragment, useContext, useEffect, useState } from 'react'
2
+ import { Icon } from '../html'
3
3
  import { CollectionContext } from './CollectionContext'
4
4
  import { DynamicForm } from './DynamicForm'
5
5
  import './CollectionFilters.css'
@@ -15,7 +15,7 @@ export const CollectionFilters = (props) => {
15
15
  const [open, setOpen] = useState(false)
16
16
 
17
17
  useEffect(() => {
18
- const likes = Object.keys(schema).filter(id => schema[id].filter === true)
18
+ const likes = Object.keys(schema).filter(id => schema[id].like === true)
19
19
  context.setLikes(likes)
20
20
  }, [schema])
21
21
 
@@ -28,6 +28,15 @@ export const CollectionFilters = (props) => {
28
28
  }
29
29
 
30
30
  const toggleIcon = open ? "expand_less" : "expand_more"
31
+
32
+ const schema2 = Object.keys(schema).reduce((acc, id) => {
33
+ const item = schema[id]
34
+ if (item.filter === true) {
35
+ acc[id] = item
36
+ }
37
+ return acc
38
+ }, {})
39
+
31
40
  return (
32
41
  <div className="collection-filters">
33
42
  <header>
@@ -38,7 +47,7 @@ export const CollectionFilters = (props) => {
38
47
  <Icon icon={toggleIcon} clickable action={toggle} />
39
48
  </header>
40
49
  {open ? <div className='dynamic-filters'>
41
- <DynamicForm schema={schema} values={filters} onChange={change} />
50
+ <DynamicForm schema={schema2} values={filters} onChange={change} />
42
51
  </div> : null}
43
52
  </div>
44
53
  )
@@ -54,7 +63,7 @@ const CollectionFiltersResume = (props) => {
54
63
  if (!fields.length) return null
55
64
 
56
65
  return (
57
- <>
66
+ <Fragment>
58
67
  {fields
59
68
  .filter(id => filters[id] !== undefined && filters[id] !== null && filters[id] !== "")
60
69
  .map(id => {
@@ -67,6 +76,6 @@ const CollectionFiltersResume = (props) => {
67
76
  </div>
68
77
  )
69
78
  })}
70
- </>
79
+ </Fragment>
71
80
  )
72
81
  }