-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a1611cc
commit 806428c
Showing
36 changed files
with
168 additions
and
332 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,37 @@ | ||
import PropTypes from 'prop-types'; | ||
import { PageContext, AbstractComponent } from '@ima/core'; | ||
import React from 'react'; | ||
import uiComponentHelper from './uiComponentHelper'; | ||
import _window from './windowMock'; | ||
import throttle from './throttle'; | ||
|
||
export default class Parent extends React.Component { | ||
getChildContext() { | ||
return { | ||
$Utils: { | ||
$UIComponentHelper: uiComponentHelper, | ||
$Helper: { | ||
throttle | ||
}, | ||
$Window: _window | ||
const context = { | ||
$Utils: { | ||
$UIComponentHelper: uiComponentHelper, | ||
$Helper: { | ||
throttle | ||
}, | ||
$Window: _window, | ||
$Settings: { | ||
plugin: { | ||
uiAtoms: { | ||
useIntersectionObserver: { | ||
images: true | ||
}, | ||
disableNoScript: { | ||
images: false | ||
} | ||
} | ||
} | ||
}; | ||
} | ||
} | ||
}; | ||
|
||
export default class Parent extends AbstractComponent { | ||
render() { | ||
return <span>{this.props.children}</span>; | ||
return ( | ||
<PageContext.Provider value={context}> | ||
<span>{this.props.children}</span> | ||
</PageContext.Provider> | ||
); | ||
} | ||
} | ||
|
||
Parent.childContextTypes = { | ||
$Utils: PropTypes.object | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import { Window, Dispatcher } from '@ima/core'; | ||
import { Visibility } from '../../dist/main.js'; | ||
|
||
import Window from 'ima/window/ClientWindow'; | ||
import Dispatcher from 'ima/event/DispatcherImpl'; | ||
|
||
let visibility = new Visibility(new Window(), new Dispatcher()); | ||
|
||
export default visibility; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.