File tree Expand file tree Collapse file tree 4 files changed +1
-129
lines changed
Expand file tree Collapse file tree 4 files changed +1
-129
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- import React from 'react'
2- import ReactDOM from 'react-dom'
3- import IntentExample from './components/IntentExample'
4- import translations from './fixtures/en.json'
51import get from 'lodash/get'
62
7- /** Fake cozy.client.intents.create to demonstrate features in Styleguide */
8- export const fakeIntentCreate = ( action , doctype , options ) => {
9- let res
10- const p = new Promise ( resolve => {
11- res = resolve
12- } )
13- p . start = ( node , onFrameLoaded ) => {
14- const iframe = document . createElement ( 'iframe' )
15- iframe . onload = ( ) => {
16- onFrameLoaded ( )
17-
18- const onComplete = ( ) => {
19- node . removeChild ( iframe )
20- res ( { result : 'OK' } )
21- }
22-
23- // Copy all styles to the iframe
24- Array . from ( document . querySelectorAll ( 'style' ) ) . forEach ( node => {
25- const copy = node . cloneNode ( true )
26- iframe . contentDocument . head . appendChild ( copy )
27- } )
28-
29- ReactDOM . render (
30- React . createElement ( IntentExample , {
31- onComplete,
32- action,
33- doctype,
34- options
35- } ) ,
36- iframe . contentDocument . body
37- )
38- }
39- node . appendChild ( iframe )
40- return p
41- }
42- return p
43- }
3+ import translations from './fixtures/en.json'
444
455export const t = path => {
466 return get ( translations , path )
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments