Skip to content

Commit

Permalink
chore #127: Add IconKeys enum
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-dassana committed Oct 21, 2020
1 parent 56496d7 commit b1f2f88
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
26 changes: 22 additions & 4 deletions src/components/Icon/IconsMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,36 @@ import { ReactComponent as APP_STORE } from '../assets/icons/app-store.svg'
import { ReactComponent as AWS } from '../assets/icons/aws.svg'
import { ReactComponent as AZURE } from '../assets/icons/azure.svg'
import { ReactComponent as DASSANA } from '../assets/icons/dassana.svg'
import { ReactComponent as GOOGLE_CLOUD } from '../assets/icons/google-cloud.svg'
import { ReactComponent as GITHUB } from '../assets/icons/github.svg'
import { ReactComponent as GOOGLE_CLOUD_PLATFORM } from '../assets/icons/google-cloud-platform.svg'
import { ReactComponent as QUERY_SERVICE } from '../assets/icons/query-service.svg'
import { ReactComponent as SALESFORCE } from '../assets/icons/salesforce.svg'
import { ReactComponent as ZOOM } from '../assets/icons/zoom.svg'

const Icons = {
appStore: APP_STORE,
aws: AWS,
azure: AZURE,
dassana: DASSANA,
'google-cloud': GOOGLE_CLOUD,
queryService: QUERY_SERVICE
github: GITHUB,
googleCloudService: GOOGLE_CLOUD_PLATFORM,
queryService: QUERY_SERVICE,
salesforce: SALESFORCE,
zoom: ZOOM
}

export default Icons

export type IconName = keyof typeof Icons

export default Icons
export enum IconKeys {
appStore = 'appStore',
aws = 'aws',
azure = 'azure',
dassana = 'dassana',
github = 'github',
googleCloudService = 'googleCloudService',
queryService = 'queryService',
salesforce = 'salesforce',
zoom = 'zoom'
}
8 changes: 5 additions & 3 deletions src/components/Icon/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import Icons, { IconName } from './IconsMap'
import Icons, { IconKeys, IconName } from './IconsMap'
import React, { FC } from 'react'

export type { IconName }

export interface SharedIconProps {
/**
* The height of the icon, in pixels. Width will be calculated by default.
Expand Down Expand Up @@ -43,3 +41,7 @@ export const Icon: FC<IconProps> = ({ height = 32, ...props }: IconProps) => {

return <img alt={icon} height={height} src={icon} />
}

export type { IconName }

export { IconKeys }

0 comments on commit b1f2f88

Please sign in to comment.