Skip to content

Commit

Permalink
Add TermView with variations and rich text definition
Browse files Browse the repository at this point in the history
  • Loading branch information
ksuess committed Jan 16, 2022
1 parent f008b08 commit a417a55
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
27 changes: 27 additions & 0 deletions src/components/TermView.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from 'react';
import { Container } from 'semantic-ui-react';

const TermView = ({ content }) => {
return (
<Container className="view-wrapper">
<article id="content">
<header>
<h1 className="documentFirstHeading">{content.title}</h1>
</header>
<section id="content-core">
{content.variations &&
content.variations.map((el) => <div key={el}>{el}</div>)}
{content.definition && (
<p
dangerouslySetInnerHTML={{
__html: content.definition.data || content.description,
}}
/>
)}
</section>
</article>
</Container>
);
};

export default TermView;
1 change: 0 additions & 1 deletion src/components/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Tooltips from './Tooltips';
import GlossaryView from './GlossaryView';

import './glossarytooltips.less';

Expand Down
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { serializeNodes } from './utils';
import GlossaryView from './components/GlossaryView';
import TermView from './components/TermView';
import { searchContent } from '@plone/volto/actions';

const searchoptions = [
Expand Down Expand Up @@ -43,6 +44,7 @@ export default (config) => {
contentTypesViews: {
...config.views.contentTypesViews,
Glossary: GlossaryView,
Term: TermView,
},
};

Expand Down

0 comments on commit a417a55

Please sign in to comment.