Skip to content

Commit 8a1fbdb

Browse files
authored
chore: styles (#1259)
1 parent 9e74432 commit 8a1fbdb

File tree

12 files changed

+57
-77
lines changed

12 files changed

+57
-77
lines changed

src/core_modules/capture-core/components/D2Form/D2Section.component.js

+9-17
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ import D2SectionFields from './D2SectionFields.container';
77
import { Section as MetaDataSection } from '../../metaData';
88

99
const getStyles = theme => ({
10-
sectionFieldsInSection: {
11-
margin: theme.spacing.unit,
12-
},
1310
section: {
1411
backgroundColor: 'white',
1512
maxWidth: theme.typography.pxToRem(892),
@@ -20,7 +17,6 @@ type Props = {
2017
sectionMetaData: MetaDataSection,
2118
isHidden?: ?boolean,
2219
classes: {
23-
sectionFieldsInSection: string,
2420
section: string,
2521
},
2622
formHorizontal: ?boolean,
@@ -70,19 +66,15 @@ class D2Section extends React.PureComponent<Props> {
7066
elevation={2}
7167
className={classes.section}
7268
>
73-
<div
74-
className={classes.sectionFieldsInSection}
75-
>
76-
{/* $FlowFixMe[cannot-spread-inexact] automated comment
77-
*/}
78-
<D2SectionFields
79-
ref={(instance) => {
80-
this.sectionFieldsInstance = instance;
81-
}}
82-
fieldsMetaData={sectionMetaData.elements}
83-
{...passOnProps}
84-
/>
85-
</div>
69+
{/* $FlowFixMe[cannot-spread-inexact] automated comment */}
70+
<D2SectionFields
71+
ref={(instance) => {
72+
this.sectionFieldsInstance = instance;
73+
}}
74+
fieldsMetaData={sectionMetaData.elements}
75+
{...passOnProps}
76+
/>
77+
8678
</Section>
8779
</div>
8880
);

src/core_modules/capture-core/components/DataEntry/DataEntry.component.js

-7
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import SectionHeaderSimple from '../Section/SectionHeaderSimple.component';
1212

1313
const styles = theme => ({
1414
loadingContainer: {
15-
marginLeft: 12,
1615
marginTop: 12,
1716
},
1817
d2FormContainer: {
@@ -37,7 +36,6 @@ const styles = theme => ({
3736
paddingTop: theme.typography.pxToRem(10),
3837
},
3938
verticalFormInnerContainer: {
40-
// overflow: 'auto',
4139
maxWidth: theme.typography.pxToRem(892),
4240
},
4341
verticalDataEntryContainer: {
@@ -64,10 +62,6 @@ const styles = theme => ({
6462
paddingTop: theme.typography.pxToRem(10),
6563
paddingBottom: theme.typography.pxToRem(10),
6664
},
67-
dataEntryFieldSection: {
68-
padding: theme.typography.pxToRem(8),
69-
maxWidth: theme.typography.pxToRem(892),
70-
},
7165
});
7266

7367
type FieldContainer = {
@@ -185,7 +179,6 @@ class DataEntry extends React.Component<Props> {
185179
className={this.props.classes.dataEntryFieldSectionContainer}
186180
>
187181
<Section
188-
className={this.props.classes.dataEntryFieldSection}
189182
header={
190183
<SectionHeaderSimple
191184
title={section.name}

src/core_modules/capture-core/components/FormFields/New/HOC/withDefaultFieldContainer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { withStyles } from '@material-ui/core/styles';
55

66
const styles = (theme: Theme) => ({
77
container: {
8-
padding: 8,
8+
padding: '8px 8px 8px 12px',
99
},
1010
activeContainer: {
1111
backgroundColor: theme.palette.info.main,

src/core_modules/capture-core/components/Pages/New/NewPage.component.js

+21-8
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { RegistrationDataEntry } from './RegistrationDataEntry/RegistrationDataE
1818

1919
const getStyles = ({ typography }) => ({
2020
container: {
21-
padding: '10px 24px 16px 24px',
21+
padding: '8px 24px 16px 24px',
2222
},
2323
paper: {
2424
marginBottom: typography.pxToRem(10),
@@ -28,9 +28,18 @@ const getStyles = ({ typography }) => ({
2828
maxWidth: typography.pxToRem(950),
2929
},
3030
title: {
31-
padding: '10px 0 0px 10px',
31+
padding: '8px 0 0px 8px',
3232
fontWeight: 500,
33-
marginBottom: typography.pxToRem(16),
33+
},
34+
tetypeContainer: {
35+
marginTop: typography.pxToRem(16),
36+
},
37+
registrationContainer: {
38+
marginLeft: typography.pxToRem(8),
39+
marginRight: typography.pxToRem(8),
40+
},
41+
selectorTopMargin: {
42+
margin: typography.pxToRem(16),
3443
},
3544
emptySelectionPaperContent: {
3645
display: 'flex',
@@ -89,12 +98,16 @@ const NewPagePlain = ({
8998
</div>
9099
{
91100
(!scopeType || scopeType === scopeTypes.TRACKED_ENTITY_TYPE) &&
92-
<TrackedEntityTypeSelector onSelect={handleRegistrationScopeSelection} />
101+
<div className={classes.tetypeContainer}>
102+
<TrackedEntityTypeSelector onSelect={handleRegistrationScopeSelection} />
103+
</div>
93104
}
94-
<RegistrationDataEntry
95-
dataEntryId={NEW_TEI_DATA_ENTRY_ID}
96-
selectedScopeId={selectedScopeId}
97-
/>
105+
<div className={classes.registrationContainer}>
106+
<RegistrationDataEntry
107+
dataEntryId={NEW_TEI_DATA_ENTRY_ID}
108+
selectedScopeId={selectedScopeId}
109+
/>
110+
</div>
98111
</div>
99112
</Paper>
100113
}

src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/Assignee/Assignee.component.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const getStyles = () => ({
88
container: {
99
display: 'flex',
1010
alignItems: 'center',
11-
padding: 8,
11+
padding: '8px 8px 8px 12px',
1212
},
1313
containerVertical: {
1414
display: 'flex',

src/core_modules/capture-core/components/Pages/NewRelationship/RegisterTei/RegisterTei.component.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const getStyles = () => ({
1818
leftContainer: {
1919
flexGrow: 10,
2020
flexBasis: 0,
21-
marginTop: 10,
21+
margin: 8,
2222
},
2323
});
2424

Original file line numberDiff line numberDiff line change
@@ -1,27 +1,12 @@
11
// @flow
22
import * as React from 'react';
3-
import { withStyles } from '@material-ui/core/styles';
43
import { ProgramSelector } from './ProgramSelector';
54
import { RegUnitSelector } from './RegUnitSelector';
65

7-
const getStyles = (theme: Theme) => ({
8-
sectionFieldsInSection: {
9-
margin: theme.spacing.unit,
10-
},
11-
});
12-
type Props = {
13-
classes: Object,
14-
};
15-
16-
const SectionContents = (props: Props) => {
17-
const { classes } = props;
18-
return (
19-
<div
20-
className={classes.sectionFieldsInSection}
21-
>
22-
<RegUnitSelector />
23-
<ProgramSelector />
24-
</div>
25-
);
26-
};
27-
export default withStyles(getStyles)(SectionContents);
6+
const SectionContents = () => (
7+
<>
8+
<RegUnitSelector />
9+
<ProgramSelector />
10+
</>
11+
);
12+
export default SectionContents;

src/core_modules/capture-core/components/Pages/Search/SearchForm/SearchForm.component.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { ResultsPageSizeContext } from '../../shared-contexts';
1212

1313
const getStyles = (theme: Theme) => ({
1414
searchDomainSelectorSection: {
15-
margin: theme.typography.pxToRem(10),
15+
margin: '16px 8px 8px 8px',
1616
},
1717
searchRow: {
1818
display: 'flex',
@@ -200,7 +200,7 @@ const SearchFormIndex = ({
200200
className={classes.searchDomainSelectorSection}
201201
header={
202202
<SectionHeaderSimple
203-
containerStyle={{ paddingLeft: 8, borderBottom: '1px solid #ECEFF1' }}
203+
containerStyle={{ borderBottom: '1px solid #ECEFF1' }}
204204
title={i18n.t('Search {{name}}', { name })}
205205
onChangeCollapseState={() => { setExpandedFormId(formId); }}
206206
isCollapseButtonEnabled={isSearchSectionCollapsed}
@@ -252,7 +252,7 @@ const SearchFormIndex = ({
252252
className={classes.searchDomainSelectorSection}
253253
header={
254254
<SectionHeaderSimple
255-
containerStyle={{ paddingLeft: 8, borderBottom: '1px solid #ECEFF1' }}
255+
containerStyle={{ borderBottom: '1px solid #ECEFF1' }}
256256
title={searchByText}
257257
onChangeCollapseState={() => { setExpandedFormId(formId); }}
258258
isCollapseButtonEnabled={isSearchSectionCollapsed}

src/core_modules/capture-core/components/Pages/Search/SearchPage.component.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const getStyles = (theme: Theme) => ({
3535
maxWidth: theme.typography.pxToRem(950),
3636
},
3737
title: {
38-
padding: '10px 0 0px 10px',
38+
padding: '8px 0 0px 8px',
3939
fontWeight: 500,
4040
marginBottom: theme.typography.pxToRem(16),
4141
},

src/core_modules/capture-core/components/Section/SectionHeaderSimple.component.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const styles = theme => ({
1616
...theme.typography.title,
1717
fontSize: 16,
1818
fontWeight: 500,
19-
padding: '16px 8px 16px 8px',
19+
padding: '16px 8px 16px 12px',
2020
},
2121
children: {
2222
flexGrow: 1,

src/core_modules/capture-core/components/TrackedEntityTypeSelector/TrackedEntityTypeSelector.component.js

+11-14
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ import { useTrackedEntityTypesWithCorrelatedPrograms } from '../../hooks/useTrac
1515
import { useCurrentTrackedEntityTypeId } from '../../hooks/useCurrentTrackedEntityTypeId';
1616

1717
const styles = ({ typography }) => ({
18-
searchDomainSelectorSection: {
19-
margin: typography.pxToRem(10),
20-
},
2118
header: {
2219
paddingLeft: 8,
2320
},
@@ -26,21 +23,21 @@ const styles = ({ typography }) => ({
2623
display: 'flex',
2724
flexDirection: 'column',
2825
justifyContent: 'start',
29-
padding: '8px 0',
26+
paddingTop: '8px',
3027
},
3128
searchRowSelectElement: {
3229
marginLeft: 8,
3330
marginRight: 8,
34-
marginBottom: 8,
3531
width: '100%',
3632
},
3733
gridContainerInformativeText: {
3834
marginLeft: 8,
39-
marginTop: 4,
35+
marginTop: 12,
4036
marginBottom: 12,
4137
},
4238
gridItemInformativeText: {
4339
fontSize: 14,
40+
fontWeight: 'normal',
4441
marginLeft: 8,
4542
color: colors.grey800,
4643
},
@@ -84,7 +81,7 @@ export const TrackedEntityTypeSelectorPlain =
8481
>
8582
{
8683
useMemo(() => Object.values(trackedEntityTypesWithCorrelatedPrograms)
87-
// $FlowFixMe https://github.com/facebook/flow/issues/2221
84+
// $FlowFixMe https://github.com/facebook/flow/issues/2221
8885
.map(({ trackedEntityTypeName, trackedEntityTypeId }) =>
8986
(<SingleSelectOption
9087
key={trackedEntityTypeId}
@@ -98,14 +95,14 @@ export const TrackedEntityTypeSelectorPlain =
9895
</div>
9996
{
10097
!selectedSearchScopeId &&
101-
<Grid container direction="row" alignItems="center" className={classes.gridContainerInformativeText}>
102-
<Grid item>
103-
<InfoOutlinedIconWithStyles />
104-
</Grid>
105-
<Grid item className={classes.gridItemInformativeText}>
106-
{i18n.t('You can also choose a program from the top bar and search in that program')}
107-
</Grid>
98+
<Grid container direction="row" alignItems="center" className={classes.gridContainerInformativeText}>
99+
<Grid item>
100+
<InfoOutlinedIconWithStyles />
101+
</Grid>
102+
<Grid item className={classes.gridItemInformativeText}>
103+
{i18n.t('You can also choose a program from the top bar and search in that program')}
108104
</Grid>
105+
</Grid>
109106
}
110107
</>
111108
);

src/core_modules/capture-ui/CoordinateField/coordinateField.module.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
}
4949

5050
.clearIconWithMargin {
51-
padding: 2px;
51+
padding: 1px;
5252
}
5353

5454
.inputContainer {

0 commit comments

Comments
 (0)