ywana-core8 0.0.553 → 0.0.554

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.553",
3
+ "version": "0.0.554",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
package/src/site/view.js CHANGED
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react'
1
+ import React, { useState, useEffect } from 'react'
2
2
  import { Icon, MenuIcon, Tabs, Tab, Stack } from '../html'
3
3
  import './view.css'
4
4
 
@@ -36,11 +36,15 @@ export const View = (props) => {
36
36
 
37
37
  export const TabbedView = (props) => {
38
38
 
39
- const { title, className } = props
39
+ const { title, className, selected } = props
40
40
  const [tab, setTab] = useState(0)
41
41
  const children = React.Children.toArray(props.children);
42
42
  const tabs = children.map(child => <Tab key={child.props.label} label={child.props.label}></Tab>)
43
43
 
44
+ useEffect(() => {
45
+ if (selected && selected !== tab) setTab(selected)
46
+ }, [selected])
47
+
44
48
  const toolbar = (
45
49
  <Tabs selected={tab} onChange={tab => setTab(tab)}>
46
50
  {tabs}