Skip to content

Commit

Permalink
fix: revert some css module changes and fix missing units (#715)
Browse files Browse the repository at this point in the history
Fixes: https://jira.dhis2.org/browse/TECH-342
This bug is only in dev, not in 2.34

css modules styles were getting overridden by MUI styles. Also, in css, the units (e.g., "px") must be included.
  • Loading branch information
jenniferarnesen authored Apr 8, 2020
1 parent d73a618 commit 123c31d
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 123 deletions.
1 change: 0 additions & 1 deletion src/components/ControlBar/DashboardItemChip.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export const DashboardItemChip = ({
}) => {
const chipProps = {
selected,
className: classes.chip,
};

if (starred) {
Expand Down
21 changes: 18 additions & 3 deletions src/components/ControlBar/Filter.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import i18n from '@dhis2/d2-i18n';
import { withStyles } from '@material-ui/core/styles';
import InputField from '@material-ui/core/Input';
import InputAdornment from '@material-ui/core/InputAdornment';
import SearchIcon from '@material-ui/icons/Search';
import { colors } from '@dhis2/ui-core';

import ClearButton from './ClearButton';
import { DEFAULT_STATE_DASHBOARDS_FILTER_NAME } from '../../reducers/dashboardsFilter';

import classes from './styles/Filter.module.css';
const styles = {
filterField: {
fontSize: '14px',
width: '200px',
height: '30px',
top: '-4px',
},
searchIcon: {
color: colors.grey700,
width: '20px',
height: '20px',
},
};

export const KEYCODE_ENTER = 13;
export const KEYCODE_ESCAPE = 27;
Expand Down Expand Up @@ -48,7 +62,7 @@ export class Filter extends Component {
};

render() {
const { name, onChangeName } = this.props;
const { classes, name, onChangeName } = this.props;

const startAdornment = (
<InputAdornment position="start">
Expand Down Expand Up @@ -78,6 +92,7 @@ export class Filter extends Component {
}

Filter.propTypes = {
classes: PropTypes.object,
name: PropTypes.string,
onChangeName: PropTypes.func,
onKeypressEnter: PropTypes.func,
Expand All @@ -88,4 +103,4 @@ Filter.defaultProps = {
onChangeName: Function.prototype,
};

export default Filter;
export default withStyles(styles)(Filter);
Loading

0 comments on commit 123c31d

Please sign in to comment.