Skip to content

Commit

Permalink
Update SourceIcon to account for full bleed images
Browse files Browse the repository at this point in the history
  • Loading branch information
scottybollinger committed Nov 18, 2020
1 parent b7fd553 commit 4f4a173
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,33 @@

import React from 'react';

// Prefer importing entire lodash library, e.g. import { get } from "lodash"
// eslint-disable-next-line no-restricted-imports
import _camelCase from 'lodash/camelCase';
import { camelCase } from 'lodash';

import { images } from '../assets/source_icons';
import { imagesFull } from '../assets/sources_full_bleed';

interface SourceIconProps {
serviceType: string;
name: string;
className?: string;
wrapped?: boolean;
fullBleed?: boolean;
}

export const SourceIcon: React.FC<SourceIconProps> = ({
name,
serviceType,
className,
wrapped,
fullBleed = false,
}) => {
const icon = <img src={images[_camelCase(serviceType)]} alt={name} className={className} />;
const icon = (
<img
src={fullBleed ? imagesFull[camelCase(serviceType)] : images[camelCase(serviceType)]}
alt={name}
className={className}
/>
);
return wrapped ? (
<div className="user-group-source" title={name}>
{icon}
Expand Down

0 comments on commit 4f4a173

Please sign in to comment.