Skip to content

Commit 87b9cf7

Browse files
committed
Merge remote-tracking branch 'origin/main' into dependabot/npm_and_yarn/eslint-plugin-unused-imports-4.2.0
2 parents 928ff7e + 41873fe commit 87b9cf7

File tree

4 files changed

+523
-73
lines changed

4 files changed

+523
-73
lines changed

src/components/ImgButtonGroup.tsx

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,20 @@ const StyledTypography = styled(Typography)<{ selected: boolean }>(({ theme, sel
2828
color: selected ? theme.palette.primary.main : theme.palette.grey[500],
2929
}))
3030

31+
const StyledCaption = styled(Typography)<{ selected: boolean }>(({ theme, selected }) => ({
32+
fontSize: 10,
33+
textTransform: 'none',
34+
color: selected ? theme.palette.primary.main : theme.palette.grey[500],
35+
marginLeft: '1px',
36+
}))
37+
3138
interface ImgButtonGroupProps {
3239
title?: string
3340
description?: string
3441
name: string
3542
control: any
3643
value: string
37-
options: { value: string; label: string; imgSrc: string }[]
44+
options: { value: string; label: string; imgSrc?: string; caption?: string }[]
3845
onChange?: (value: string) => void
3946
disabled?: boolean
4047
}
@@ -75,18 +82,29 @@ function ImgButtonGroup({
7582
}}
7683
selected={field.value === option.value}
7784
>
78-
<img
79-
style={{ width: 20, height: 20 }}
80-
src={option.imgSrc}
81-
onError={({ currentTarget }) => {
82-
// eslint-disable-next-line no-param-reassign
83-
currentTarget.onerror = null // prevents looping
84-
// eslint-disable-next-line no-param-reassign
85-
currentTarget.src = `${option.imgSrc}`
85+
{option.imgSrc && (
86+
<img
87+
style={{ width: 20, height: 20 }}
88+
src={option.imgSrc}
89+
onError={({ currentTarget }) => {
90+
// eslint-disable-next-line no-param-reassign
91+
currentTarget.onerror = null // prevents looping
92+
// eslint-disable-next-line no-param-reassign
93+
currentTarget.src = `${option.imgSrc}`
94+
}}
95+
alt={`Logo for ${option.imgSrc}`}
96+
/>
97+
)}
98+
<Box
99+
sx={{
100+
display: 'flex',
101+
flexDirection: 'column',
102+
alignItems: 'flex-start',
86103
}}
87-
alt={`Logo for ${option.imgSrc}`}
88-
/>
89-
<StyledTypography selected={field.value === option.value}>{option.label}</StyledTypography>
104+
>
105+
<StyledTypography selected={field.value === option.value}>{option.label}</StyledTypography>
106+
<StyledCaption selected={field.value === option.value}>{option.caption}</StyledCaption>
107+
</Box>
90108
</StyledButton>
91109
))}
92110
</Box>

src/components/LandingHeader.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ import * as React from 'react'
66
import { Breadcrumb, BreadcrumbProps } from './Breadcrumb/Breadcrumb'
77
import { Button } from './Button/Button'
88
import { DocsLink } from './DocsLink'
9+
import { CrumbOverridesProps } from './Breadcrumb/Crumbs'
910

1011
export interface LandingHeaderProps {
1112
analyticsLabel?: string
1213
betaFeedbackLink?: string
1314
breadcrumbDataAttrs?: { [key: string]: boolean }
15+
breadcrumbOverrides?: CrumbOverridesProps[]
1416
breadcrumbProps?: BreadcrumbProps
1517
buttonDataAttrs?: { [key: string]: boolean | string }
1618
createButtonText?: string
@@ -38,6 +40,7 @@ export function LandingHeader({
3840
analyticsLabel,
3941
betaFeedbackLink,
4042
breadcrumbDataAttrs,
43+
breadcrumbOverrides,
4144
breadcrumbProps,
4245
buttonDataAttrs,
4346
createButtonText,
@@ -80,6 +83,7 @@ export function LandingHeader({
8083
{...breadcrumbDataAttrs}
8184
{...breadcrumbProps}
8285
disabledBreadcrumbEditButton={disabledBreadcrumbEditButton}
86+
crumbOverrides={breadcrumbOverrides}
8387
/>
8488
</Grid>
8589
{!shouldHideDocsAndCreateButtons && (

0 commit comments

Comments
 (0)