ywana-core8 0.0.289 → 0.0.290

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.289",
3
+ "version": "0.0.290",
4
4
  "description": "ywana-core8",
5
5
  "author": "Ernesto Roldan Garcia",
6
6
  "license": "MIT",
@@ -318,7 +318,6 @@ export const TableEditor = (props) => {
318
318
  if (grouper.options) {
319
319
  const options = CHECK['isFunction'](grouper.options) ? grouper.options() : grouper.options
320
320
  const option = options.find(option => option.value === groupName)
321
- console.log(groupName, options, option)
322
321
  return option ? option.label : groupName
323
322
  } else {
324
323
  return groupName
package/src/site/site.css CHANGED
@@ -48,6 +48,10 @@
48
48
  width: 20rem;
49
49
  }
50
50
 
51
+ .site6>menu>main {
52
+ padding: .1rem;
53
+ }
54
+
51
55
  .site6>menu>main>.site-menu-item {
52
56
  width: 100%;
53
57
  display: flex;
@@ -59,6 +63,12 @@
59
63
  cursor: pointer;
60
64
  }
61
65
 
66
+ .site6>menu>main>.site-menu-item.selected {
67
+ color: rgb(255, 255, 255);
68
+ background-color: rgb(60, 60, 60);
69
+ border-radius: .5rem;
70
+ }
71
+
62
72
  .site6>menu>main {
63
73
  flex: 1;
64
74
  overflow-x: hidden;
package/src/site/site.js CHANGED
@@ -166,7 +166,7 @@ const SiteAside = () => {
166
166
  const SiteMenu = ({ logo, title, children, min }) => {
167
167
 
168
168
  const context = useContext(SiteContext)
169
- const { sideNav, setSideNav, showNav } = context
169
+ const { page, sideNav, setSideNav, showNav } = context
170
170
 
171
171
  useEffect(() => {
172
172
  if (min) context.setSideNav('min')
@@ -191,7 +191,6 @@ const SiteMenu = ({ logo, title, children, min }) => {
191
191
  return sections
192
192
  }, {}) : {}
193
193
 
194
-
195
194
  const style = sideNav === 'max' ? 'max' : 'min'
196
195
  const toggleIcon = sideNav === 'max' ? 'chevron_left' : 'chevron_right'
197
196
  return (
@@ -200,9 +199,10 @@ const SiteMenu = ({ logo, title, children, min }) => {
200
199
  {Object.keys(sections).map(title => (
201
200
  <Fragment key={title}>
202
201
  {sections[title].map(({ id, icon = 'info', title }) => {
202
+ const styleItem = id === page ? 'selected' : ''
203
203
  return (
204
- <div className="site-menu-item" key={id} onClick={() => goto(id)}>
205
- <Icon key={id} icon={icon} clickable checked={id === context.page} action={() => goto(id)} />
204
+ <div className={`site-menu-item ${styleItem}`} key={id} onClick={() => goto(id)}>
205
+ <Icon key={id} icon={icon} clickable action={() => goto(id)} />
206
206
  { sideNav === 'max' ? <label>{title}</label> : null }
207
207
  </div>
208
208
  )
@@ -1,19 +1,18 @@
1
- import React, { useContext, useEffect, useState } from 'react'
1
+ import React, { Fragment, useContext, useEffect, useState } from 'react'
2
+ import { SiteContext } from './siteContext'
2
3
  import { Site } from './site'
3
4
  import { Page } from './page'
4
5
  import './site.css'
5
6
  import './page.css'
6
- import { Fragment } from 'react/cjs/react.production.min'
7
- import { SiteContext } from './siteContext'
8
7
 
9
8
  const SiteTest = (prop) => {
10
9
  return (
11
- <Site icon="star" title="Site Test" init={"PAGE1"}>
10
+ <Site icon="star" title="Site Test" init={"PAGE2"}>
12
11
  <Page id="PAGE1" section="SECTION1" icon="description" title="Page 1" layout="workspace">
13
12
  <Page1 />
14
13
  </Page>
15
14
  <Page id="PAGE2" section="SECTION1" icon="description" title="Page 2" layout="workspace">
16
- 222
15
+ <Page2 />
17
16
  </Page>
18
17
  </Site>
19
18
  )
@@ -23,15 +22,24 @@ const Page1 = (props) => {
23
22
 
24
23
  const site = useContext(SiteContext)
25
24
  useEffect(() => {
26
-
27
25
  site.notify({ title: "Notification 1", body: "Lorem ipsum dolor sit amet"})
28
26
  }, [])
29
27
 
30
28
  return (
31
29
  <Fragment>
32
30
  <header>Page 1</header>
33
- <main>1</main>
31
+ <main></main>
34
32
  <footer>f1</footer>
35
33
  </Fragment>
36
34
  )
35
+ }
36
+
37
+ const Page2 = (props) => {
38
+ return (
39
+ <Fragment>
40
+ <header>Page 2</header>
41
+ <main></main>
42
+ <footer>f2</footer>
43
+ </Fragment>
44
+ )
37
45
  }