diff --git a/__tests__/src/components/GalleryView.test.js b/__tests__/src/components/GalleryView.test.js index 942bb8f81becdaa447c9e80406b245b6c082fc4b..c5ff7624684b0b0bcca9709e3dbc9502cd4aaf82 100644 --- a/__tests__/src/components/GalleryView.test.js +++ b/__tests__/src/components/GalleryView.test.js @@ -9,7 +9,7 @@ function createWrapper(props) { return shallow( <GalleryView canvases={manifesto.create(manifestJson).getSequences()[0].getCanvases()} - classes={{ currentCanvas: 'currentCanvas' }} + classes={{ galleryViewItemCurrent: 'galleryViewItemCurrent' }} window={{ canvasIndex: 0, id: '1234', @@ -34,7 +34,7 @@ describe('GalleryView', () => { expect(wrapper.find('div[role="button"]').length).toBe(3); }); it('sets a mirador-current-canvas class on current canvas', () => { - expect(wrapper.find('div[role="button"]').at(0).props().className).toEqual('currentCanvas'); + expect(wrapper.find('div[role="button"]').at(0).props().className).toEqual('galleryViewItemCurrent'); }); it('renders the canvas labels for each canvas in canvas items', () => { expect(wrapper.find('WithStyles(Typography)').length).toBe(3); diff --git a/src/components/GalleryView.js b/src/components/GalleryView.js index 5288795cdd435481e44fefd5ff0d4a30228f9057..f3be7776033e5278fa3655d18215cf74ae6001e9 100644 --- a/src/components/GalleryView.js +++ b/src/components/GalleryView.js @@ -47,7 +47,7 @@ export class GalleryView extends Component { aspectRatio={manifestoCanvas.aspectRatio} style={{ margin: '0 auto' }} /> - <Typography variant="caption"> + <Typography variant="caption" className={classes.galleryViewCaption}> {manifestoCanvas.getLabel()} </Typography> </div> diff --git a/src/containers/GalleryView.js b/src/containers/GalleryView.js index 8e0aacd1176c3a9f85e558a3143ed9fc6ea70a89..eef04ee8ef2f322dbefd61678ed4f5d7c18965b3 100644 --- a/src/containers/GalleryView.js +++ b/src/containers/GalleryView.js @@ -30,6 +30,16 @@ const styles = theme => ({ padding: '50px 0 50px 20px', width: '100%', }, + galleryViewCaption: { + boxOrient: 'vertical', + display: '-webkit-box', + height: '3em', + lineClamp: '2', + lineHeight: '1.5em', + overflow: 'hidden', + textOverflow: 'ellipsis', + wordBreak: 'break-word', + }, galleryViewItem: { '&:focus': { outline: 'none',