Skip to content

Commit

Permalink
Merge pull request #836 from CodeForAfrica/fix/hurumap_select_component
Browse files Browse the repository at this point in the history
@PesaYetu Fix Select component styles
  • Loading branch information
m453h authored Aug 14, 2024
2 parents 19dc343 + 8721f44 commit 01430cd
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ const useStyles = makeStyles(({ breakpoints, typography, palette }) => ({
},
select: {
width: typography.pxToRem(165),
height: typography.pxToRem(40),
paddingLeft: 0,
[breakpoints.up("lg")]: {
width: typography.pxToRem(185),
width: typography.pxToRem(200),
},
},
filled: {
padding: `${typography.pxToRem(10)} 0 ${typography.pxToRem(
10,
)} ${typography.pxToRem(15)} !important`,
padding: `${typography.pxToRem(10)} ${typography.pxToRem(
40,
)} ${typography.pxToRem(10)} ${typography.pxToRem(20)} !important`,
},
selectPaper: {
maxHeight: typography.pxToRem(310),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ function PinAndCompare({
options={options}
placeholder={placeholder}
selected={selected}
classes={{ select: classes.locationSelect, paper: classes.selectPaper }}
classes={{
select: classes.locationSelect,
paper: classes.selectPaper,
filled: classes.filled,
}}
/>
</Box>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const useStyles = makeStyles(({ typography, palette }) => ({
borderBottom: `solid 1px ${palette.divider}`,
},
pinButton: {
maxHeight: typography.pxToRem(44),
maxWidth: typography.pxToRem(44),
maxHeight: typography.pxToRem(40),
maxWidth: typography.pxToRem(40),
overflow: "hidden",
padding: 0,
marginRight: typography.pxToRem(14),
Expand All @@ -20,8 +20,14 @@ const useStyles = makeStyles(({ typography, palette }) => ({
},
},
locationSelect: {
paddingTop: typography.pxToRem(10),
paddingBottom: typography.pxToRem(10),
width: typography.pxToRem(205),
height: typography.pxToRem(40),
paddingLeft: 0,
},
filled: {
padding: `${typography.pxToRem(10)} 0 ${typography.pxToRem(
10,
)} ${typography.pxToRem(15)} !important`,
},
selectPaper: {
height: typography.pxToRem(310),
Expand Down
4 changes: 1 addition & 3 deletions apps/climatemappedafrica/src/components/Select/useStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ const useStyles = makeStyles(({ typography, palette, breakpoints }) => ({
},
},
select: {
height: "100%",
width: typography.pxToRem(135),
background: palette.background.paper,
borderStyle: "none",
borderRadius: 2,
paddingLeft: typography.pxToRem(24),
paddingBottom: typography.pxToRem(15),
paddingTop: typography.pxToRem(15),
fontSize: typography.caption.fontSize,
Expand All @@ -28,7 +26,7 @@ const useStyles = makeStyles(({ typography, palette, breakpoints }) => ({
display: "none",
},
[breakpoints.up("lg")]: {
width: typography.pxToRem(165),
width: typography.pxToRem(185),
},
},
paper: {
Expand Down
10 changes: 6 additions & 4 deletions apps/pesayetu/src/components/HURUmap/ChartFilter/useStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ const useStyles = makeStyles(({ breakpoints, typography, palette }) => ({
},
select: {
width: typography.pxToRem(165),
height: typography.pxToRem(40),
paddingLeft: 0,
[breakpoints.up("lg")]: {
width: typography.pxToRem(185),
width: typography.pxToRem(200),
},
},
filled: {
padding: `${typography.pxToRem(10)} 0 ${typography.pxToRem(
10,
)} ${typography.pxToRem(15)} !important`,
padding: `${typography.pxToRem(10)} ${typography.pxToRem(
40,
)} ${typography.pxToRem(10)} ${typography.pxToRem(20)} !important`,
},
selectPaper: {
maxHeight: typography.pxToRem(310),
Expand Down
6 changes: 5 additions & 1 deletion apps/pesayetu/src/components/HURUmap/PinAndCompare/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ function PinAndCompare({
options={options}
placeholder={placeholder}
selected={selected}
classes={{ select: classes.locationSelect, paper: classes.selectPaper }}
classes={{
select: classes.select,
filled: classes.filled,
paper: classes.selectPaper,
}}
/>
</Box>
);
Expand Down
18 changes: 12 additions & 6 deletions apps/pesayetu/src/components/HURUmap/PinAndCompare/useStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const useStyles = makeStyles(({ typography, palette }) => ({
borderBottom: `solid 1px ${palette.divider}`,
},
pinButton: {
maxHeight: typography.pxToRem(44),
maxWidth: typography.pxToRem(44),
maxHeight: typography.pxToRem(40),
maxWidth: typography.pxToRem(40),
overflow: "hidden",
padding: 0,
marginRight: typography.pxToRem(14),
Expand All @@ -19,12 +19,18 @@ const useStyles = makeStyles(({ typography, palette }) => ({
backgroundColor: palette.grey.light,
},
},
locationSelect: {
paddingTop: typography.pxToRem(10),
paddingBottom: typography.pxToRem(10),
select: {
width: typography.pxToRem(205),
height: typography.pxToRem(40),
paddingLeft: 0,
},
filled: {
padding: `${typography.pxToRem(10)} 0 ${typography.pxToRem(
10,
)} ${typography.pxToRem(15)} !important`,
},
selectPaper: {
height: typography.pxToRem(310),
maxHeight: typography.pxToRem(310),
},
}));

Expand Down
4 changes: 1 addition & 3 deletions apps/pesayetu/src/components/Select/useStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ const useStyles = makeStyles(({ typography, palette, breakpoints }) => ({
},
},
select: {
height: "100%",
width: typography.pxToRem(135),
background: palette.background.paper,
borderStyle: "none",
borderRadius: 2,
paddingLeft: typography.pxToRem(24),
paddingBottom: typography.pxToRem(15),
paddingTop: typography.pxToRem(15),
fontSize: typography.caption.fontSize,
Expand All @@ -28,7 +26,7 @@ const useStyles = makeStyles(({ typography, palette, breakpoints }) => ({
display: "none",
},
[breakpoints.up("lg")]: {
width: typography.pxToRem(165),
width: typography.pxToRem(185),
},
},
paper: {
Expand Down

0 comments on commit 01430cd

Please sign in to comment.