@@ -47,17 +47,40 @@ const StyledToggleButton = styled(ToggleButton)(({ theme }) => ({
47
47
backgroundColor : theme . custom . colors . white ,
48
48
} ,
49
49
...theme . typography . subtitle3 ,
50
+
51
+ // MUI's ToggleButtonGroup have a -1 margin offset that caused problems for our borders.
52
+ "&.MuiToggleButtonGroup-middleButton, .MuiToggleButtonGroup-lastButton" : {
53
+ margin : 0 ,
54
+ } ,
55
+ /**
56
+ * The goal here is to ensure the icons:
57
+ * - scale at same rate when container shrinks
58
+ * - are hidden if container is too small
59
+ *
60
+ * NOTE: containerType: size enables the container query but requires setting
61
+ * a width on the container. We are doing this anyway.
62
+ */
63
+ containerType : "size" ,
64
+ boxSizing : "border-box" ,
65
+ "& > span" : {
66
+ minWidth : "70px" ,
67
+ } ,
68
+ "@container (max-width: 85px)" : {
69
+ "& > svg" : {
70
+ display : "none" ,
71
+ } ,
72
+ } ,
50
73
} ) )
51
74
52
75
const ViewAllButton = styled ( StyledToggleButton ) `
53
- border-right: 2px solid;
76
+ border-right: 1px solid;
54
77
border-color: ${ ( { theme } ) => theme . custom . colors . silverGrayLight } ;
55
78
width: 20%;
56
79
border-top-left-radius: 4px;
57
80
border-bottom-left-radius: 4px;
58
81
`
59
82
const AcademicButton = styled ( StyledToggleButton ) `
60
- border-right: 2px solid;
83
+ border-right: 1px solid;
61
84
border-color: ${ ( { theme } ) => theme . custom . colors . silverGrayLight } ;
62
85
width: 40%;
63
86
`
@@ -93,10 +116,10 @@ const ProfessionalToggle: React.FC<{
93
116
>
94
117
< ViewAllButton value = "" > All</ ViewAllButton >
95
118
< AcademicButton value = "false" >
96
- < StyledRiBookOpenLine /> Academic
119
+ < StyledRiBookOpenLine /> < span > Academic</ span >
97
120
</ AcademicButton >
98
121
< ProfesionalButton value = "true" >
99
- < StyledRiBriefcase3Line /> Professional
122
+ < StyledRiBriefcase3Line /> < span > Professional</ span >
100
123
</ ProfesionalButton >
101
124
</ StyledToggleButtonGroup >
102
125
< Collapse in = { professionalSetting === "" } >
0 commit comments