Skip to content

Commit

Permalink
chore: tweak cell style (#388)
Browse files Browse the repository at this point in the history
  • Loading branch information
stoffeastrom committed Mar 30, 2020
1 parent 692f262 commit d3381b5
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 459 deletions.
117 changes: 0 additions & 117 deletions apis/nucleus/__tests__/unit/header.spec.jsx

This file was deleted.

134 changes: 0 additions & 134 deletions apis/nucleus/__tests__/unit/selectiontoolbar.spec.jsx

This file was deleted.

17 changes: 13 additions & 4 deletions apis/nucleus/src/components/Footer.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
import React from 'react';

import { Typography, Grid } from '@material-ui/core';
import { makeStyles, Typography, Grid } from '@material-ui/core';

const Footer = ({ layout }) =>
layout && layout.showTitles && layout.footnote ? (
const useStyles = makeStyles(theme => ({
itemStyle: {
minWidth: 0,
paddingTop: theme.spacing(1),
},
}));

const Footer = ({ layout }) => {
const { itemStyle } = useStyles();
return layout && layout.showTitles && layout.footnote ? (
<Grid container>
<Grid item style={{ minWidth: 0 }}>
<Grid item className={itemStyle}>
<Typography noWrap variant="body2">
{layout.footnote}
</Typography>
</Grid>
</Grid>
) : null;
};

export default Footer;
20 changes: 15 additions & 5 deletions apis/nucleus/src/components/Header.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
import React, { useEffect, useState } from 'react';

import { Grid, Typography } from '@material-ui/core';

import { makeStyles, Grid, Typography } from '@material-ui/core';
import SelectionToolbarWithDefault from './SelectionToolbar';

const useStyles = makeStyles(theme => ({
containerStyle: {
flexGrow: 0,
paddingBottom: theme.spacing(1),
},
itemsStyle: {
whiteSpace: 'nowrap',
minHeight: '32px',
},
}));

const Header = ({ layout, sn }) => {
const showTitle = layout && layout.showTitles && !!layout.title;
const showSubtitle = layout && layout.showTitles && !!layout.subtitle;
const showInSelectionActions = sn && layout && layout.qSelectionInfo && layout.qSelectionInfo.qInSelections;

const [items, setItems] = useState([]);
const { containerStyle, itemsStyle } = useStyles();

useEffect(() => {
if (!sn || !sn.component || !sn.component.isHooked) {
Expand All @@ -19,7 +29,7 @@ const Header = ({ layout, sn }) => {
}, [sn]);

return (
<Grid item container wrap="nowrap" style={{ flexGrow: 0 }}>
<Grid item container wrap="nowrap" className={containerStyle}>
<Grid item zeroMinWidth xs>
<Grid container wrap="nowrap" direction="column">
{showTitle && (
Expand All @@ -34,7 +44,7 @@ const Header = ({ layout, sn }) => {
)}
</Grid>
</Grid>
<Grid item style={{ whiteSpace: 'nowrap', minHeight: '32px' }}>
<Grid item className={itemsStyle}>
{showInSelectionActions && (
<SelectionToolbarWithDefault
inline
Expand Down
Binary file modified test/mashup/__artifacts__/baseline/snaps-bar.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d3381b5

Please sign in to comment.