Skip to content

Commit

Permalink
Alt tag
Browse files Browse the repository at this point in the history
  • Loading branch information
dlnr committed Nov 10, 2023
1 parent 1cfa8f1 commit 2cad227
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion packages/react/src/Logo/Logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,27 @@ function getLogoVariant(variant: LogoProps['variant']) {
}
}

function getLogoVariantTitle(variant: LogoProps['variant']) {
switch (variant) {
case 'amsterdam':
return 'Gemeente Amsterdam'
case 'ggd-amsterdam':
return 'GGD Amsterdam'
case 'stadsarchief':
return 'Stadsarchief Amsterdam'
case 'stadsbank-lening':
return 'Stadsbank van Lening'
case 'vga-verzekeringen':
return 'VGA Verzekeringen'
default:
return 'Gemeente Amsterdam'
}
}

export const Logo = forwardRef(
({ variant = 'amsterdam', className, ...restProps }: LogoProps, ref: ForwardedRef<HTMLElement>) => (
<span {...restProps} ref={ref} className={clsx('amsterdam-logo', className)}>
<img src={getLogoVariant(variant)} />
<img src={getLogoVariant(variant)} alt={`Logo ${getLogoVariantTitle(variant)}`} />
</span>
),
)
Expand Down

0 comments on commit 2cad227

Please sign in to comment.