Skip to content

Commit

Permalink
Fix Badge alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
vineethasok committed Oct 20, 2023
1 parent 142bada commit 7b2219e
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions src/components/Badge/Badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import styled from "styled-components";
import { HorizontalDirection, Icon, IconName } from "@/components";
import { HTMLAttributes, MouseEvent, ReactNode } from "react";
import { EllipsisContainer } from "../commonElement";
import IconWrapper from "../IconWrapper/IconWrapper";
export type BadgeState =
| "default"
| "success"
Expand Down Expand Up @@ -92,26 +93,14 @@ export const Badge = ({
{...props}
>
<Content>
{icon && iconDir === "start" && (
<SvgContainer
as={Icon}
name={icon}
$state={state}
$size={size}
/>
)}
<BadgeContent>
<span>{text}</span>
<BadgeContent
as={IconWrapper}
icon={icon}
iconDir={iconDir}
size={size}
>
{text}
</BadgeContent>
{icon && iconDir === "end" && (
<SvgContainer
as={Icon}
name={icon}
$state={state}
$size={size}
/>
)}

{dismissible && (
<SvgContainer
name="cross"
Expand Down

0 comments on commit 7b2219e

Please sign in to comment.