generated from eea/volto-frontend-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from eea/develop
Develop
- Loading branch information
Showing
20 changed files
with
581 additions
and
208 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -238,5 +238,21 @@ | |
"branch": "develop", | ||
"develop": false, | ||
"path": "src" | ||
}, | ||
"volto-hero-block": { | ||
"url": "[email protected]:eea/volto-hero-block.git", | ||
"https": "https://github.com/eea/volto-hero-block.git", | ||
"package": "@eeacms/volto-hero-block", | ||
"branch": "develop", | ||
"develop": false, | ||
"path": "src" | ||
}, | ||
"volto-eea-website-theme": { | ||
"url": "[email protected]:eea/volto-eea-website-theme.git", | ||
"https": "https://github.com/eea/volto-eea-website-theme.git", | ||
"package": "@eeacms/volto-eea-website-theme", | ||
"branch": "develop", | ||
"develop": false, | ||
"path": "src" | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react'; | ||
import { BodyClass } from '@plone/volto/helpers'; | ||
import HeroEdit from '@eeacms/volto-hero-block/components/Blocks/Hero/Edit'; | ||
|
||
const Edit = (props) => { | ||
return ( | ||
<React.Fragment> | ||
<BodyClass className="with-hero-block" /> | ||
<HeroEdit {...props} /> | ||
</React.Fragment> | ||
); | ||
}; | ||
|
||
export default Edit; |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from 'react'; | ||
import { Portal } from 'react-portal'; | ||
import { BodyClass } from '@plone/volto/helpers'; | ||
import HeroView from '@eeacms/volto-hero-block/components/Blocks/Hero/View'; | ||
|
||
function IsomorphicPortal({ children }) { | ||
const [isClient, setIsClient] = React.useState(); | ||
React.useEffect(() => setIsClient(true), []); | ||
|
||
return isClient ? ( | ||
<Portal node={document.getElementById('page-header')}>{children}</Portal> | ||
) : ( | ||
children | ||
); | ||
} | ||
|
||
const View = (props) => { | ||
return ( | ||
<React.Fragment> | ||
<BodyClass className="with-hero-block" /> | ||
<IsomorphicPortal> | ||
<div className="ui container hero-block-container"> | ||
<HeroView {...props} /> | ||
</div> | ||
</IsomorphicPortal> | ||
</React.Fragment> | ||
); | ||
}; | ||
|
||
export default View; |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import HeroEdit from './Edit'; | ||
import HeroView from './View'; | ||
|
||
export default (config) => { | ||
if (config.blocks.blocksConfig.hero) { | ||
config.blocks.blocksConfig.hero = { | ||
...config.blocks.blocksConfig.hero, | ||
edit: HeroEdit, | ||
view: HeroView, | ||
}; | ||
} | ||
|
||
return config; | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react'; | ||
import { BodyClass } from '@plone/volto/helpers'; | ||
import TitleEdit from '@eeacms/volto-eea-website-theme/components/manage/Blocks/Title/Edit'; | ||
|
||
const Edit = (props) => { | ||
return ( | ||
<React.Fragment> | ||
<BodyClass className="with-title-block" /> | ||
<TitleEdit {...props} /> | ||
</React.Fragment> | ||
); | ||
}; | ||
|
||
export default Edit; |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react'; | ||
import { BodyClass } from '@plone/volto/helpers'; | ||
import TitleView from '@eeacms/volto-eea-website-theme/components/manage/Blocks/Title/View'; | ||
|
||
const View = (props) => { | ||
return ( | ||
<React.Fragment> | ||
<BodyClass className="with-title-block" /> | ||
<TitleView {...props} /> | ||
</React.Fragment> | ||
); | ||
}; | ||
|
||
export default View; |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import TitleEdit from './Edit'; | ||
import TitleView from './View'; | ||
|
||
export default (config) => { | ||
if (config.blocks.blocksConfig.title) { | ||
config.blocks.blocksConfig.title = { | ||
...config.blocks.blocksConfig.title, | ||
edit: TitleEdit, | ||
view: TitleView, | ||
}; | ||
} | ||
|
||
return config; | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import installHeroBlock from './Hero'; | ||
import installTitleBlock from './Title'; | ||
|
||
export default function applyConfig(config) { | ||
return [installHeroBlock, installTitleBlock].reduce( | ||
(acc, apply) => apply(acc), | ||
config, | ||
); | ||
} |
Binary file not shown.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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.