-
-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add profile badge to connected user profile (#824)
- Loading branch information
Showing
6 changed files
with
48 additions
and
16 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,17 @@ | ||
interface BadgeProps { | ||
text: string; | ||
className?: string; | ||
} | ||
const Badge = ({ text, className }: BadgeProps): JSX.Element => { | ||
return ( | ||
<div | ||
className={`text-light-orange-9 item-center inline-flex justify-center text-sm px-3 rounded-2xl h-6 bg-light-orange-3 w-max py-0.5 ${ | ||
className || "" | ||
}`} | ||
> | ||
{text} | ||
</div> | ||
); | ||
}; | ||
|
||
export default Badge; |
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 |
---|---|---|
@@ -1,15 +1,13 @@ | ||
import Text from "components/atoms/Typography/text"; | ||
|
||
interface BadgeProps { | ||
isPublic: boolean; | ||
} | ||
|
||
const Badge = ({ isPublic }: BadgeProps): JSX.Element => { | ||
const InsightsBadge = ({ isPublic }: BadgeProps): JSX.Element => { | ||
return ( | ||
<div className="inline-flex border h-8 border-light-slate-6 rounded-3xl bg-light-slate-3 px-2.5 py-1"> | ||
<span className="text-light-slate-11 leading-normal">{!!isPublic ? "Public" : "Private"}</span> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Badge; | ||
export default InsightsBadge; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Badge from "components/atoms/Badge/badge"; | ||
import { ComponentStory } from "@storybook/react"; | ||
|
||
const StoryConfig = { | ||
title: "Design System/Atoms/Badge" | ||
}; | ||
export default StoryConfig; | ||
|
||
const BadgeTemplate: ComponentStory<typeof Badge> = (args) => <Badge {...args} />; | ||
|
||
export const BadgeStory = BadgeTemplate.bind({}); | ||
|
||
BadgeStory.args = { | ||
text: "beta" | ||
}; |
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 |
---|---|---|
@@ -1,17 +1,15 @@ | ||
import { ComponentStory } from "@storybook/react"; | ||
import Badge from "components/atoms/InsightBadge/insight-badge"; | ||
|
||
import InsightsBadge from "components/atoms/InsightBadge/insight-badge"; | ||
|
||
const storyConfig = { | ||
title: "Design System/Atoms/Badge" | ||
title: "Design System/Atoms/InsightsBadge" | ||
}; | ||
|
||
export default storyConfig; | ||
|
||
const BadgeTemplate:ComponentStory<typeof Badge> = (args) => <Badge {...args}/>; | ||
const BadgeTemplate: ComponentStory<typeof InsightsBadge> = (args) => <InsightsBadge {...args} />; | ||
|
||
export const isPublic = BadgeTemplate.bind({}); | ||
isPublic.args = {isPublic:true}; | ||
export const isPublic = BadgeTemplate.bind({}); | ||
isPublic.args = { isPublic: true }; | ||
export const isPrivate = BadgeTemplate.bind({}); | ||
isPublic.args = {isPublic:false}; | ||
|
||
isPrivate.args = { isPublic: false }; |