Skip to content

Commit

Permalink
feat(FeatureIcon): migrate to Tailwind
Browse files Browse the repository at this point in the history
Closes FEPLT-1721
  • Loading branch information
mvidalgarcia committed Jan 23, 2024
1 parent 7115064 commit a790417
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docs/src/data/tailwind-migration-status.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Desktop: true
Dialog: true
Drawer: true
ErrorFormTooltip: true
FeatureIcon: false
FeatureIcon: true
FormLabel: true
Grid: true
Heading: true
Expand Down
22 changes: 7 additions & 15 deletions packages/orbit-components/src/FeatureIcon/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
"use client";

import * as React from "react";
import styled from "styled-components";

import defaultTheme from "../defaultTheme";
import { baseURL } from "./consts";
import type { Props } from "./types";

Expand All @@ -24,20 +22,14 @@ const generateURL = (name: string) => {
return { src: urlWithName(), srcSet: [urlWithName(2), urlWithName(3)].join(",") };
};

export const StyledFeatureIcon = styled(({ className, name, alt, dataTest, id }) => (
<img className={className} alt={alt} data-test={dataTest} id={id} {...generateURL(name)} />
))`
height: ${baseSize}px;
width: auto;
background-color: transparent;
`;

StyledFeatureIcon.defaultProps = {
theme: defaultTheme,
};

const FeatureIcon = ({ alt = "", name, dataTest, id }: Props) => (
<StyledFeatureIcon alt={alt} name={name} dataTest={dataTest} id={id} />
<img
className="h-[52px] w-auto bg-transparent"
alt={alt}
data-test={dataTest}
id={id}
{...generateURL(name)}
/>
);

export default FeatureIcon;

0 comments on commit a790417

Please sign in to comment.