-
-
Notifications
You must be signed in to change notification settings - Fork 638
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Proper proxy for Remix app, proper @plone/registry config. Basic teaser.
- Loading branch information
Showing
8 changed files
with
69 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ node_modules | |
/build | ||
/public/build | ||
.env | ||
.registry.loader.js |
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,12 +1,8 @@ | ||
import config from '@plone/registry'; | ||
import installBlocks from '@plone/blocks'; | ||
import installSlots from '@plone/slots'; | ||
import applyAddonConfiguration from 'load-plone-registry-addons'; | ||
|
||
config.set('slots', {}); | ||
config.set('utilities', {}); | ||
installBlocks(config); | ||
installSlots(config); | ||
applyAddonConfiguration(config); | ||
|
||
config.settings.apiPath = 'http://localhost:8080/Plone'; | ||
config.settings.apiPath = 'http://localhost:3000'; | ||
|
||
export default 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,4 @@ | ||
const addons = ['@plone/blocks', '@plone/slots']; | ||
const theme = ''; | ||
|
||
export { addons, theme }; |
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,31 @@ | ||
import { BlockViewProps } from '@plone/types'; | ||
import { Link } from '@plone/components'; | ||
|
||
const TeaserBlockView = (props: BlockViewProps) => { | ||
const { data } = props; | ||
const href = Array.isArray(data.href) ? data.href[0]['@id'] : data.href; | ||
const image = data.preview_image?.[0]; | ||
// TODO: Improve the images download path including the ++api++ to avoid having to setup a redirect | ||
// for @@images and @@download | ||
const url = | ||
data.preview_image?.[0]?.['@id'] || | ||
`/++api++${data.href[0]?.image_scales[data.href[0].image_field][0].base_path}/${data.href[0]?.image_scales[data.href[0].image_field][0].download}`; | ||
|
||
return ( | ||
<div> | ||
<Link href={href}> | ||
<div className="teaser-item"> | ||
<div className="teaser-image-wrapper"> | ||
<img src={url} alt="" /> | ||
</div> | ||
<div className="teaser-content"> | ||
<h2>{data.title}</h2> | ||
<p>{data?.description}</p> | ||
</div> | ||
</div> | ||
</Link> | ||
</div> | ||
); | ||
}; | ||
|
||
export default TeaserBlockView; |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.