Skip to content

Commit

Permalink
feat: Add the CommunityBubble component (#496)
Browse files Browse the repository at this point in the history
* feat: Add the CommunityBubble component

* fix: Styles
  • Loading branch information
LautaroPetaccio authored Jan 18, 2024
1 parent fd9c466 commit ba0c6a0
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/components/CommunityBubble/CommunityBubble.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.dui-community-bubble {
display: flex;
color: white;
border-radius: 12px;
padding: 10px 34px 10px 19px;
background: #161518;
align-items: center;
gap: 15px;
}

.dui-community-bubble__icon {
background-image: url('../../assets/discord.svg');
background-repeat: no-repeat;
background-size: contain;
height: 20px;
width: 28px;
filter: brightness(0) invert(1);
}

.dui-community-bubble__text--bold {
font-weight: 600;
}

.dui-community-bubble__text {
display: flex;
flex-direction: column;
color: white;
font-size: 12px;
}
7 changes: 7 additions & 0 deletions src/components/CommunityBubble/CommunityBubble.props.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export type CommunityBubbleProps = {
className?: string
i18n?: {
title: string
subtitle: string
}
}
6 changes: 6 additions & 0 deletions src/components/CommunityBubble/CommunityBubble.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import * as React from 'react'
import { storiesOf } from '@storybook/react'

import { CommunityBubble } from './CommunityBubble'

storiesOf('CommunityBubble', module).add('Base', () => <CommunityBubble />)
22 changes: 22 additions & 0 deletions src/components/CommunityBubble/CommunityBubble.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react'
import { CommunityBubbleProps } from './CommunityBubble.props'
import './CommunityBubble.css'
import classNames from 'classnames'

export const CommunityBubble = (props: CommunityBubbleProps) => {
return (
<a
className={classNames('dui-community-bubble', props.className)}
href="https://decentraland.org/discord"
target="about:blank"
>
<i className="dui-community-bubble__icon" />
<p className="dui-community-bubble__text">
<span>{props.i18n?.title ?? 'Need Guidance?'}</span>
<span className="dui-community-bubble__text--bold">
{props.i18n?.subtitle ?? 'ASK THE COMMUNITY'}
</span>
</p>
</a>
)
}
2 changes: 2 additions & 0 deletions src/components/CommunityBubble/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './CommunityBubble.props'
export * from './CommunityBubble'
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export * from './components/IconBadge/IconBadge'
export * from './components/SmartWearableFilter'
export * from './components/SmartBadge'
export * from './components/SmartIcon'
export * from './components/CommunityBubble'

// Semantic components
/* eslint-disable no-restricted-imports */
Expand Down

1 comment on commit ba0c6a0

@vercel
Copy link

@vercel vercel bot commented on ba0c6a0 Jan 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

decentraland-ui – ./

decentraland-ui-git-master-decentraland1.vercel.app
decentraland-ui-decentraland1.vercel.app

Please sign in to comment.