Skip to content

Commit 7816405

Browse files
authored
Updated HelpMenu components to use only mds subcomponents (#3119)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
1 parent 6d5d11d commit 7816405

File tree

4 files changed

+125
-180
lines changed

4 files changed

+125
-180
lines changed

portal-ui/src/common/MoreLink.tsx

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

1717
import React from "react";
18-
import { ArrowIcon } from "mds";
18+
import { ArrowIcon, Box } from "mds";
1919

2020
const MoreLink = ({
2121
LeadingIcon,
@@ -39,8 +39,8 @@ const MoreLink = ({
3939
href={link}
4040
target={"_blank"}
4141
>
42-
<div
43-
style={{
42+
<Box
43+
sx={{
4444
display: "flex",
4545
flexDirection: "row",
4646
alignItems: "center",
@@ -49,25 +49,34 @@ const MoreLink = ({
4949
}}
5050
>
5151
{LeadingIcon && (
52-
<div style={{ flexGrow: 0, flexShrink: 1, lineHeight: "12px" }}>
53-
{/*@ts-ignore*/}
54-
<LeadingIcon style={{ height: 16, width: 16 }} />
55-
</div>
52+
<Box
53+
sx={{
54+
flexGrow: 0,
55+
flexShrink: 1,
56+
lineHeight: "12px",
57+
"& svg": {
58+
height: 16,
59+
width: 16,
60+
},
61+
}}
62+
>
63+
<LeadingIcon />
64+
</Box>
5665
)}
57-
<div style={{ flexGrow: 0, flexShrink: 1, lineHeight: "12px" }}>
66+
<Box sx={{ flexGrow: 0, flexShrink: 1, lineHeight: "12px" }}>
5867
{text}
59-
</div>
60-
<div
61-
style={{
68+
</Box>
69+
<Box
70+
sx={{
6271
flexGrow: 0,
6372
flexShrink: 1,
6473
lineHeight: "12px",
6574
marginTop: 2,
6675
}}
6776
>
6877
<ArrowIcon style={{ width: 12 }} />
69-
</div>
70-
</div>
78+
</Box>
79+
</Box>
7180
</a>
7281
);
7382
};

portal-ui/src/screens/Console/HelpItem.tsx

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,37 +31,27 @@ const HelpItem = ({ item, displayImage = true }: IHelpItemProps) => {
3131
style={{
3232
display: "flex",
3333
flexDirection: "row",
34-
flexWrap: "nowrap",
35-
marginBottom: 20,
3634
}}
3735
>
3836
{displayImage && (
39-
<div style={{ paddingLeft: 16, paddingRight: 16 }}>
37+
<div style={{ paddingLeft: 16 }}>
4038
<a href={item.url} target={"_blank"}>
41-
<div
39+
<img
40+
src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
41+
alt={item.title}
4242
style={{
43-
backgroundColor: "#dedede",
4443
width: 208,
45-
height: 62,
44+
height: 116,
45+
backgroundImage: `url(${item.img}), url(${placeholderImg})`,
46+
backgroundPosition: "center center",
47+
backgroundSize: "cover",
48+
backgroundRepeat: "no-repeat",
4649
}}
47-
>
48-
<img
49-
src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
50-
alt={item.title}
51-
style={{
52-
width: 208,
53-
height: 116,
54-
backgroundImage: `url(${item.img}), url(${placeholderImg})`,
55-
backgroundPosition: "center center",
56-
backgroundSize: "cover",
57-
backgroundRepeat: "no-repeat",
58-
}}
59-
/>
60-
</div>
50+
/>
6151
</a>
6252
</div>
6353
)}
64-
<div style={{ flexGrow: 1, flexBasis: "auto" }}>
54+
<div style={{ flexGrow: 1, flexBasis: "auto", paddingLeft: 16 }}>
6555
<div
6656
style={{
6757
width: "100%",

0 commit comments

Comments
 (0)