-
Notifications
You must be signed in to change notification settings - Fork 433
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/1070-explorer-zoom-drag
- Loading branch information
Showing
36 changed files
with
297 additions
and
266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { allProviders, IntegrationProvider } from '@utils/providerHelper'; | ||
import Avatar from './Avatar'; | ||
|
||
// More on how to set up stories at: https://storybook.js.org/docs/7.0/react/writing-stories/introduction | ||
const meta: Meta<typeof Avatar> = { | ||
title: 'Komiser/Avatar', | ||
component: Avatar, | ||
tags: ['autodocs'], | ||
args: { | ||
size: 48 | ||
} | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof Avatar>; | ||
|
||
// More on writing stories with args: https://storybook.js.org/docs/7.0/react/writing-stories/args | ||
export const AmazonWebServices: Story = { | ||
args: { | ||
avatarName: allProviders.AWS | ||
} | ||
}; | ||
|
||
export const GoogleCloudPlatform: Story = { | ||
args: { | ||
avatarName: allProviders.GCP | ||
} | ||
}; | ||
|
||
export const DigitalOcean: Story = { | ||
args: { | ||
avatarName: allProviders.DIGITAL_OCEAN | ||
} | ||
}; | ||
|
||
export const Azure: Story = { | ||
args: { | ||
avatarName: allProviders.AZURE | ||
} | ||
}; | ||
|
||
export const Civo: Story = { | ||
args: { | ||
avatarName: allProviders.CIVO | ||
} | ||
}; | ||
|
||
export const Kubernetes: Story = { | ||
args: { | ||
avatarName: allProviders.KUBERNETES | ||
} | ||
}; | ||
|
||
export const Linode: Story = { | ||
args: { | ||
avatarName: allProviders.LINODE | ||
} | ||
}; | ||
|
||
export const Tencent: Story = { | ||
args: { | ||
avatarName: allProviders.TENCENT | ||
} | ||
}; | ||
|
||
export const OCI: Story = { | ||
args: { | ||
avatarName: allProviders.OCI | ||
} | ||
}; | ||
|
||
export const Scaleway: Story = { | ||
args: { | ||
avatarName: allProviders.SCALE_WAY | ||
} | ||
}; | ||
|
||
export const MongoDBAtlas: Story = { | ||
name: 'MongoDB Atlas', | ||
args: { | ||
avatarName: allProviders.MONGODB_ATLAS | ||
} | ||
}; | ||
|
||
export const Terraform: Story = { | ||
args: { | ||
avatarName: allProviders.TERRAFORM | ||
} | ||
}; | ||
|
||
export const Pulumi: Story = { | ||
args: { | ||
avatarName: allProviders.PULUMI | ||
} | ||
}; | ||
|
||
export const Slack: Story = { | ||
args: { | ||
avatarName: IntegrationProvider.SLACK | ||
} | ||
}; | ||
|
||
export const Webhook: Story = { | ||
args: { | ||
avatarName: IntegrationProvider.WEBHOOK | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import platform, { IntegrationProvider, Provider } from '@utils/providerHelper'; | ||
import Image from 'next/image'; | ||
|
||
export type AvatarProps = { | ||
avatarName: Provider | IntegrationProvider; | ||
size?: number; | ||
}; | ||
|
||
function Avatar({ avatarName, size = 24 }: AvatarProps) { | ||
const src = platform.getImgSrc(avatarName) || 'unknown platform'; | ||
return ( | ||
<Image | ||
src={src} | ||
alt={`${avatarName} logo`} | ||
width={size} | ||
height={size} | ||
className="rounded-full border border-gray-100" | ||
/> | ||
); | ||
} | ||
|
||
export default Avatar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.