Skip to content

Commit

Permalink
rename protocols to badges
Browse files Browse the repository at this point in the history
  • Loading branch information
KhudaDad414 committed Oct 5, 2023
1 parent 63f097c commit c1b493e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
3 changes: 2 additions & 1 deletion apps/design-system/src/components/AppCard.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const CodeEditor: Story = {
isActive: true,
name: 'User Registration',
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque posuere fermentum urna, eu condimentum mauris. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque posuere fermentum urna, eucondimentum mauris. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque posuere fermentumurna, eu condimentum mauris. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque posuerefermentum urna, eu condimentum maur",
protocols: ['http', 'kafka', 'websocket'],
badges: ['http', 'kafka', 'websocket'],
isServer: true
},
}
14 changes: 9 additions & 5 deletions packages/ui/components/AppCard.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
import { Protocol, ProtocolBadge } from './ProtocolBadge';
import { Info, ServiceInfoBadge } from './ServiceInfoBadge';

interface AppCardProps {
isActive?: boolean;
name: string;
description: string;
protocols: Protocol[]
badges: Info[];
isClient: boolean;
isServer: boolean;
className?: string;
}

export const AppCard = ({isActive = false, name, description, protocols, className}:AppCardProps) => {
export const AppCard = ({isActive = false, name, description, badges, className, isClient, isServer}:AppCardProps) => {
return (
<>
<div
className={`bg-gray-800 border-gray-800 rounded-lg w-[523px] border-2 ${className} ${
isActive ? ' border-pink-800/30 shadow-service-card' : ''
isActive ? ' border-pink-800/30 shadow-active' : ''
}`}
>
<div className="flex flex-col gap-2 px-5 py-3">
<h3 className="text-base font-medium text-gray-100">{name}</h3>
<div className='flex gap-1'>
{protocols.map((protocol, index) => (<ProtocolBadge protocol={protocol} key={index} />))}
{isClient && <ServiceInfoBadge info='client' className='mr-2'/>}
{isServer && <ServiceInfoBadge info='server' className='mr-2'/>}
{badges.map((badge, index) => (<ServiceInfoBadge info={badge} key={index} />))}
</div>
</div>
<div className="w-full h-px bg-gray-700"></div>
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/components/ServiceInfoBadge.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { FunctionComponent } from 'react'
import { AMQPIcon, AWSSNSIcon, AWSSQSIcon, ClientIcon, GooglePubSubIcon, IBMMQIcon, KafkaIcon, MQTTIcon, NATSIcon, PulsarIcon, RedisIcon, ServerIcon, SolaceIcon, StompIcon, WebSocketIcon } from './icons'

export type Info = 'http' | 'kafka' | 'websocket' | 'amqp' | 'mqtt' | 'googlepubsub' | 'ibmmq' | 'nats' | 'pulsar' | 'redis' | 'sns' | 'sqs' | 'solace' | 'stomp'
export type Info = 'http' | 'kafka' | 'websocket' | 'amqp' | 'mqtt' | 'googlepubsub' | 'ibmmq' | 'nats' | 'pulsar' | 'redis' | 'sns' | 'sqs' | 'solace' | 'stomp' | 'client' | 'server'
interface ServiceInfoBadgeProps {
className?: string
info: Info
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
theme: {
extend: {
boxShadow: {
'service-card': '0px 0px 29px 0px rgba(190, 24, 93, 0.50)',
active: '0px 0px 29px 0px rgba(190, 24, 93, 0.50)',
},
},
}
Expand Down

0 comments on commit c1b493e

Please sign in to comment.