-
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.
- Loading branch information
1 parent
db48fde
commit a1f98a9
Showing
11 changed files
with
5,176 additions
and
1,141 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
...olto-featured-block/src/components/Blocks/FeaturedBlock/Variations/BannerFeaturedView.jsx
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,39 @@ | ||
import React from 'react'; | ||
import { Button } from 'semantic-ui-react'; | ||
import { ConditionalLink } from '@plone/volto/components'; | ||
|
||
export const BannerFeaturedView = (props) => { | ||
const { data, isEditMode } = props; | ||
return ( | ||
<div | ||
className="banner-top-main" | ||
style={{ | ||
backgroundImage: `url(${data?.url}/@@images/image)`, | ||
}} | ||
> | ||
<div className="banner-top-main-block-title"> | ||
{data.title && ( | ||
<h2> | ||
<ConditionalLink | ||
to={data?.href?.[0]?.['@id']} | ||
condition={!isEditMode} | ||
> | ||
{data?.title} | ||
</ConditionalLink> | ||
</h2> | ||
)} | ||
{data.description && <h3>{data?.description} </h3>} | ||
{data.hrefText && ( | ||
<Button | ||
as="a" | ||
size="large" | ||
href={'' + data?.link?.[0]?.['@id']} | ||
primary | ||
> | ||
{data.hrefText} | ||
</Button> | ||
)} | ||
</div> | ||
</div> | ||
); | ||
}; |
46 changes: 0 additions & 46 deletions
46
...to-featured-block/src/components/Blocks/FeaturedBlock/Variations/CarouselFeaturedView.jsx
This file was deleted.
Oops, something went wrong.
118 changes: 118 additions & 0 deletions
118
.../volto-featured-block/src/components/Blocks/FeaturedBlock/Variations/FeaturedBaseView.jsx
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,118 @@ | ||
import { ConditionalLink } from '@plone/volto/components'; | ||
import { Button, GridRow, GridColumn, Grid } from 'semantic-ui-react'; | ||
import config from '@plone/volto/registry'; | ||
import { LEFT, RIGHT } from '../constants'; | ||
import { TextBlockView } from '@plone/volto-slate/blocks/Text'; | ||
import { DetachedTextBlockEditor } from '@plone/volto-slate/blocks/Text/DetachedTextBlockEditor'; | ||
import DefaultImageSVG from '@plone/volto/components/manage/Blocks/Listing/default-image.svg'; | ||
|
||
export const FeaturedBaseView = (props) => { | ||
const { data, isEditMode, imagePosition, richText } = props; | ||
let Image = config.getComponent('Image').component; | ||
return ( | ||
<Grid divided="vertically"> | ||
<GridRow> | ||
{imagePosition === LEFT && ( | ||
<GridColumn width="6"> | ||
{data?.url?.length > 0 ? ( | ||
<Image | ||
item={{ | ||
'@id': data.url, | ||
image_field: data.image_field, | ||
image_scales: data.image_scales, | ||
}} | ||
alt={data.title} | ||
sizes="50vw" | ||
responsive={true} | ||
/> | ||
) : isEditMode ? ( | ||
<img | ||
src={ | ||
config.getComponent({ | ||
name: 'DefaultImage', | ||
dependencies: ['listing', 'summary'], | ||
}).component || DefaultImageSVG | ||
} | ||
alt={''} | ||
width="400" | ||
height="300" | ||
/> | ||
) : ( | ||
'' | ||
)} | ||
</GridColumn> | ||
)} | ||
<GridColumn width="6"> | ||
<div className="featured-block-item-content"> | ||
<div className="featured-block-item-content-title"> | ||
{data?.title && ( | ||
<h2> | ||
<ConditionalLink | ||
condition={!isEditMode} | ||
to={data?.href?.[0]?.['@id']} | ||
> | ||
{data?.title} | ||
</ConditionalLink> | ||
</h2> | ||
)} | ||
</div> | ||
<div className="featured-block-item-content-description"> | ||
{data?.description && <h3>{data.description} </h3>} | ||
</div> | ||
{richText && ( | ||
<div className="featured-block-item-content-value"> | ||
{isEditMode ? ( | ||
<DetachedTextBlockEditor {...props} /> | ||
) : ( | ||
<TextBlockView {...props} /> | ||
)} | ||
</div> | ||
)} | ||
<div className="featured-block-item-content-link"> | ||
{data?.hrefText && ( | ||
<Button | ||
as="a" | ||
size="large" | ||
href={!isEditMode ? data?.href?.[0]?.['@id'] : null} | ||
primary | ||
> | ||
{data.hrefText} | ||
</Button> | ||
)} | ||
</div> | ||
</div> | ||
</GridColumn> | ||
{imagePosition === RIGHT && ( | ||
<GridColumn width="6"> | ||
{data?.url?.length > 0 ? ( | ||
<Image | ||
item={{ | ||
'@id': data.url, | ||
image_field: data.image_field, | ||
image_scales: data.image_scales, | ||
}} | ||
alt={data.title} | ||
sizes="50vw" | ||
responsive={true} | ||
/> | ||
) : isEditMode ? ( | ||
<img | ||
src={ | ||
config.getComponent({ | ||
name: 'DefaultImage', | ||
dependencies: ['listing', 'summary'], | ||
}).component || DefaultImageSVG | ||
} | ||
alt={''} | ||
width="400" | ||
height="300" | ||
/> | ||
) : ( | ||
'' | ||
)} | ||
</GridColumn> | ||
)} | ||
</GridRow> | ||
</Grid> | ||
); | ||
}; |
57 changes: 3 additions & 54 deletions
57
...o-featured-block/src/components/Blocks/FeaturedBlock/Variations/FeaturedViewImageLeft.jsx
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,56 +1,5 @@ | ||
import ConditionalLink from '@plone/volto/components/manage/ConditionalLink/ConditionalLink'; | ||
|
||
import { Button, GridRow, GridColumn, Grid } from 'semantic-ui-react'; | ||
import config from '@plone/volto/registry'; | ||
import { FeaturedBaseView } from './FeaturedBaseView'; | ||
import { LEFT } from '../constants'; | ||
export const FeaturedViewImageLeft = (props) => { | ||
const { data } = props; | ||
let Image = config.getComponent('Image').component; | ||
return ( | ||
<Grid divided="vertically"> | ||
<GridRow> | ||
<GridColumn width="6"> | ||
{data?.url?.length > 0 && ( | ||
<Image | ||
item={{ | ||
'@id': data.url, | ||
image_field: data.image_field, | ||
image_scales: data.image_scales, | ||
}} | ||
alt="" | ||
sizes="50vw" | ||
responsive={true} | ||
/> | ||
)} | ||
</GridColumn> | ||
<GridColumn width="6"> | ||
<div className="featured-block-item-content"> | ||
<div className="featured-block-item-content-title"> | ||
{data?.title && ( | ||
<h2> | ||
<ConditionalLink to={data?.href?.[0]?.['@id']}> | ||
{data?.title} | ||
</ConditionalLink> | ||
</h2> | ||
)} | ||
</div> | ||
<div className="featured-block-item-content-description"> | ||
{data?.description && <h3>{data.description} </h3>} | ||
</div> | ||
<div className="featured-block-item-content-link"> | ||
{data?.hrefText && ( | ||
<Button | ||
as="a" | ||
size="large" | ||
href={'' + data?.href?.[0]?.['@id']} | ||
primary | ||
> | ||
{data.hrefText} | ||
</Button> | ||
)} | ||
</div> | ||
</div> | ||
</GridColumn> | ||
</GridRow> | ||
</Grid> | ||
); | ||
return <FeaturedBaseView {...props} imagePosition={LEFT} />; | ||
}; |
68 changes: 3 additions & 65 deletions
68
...ed-block/src/components/Blocks/FeaturedBlock/Variations/FeaturedViewImageLeftRichText.jsx
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,67 +1,5 @@ | ||
import { TextBlockView } from '@plone/volto-slate/blocks/Text'; | ||
import { DetachedTextBlockEditor } from '@plone/volto-slate/blocks/Text/DetachedTextBlockEditor'; | ||
import ConditionalLink from '@plone/volto/components/manage/ConditionalLink/ConditionalLink'; | ||
import config from '@plone/volto/registry'; | ||
import { Button, Grid, GridColumn, GridRow } from 'semantic-ui-react'; | ||
import { FeaturedBaseView } from './FeaturedBaseView'; | ||
import { LEFT } from '../constants'; | ||
export const FeaturedViewImageLeftRichText = (props) => { | ||
const { data, isEditMode } = props; | ||
let Image = config.getComponent('Image').component; | ||
return ( | ||
<Grid divided="vertically"> | ||
<GridRow> | ||
<GridColumn width="6"> | ||
{data?.url?.length > 0 && ( | ||
<Image | ||
item={{ | ||
'@id': data.url, | ||
image_field: data.image_field, | ||
image_scales: data.image_scales, | ||
}} | ||
alt="" | ||
sizes="50vw" | ||
responsive={true} | ||
/> | ||
)} | ||
</GridColumn> | ||
<GridColumn width="6"> | ||
<div className="featured-block-item-content"> | ||
{data?.title && ( | ||
<div className="featured-block-item-content-title"> | ||
<h2> | ||
<ConditionalLink to={data?.href?.[0]?.['@id']}> | ||
{data?.title} | ||
</ConditionalLink> | ||
</h2> | ||
</div> | ||
)} | ||
{data?.description && ( | ||
<div className="featured-block-item-content-description"> | ||
{data?.description && <h3>{data.description} </h3>} | ||
</div> | ||
)} | ||
<div className="featured-block-item-content-value"> | ||
{isEditMode ? ( | ||
<DetachedTextBlockEditor {...props} /> | ||
) : ( | ||
<TextBlockView {...props} /> | ||
)} | ||
</div> | ||
|
||
{data?.hrefText && ( | ||
<div className="featured-block-item-content-link"> | ||
<Button | ||
as="a" | ||
size="large" | ||
href={'' + data?.href?.[0]?.['@id']} | ||
primary | ||
> | ||
{data.hrefText} | ||
</Button> | ||
</div> | ||
)} | ||
</div> | ||
</GridColumn> | ||
</GridRow> | ||
</Grid> | ||
); | ||
return <FeaturedBaseView {...props} imagePosition={LEFT} richText={true} /> | ||
}; |
56 changes: 3 additions & 53 deletions
56
...-featured-block/src/components/Blocks/FeaturedBlock/Variations/FeaturedViewImageRight.jsx
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,55 +1,5 @@ | ||
import ConditionalLink from '@plone/volto/components/manage/ConditionalLink/ConditionalLink'; | ||
import config from '@plone/volto/registry'; | ||
import { Button, Grid, GridColumn, GridRow } from 'semantic-ui-react'; | ||
import { FeaturedBaseView } from './FeaturedBaseView'; | ||
import { RIGHT } from '../constants'; | ||
export const FeaturedViewImageRight = (props) => { | ||
const { data } = props; | ||
let Image = config.getComponent('Image').component; | ||
return ( | ||
<Grid divided="vertically"> | ||
<GridRow> | ||
<GridColumn width="6"> | ||
<div className="featured-block-item-content"> | ||
<div className="featured-block-item-content-title"> | ||
{data?.title && ( | ||
<h2> | ||
<ConditionalLink to={data?.href?.[0]?.['@id']}> | ||
{data?.title} | ||
</ConditionalLink> | ||
</h2> | ||
)} | ||
</div> | ||
<div className="featured-block-item-content-description"> | ||
{data?.description && <h3>{data.description} </h3>} | ||
</div> | ||
<div className="featured-block-item-content-link"> | ||
{data?.hrefText && ( | ||
<Button | ||
as="a" | ||
size="large" | ||
href={'' + data?.href?.[0]?.['@id']} | ||
primary | ||
> | ||
{data.hrefText} | ||
</Button> | ||
)} | ||
</div> | ||
</div> | ||
</GridColumn> | ||
<GridColumn width="6"> | ||
{data?.url?.length > 0 && ( | ||
<Image | ||
item={{ | ||
'@id': data.url, | ||
image_field: data.image_field, | ||
image_scales: data.image_scales, | ||
}} | ||
alt="" | ||
sizes="50vw" | ||
responsive={true} | ||
/> | ||
)} | ||
</GridColumn> | ||
</GridRow> | ||
</Grid> | ||
); | ||
return <FeaturedBaseView {...props} imagePosition={RIGHT} /> | ||
}; |
Oops, something went wrong.