ywana-core8 0.0.875 → 0.0.877

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.875",
3
+ "version": "0.0.877",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
package/src/site/site.js CHANGED
@@ -109,7 +109,7 @@ export const Site = ({ icon, iconSrc, logo, title, toolbar, footer, children, in
109
109
  <div className="site6">
110
110
  <SiteHeader icon={icon} iconSrc={iconSrc} title={title} />
111
111
  <SiteToolBar >{toolbar}</SiteToolBar>
112
- <SiteMenu logo={logo} title={title} min={min} >{children}</SiteMenu>
112
+ <SiteMenu iconSrc={iconSrc} title={title} min={min} >{children}</SiteMenu>
113
113
  <SitePage init={init}>
114
114
  {children}
115
115
  <Page id="EMPTY">EMPTY</Page>
@@ -179,7 +179,7 @@ const SiteAside = () => {
179
179
  /**
180
180
  * SiteMenu
181
181
  */
182
- const SiteMenu = ({ logo, title, children, min }) => {
182
+ const SiteMenu = ({ iconSrc, title, children, min }) => {
183
183
 
184
184
  const context = useContext(SiteContext)
185
185
  const { page, sideNav, setSideNav, showNav } = context
@@ -212,7 +212,7 @@ const SiteMenu = ({ logo, title, children, min }) => {
212
212
  const menutTitle = sideNav === 'max' ? title : ''
213
213
  return (
214
214
  <menu className={`${style} ${showNav ? 'show' : ''}`}>
215
- <Header title={menutTitle} />
215
+ <Header title={menutTitle} iconSrc={iconSrc} />
216
216
  <main >
217
217
  {Object.keys(sections).map(title => (
218
218
  <Fragment key={title}>
@@ -26,7 +26,7 @@ const UploadProgressTest = (prop) => {
26
26
  const UploaderTest = (prop) => {
27
27
  return (
28
28
  <div style={{ padding: "1rem" }}>
29
- <Uploader icon="cloud_upload" target="https://maso.developxp.com/kiosk/api/upload" />
29
+ <Uploader view="icon" icon="cloud_upload" target="https://maso.developxp.com/kiosk/api/upload" />
30
30
  </div>
31
31
  )
32
32
  }
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useMemo } from 'react'
2
2
  import ResumableJS from 'resumablejs'
3
- import { UploadArea } from "./UploadArea";
3
+ import { UploadArea, UploadIcon } from "./UploadArea";
4
4
  import { UploadProgress } from './UploadProgress';
5
5
  import { UPLOAD_STATES } from './UploadStates';
6
6
  import './Uploader.css'
@@ -9,7 +9,7 @@ import './Uploader.css'
9
9
  /**
10
10
  * Uploader
11
11
  */
12
- export const Uploader = ({ icon, label, target, accept, simultaneousUploads = 1, className, onProgress, onSuccess, onError, onComplete }) => {
12
+ export const Uploader = ({ icon, label, view="area", target, accept, simultaneousUploads = 1, className, onProgress, onSuccess, onError, onComplete }) => {
13
13
 
14
14
  const resumable = useMemo(() => {
15
15
  const config = {
@@ -63,9 +63,19 @@ export const Uploader = ({ icon, label, target, accept, simultaneousUploads = 1,
63
63
  if (onComplete) onComplete(files)
64
64
  }
65
65
 
66
+ function renderView() {
67
+ switch (view) {
68
+ case "area": return <UploadArea resumable={resumable} icon={icon} label={label} />
69
+ case "icon": return <UploadIcon resumable={resumable} icon={icon} />
70
+ default: return <UploadArea resumable={resumable} icon={icon} label={label} />
71
+ }
72
+ }
73
+
66
74
  return (
67
75
  <div className={`uploader ${className}`}>
68
- {state === UPLOAD_STATES.IDLE ? <UploadArea resumable={resumable} icon={icon} label={label} /> : <UploadProgress files={files} /> }
76
+ {state === UPLOAD_STATES.IDLE ? renderView() : <UploadProgress files={files} /> }
69
77
  </div>
70
78
  )
71
79
  }
80
+
81
+