forked from italia/design-comuni-plone-theme
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: split VenueDescription component (#399)
- Loading branch information
1 parent
9588073
commit 68c3ca5
Showing
6 changed files
with
128 additions
and
65 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
26 changes: 26 additions & 0 deletions
26
src/components/ItaliaTheme/View/VenueView/VenueElementiDiInteresse.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,26 @@ | ||
import React from 'react'; | ||
import { defineMessages, useIntl } from 'react-intl'; | ||
import { | ||
RichTextSection, | ||
richTextHasContent, | ||
} from 'design-comuni-plone-theme/components/ItaliaTheme/View'; | ||
|
||
const messages = defineMessages({ | ||
elementi_di_interesse: { | ||
id: 'elementi_di_interesse', | ||
defaultMessage: 'Elementi di interesse', | ||
}, | ||
}); | ||
|
||
const VenueElementiDiInteresse = ({ content }) => { | ||
const intl = useIntl(); | ||
return richTextHasContent(content.elementi_di_interesse) ? ( | ||
<RichTextSection | ||
tag_id="elementi-di-interesse" | ||
title={`${intl.formatMessage(messages.elementi_di_interesse)}`} | ||
data={content.elementi_di_interesse} | ||
/> | ||
) : null; | ||
}; | ||
|
||
export default VenueElementiDiInteresse; |
37 changes: 37 additions & 0 deletions
37
src/components/ItaliaTheme/View/VenueView/VenueLuoghiCorrelati.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,37 @@ | ||
import React from 'react'; | ||
import { defineMessages, useIntl } from 'react-intl'; | ||
import { RichTextSection } from 'design-comuni-plone-theme/components/ItaliaTheme/View'; | ||
|
||
import LocationItem from 'design-comuni-plone-theme/components/ItaliaTheme/View/Commons/LocationItem'; | ||
|
||
const messages = defineMessages({ | ||
luoghi_correlati: { | ||
id: 'luoghi_correlati', | ||
defaultMessage: 'Luoghi correlati', | ||
}, | ||
}); | ||
|
||
const VenueLuoghiCorrelati = ({ content }) => { | ||
const intl = useIntl(); | ||
return content?.luoghi_correlati?.length > 0 ? ( | ||
<RichTextSection | ||
tag_id={'luoghi_correlati'} | ||
title={intl.formatMessage(messages.luoghi_correlati)} | ||
> | ||
<div className="card-wrapper card-teaser-wrapper mb-5"> | ||
{content.luoghi_correlati?.map((item, i) => ( | ||
<LocationItem | ||
key={item['@id'] + i} | ||
location={item} | ||
show_icon={false} | ||
show_title_link={true} | ||
load={true} | ||
details_link={false} | ||
/> | ||
))} | ||
</div> | ||
</RichTextSection> | ||
) : null; | ||
}; | ||
|
||
export default VenueLuoghiCorrelati; |
25 changes: 25 additions & 0 deletions
25
src/components/ItaliaTheme/View/VenueView/VenueMultimedia.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,25 @@ | ||
import React from 'react'; | ||
import { defineMessages, useIntl } from 'react-intl'; | ||
import { Gallery } from 'design-comuni-plone-theme/components/ItaliaTheme/View'; | ||
import { contentFolderHasItems } from 'design-comuni-plone-theme/helpers'; | ||
|
||
const messages = defineMessages({ | ||
video: { | ||
id: 'Video', | ||
defaultMessage: 'Video', | ||
}, | ||
}); | ||
|
||
const VenueMultimedia = ({ content }) => { | ||
const intl = useIntl(); | ||
return contentFolderHasItems(content, 'multimedia') ? ( | ||
<Gallery | ||
content={content} | ||
folder_name={'multimedia'} | ||
title_video={intl.formatMessage(messages.video)} | ||
title_type="h5" | ||
/> | ||
) : null; | ||
}; | ||
|
||
export default VenueMultimedia; |
27 changes: 27 additions & 0 deletions
27
src/components/ItaliaTheme/View/VenueView/VenueTipologia.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,27 @@ | ||
import React from 'react'; | ||
import { defineMessages, useIntl } from 'react-intl'; | ||
import { RichTextSection } from 'design-comuni-plone-theme/components/ItaliaTheme/View'; | ||
const messages = defineMessages({ | ||
tipologia_luogo: { | ||
id: 'tipologia_luogo', | ||
defaultMessage: 'Tipo di luogo', | ||
}, | ||
}); | ||
|
||
const VenueTipologia = ({ content }) => { | ||
const intl = useIntl(); | ||
return content?.tipologia_luogo?.length > 0 ? ( | ||
<RichTextSection | ||
tag_id="tipologia" | ||
title={intl.formatMessage(messages.tipologia_luogo)} | ||
> | ||
{content.tipologia_luogo.map((tipologia) => ( | ||
<p key={tipologia.token} className="font-serif"> | ||
{tipologia.title} | ||
</p> | ||
))} | ||
</RichTextSection> | ||
) : null; | ||
}; | ||
|
||
export default VenueTipologia; |
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