diff --git a/jsx/CSSGrid.js b/jsx/CSSGrid/index.js similarity index 94% rename from jsx/CSSGrid.js rename to jsx/CSSGrid/index.js index b678901d60a..b56e1ad841c 100644 --- a/jsx/CSSGrid.js +++ b/jsx/CSSGrid/index.js @@ -1,6 +1,7 @@ import Card from 'Card'; import React, {useState, useEffect, useRef} from 'react'; import PropTypes from 'prop-types'; +import './styles.css'; /** * Create a three column grid of cards using a CSS grid. @@ -51,13 +52,6 @@ function CSSGrid(props) { ); setPanelHeights(heights); }); - const grid = { - display: 'grid', - gridTemplateColumns: '33% 33% 33%', - gridAutoFlow: 'row dense', - gridRowGap: '1em', - rowGap: '1em', - }; let orderedCards = []; for (let i = 0; i < props.Cards.length; i++) { @@ -117,7 +111,7 @@ function CSSGrid(props) { }); return ( -
{cards}
+
{cards}
); } CSSGrid.propTypes = { diff --git a/jsx/CSSGrid/styles.css b/jsx/CSSGrid/styles.css new file mode 100644 index 00000000000..9d43f04267b --- /dev/null +++ b/jsx/CSSGrid/styles.css @@ -0,0 +1,14 @@ +.CSSGrid { + display: grid; + grid-template-columns: 33% 33% 33%; + grid-auto-flow: row dense; + gap: 1rem; +} + +@media (max-width: 576px) { + .CSSGrid { + display: flex; + flex-direction: column; + gap: 3rem; + } +} \ No newline at end of file diff --git a/jsx/Panel.js b/jsx/Panel.js index 0fca9987bba..7d0c0399604 100644 --- a/jsx/Panel.js +++ b/jsx/Panel.js @@ -122,7 +122,7 @@ const Panel = (props) => { */ return (
+ style={{height: props.panelSize, maxHeight: props.maxHeight}}> {panelHeading}
{ const cardStyle = { width: info.width || '6em', - padding: '1em', - marginLeft: '1ex', - marginRight: '1ex', + padding: '1rem 0', + marginLeft: '0.5rem', + marginRight: '0.5rem', + wordBreak: 'break-word', + flexGrow: 1, }; let valueStyle = {}; if (info.valueWhitespace) { diff --git a/modules/instruments/jsx/VisitInstrumentList.js b/modules/instruments/jsx/VisitInstrumentList.js index 90f1ed20e49..c8cefea969d 100644 --- a/modules/instruments/jsx/VisitInstrumentList.js +++ b/modules/instruments/jsx/VisitInstrumentList.js @@ -156,15 +156,16 @@ class VisitInstrumentList extends Component { }; flexcontainer.justifyContent = 'flex-start'; - let center = { + let titleText = { display: 'flex', - width: '12%', - height: '100%', + width: '100%', alignItems: 'center', - justifyContent: 'center', + textAlign: 'left', + wordBreak: 'break-word', + padding: '1rem', }; - const termstyle = {paddingLeft: '2em', paddingRight: '2em'}; + const termstyle = {padding: '1rem 1.5em', flexGrow: 1}; let instruments = null; if (!this.state.instruments) { @@ -281,37 +282,38 @@ class VisitInstrumentList extends Component { onMouseLeave={this.toggleHover} >
-
-
-
-

- -
{this.props.Visit.Meta.Battery}
-

-
-
{this.props.t('Site', {ns: 'loris'})}
-
{this.props.Visit.Meta.Site}
-
- {vdate} - {vage} -
-
{this.props.t('Status', {ns: 'loris'})}
-
{vstatus}
-
- - {instruments} +
+
+
+

+ +
{this.props.Visit.Meta.Battery}
+

+
+
{this.props.t('Site', {ns: 'loris'})}
+
{this.props.Visit.Meta.Site}
+
+ {vdate} + {vage} +
+
{this.props.t('Status', {ns: 'loris'})}
+
{vstatus}
+
+ + {instruments} +
diff --git a/modules/media/jsx/CandidateMediaWidget.js b/modules/media/jsx/CandidateMediaWidget.js index 3d51688c638..a5fb38fb942 100644 --- a/modules/media/jsx/CandidateMediaWidget.js +++ b/modules/media/jsx/CandidateMediaWidget.js @@ -25,7 +25,7 @@ function CandidateMediaWidget(props) { const file = props.Files[i]; const dateStr = dateFormatter.format(new Date(file.LastModified)); files.push( - diff --git a/webpack.config.ts b/webpack.config.ts index c4d5bfcb740..d9fb31089a5 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -351,7 +351,7 @@ configs.push({ MultiSelectDropdown: './jsx/MultiSelectDropdown.js', Breadcrumbs: './jsx/Breadcrumbs.js', PolicyButton: './jsx/PolicyButton.js', - CSSGrid: './jsx/CSSGrid.js', + CSSGrid: './jsx/CSSGrid', Help: './jsx/Help.js', ...getModulesEntries(), },