Skip to content

Commit

Permalink
feat(icons): add X icon and deprecate Twitter icon
Browse files Browse the repository at this point in the history
  • Loading branch information
DSil committed Oct 3, 2024
1 parent 50774c7 commit 7aa181f
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,10 @@ With this guide, we aim to walk through all the breaking changes and how they ca

### ColoredTwitter icon removed

The `ColoredTwitter` icon was removed. The `Twitter` icon should be used instead.
The `ColoredTwitter` icon was removed. The `X` icon should be used instead.

## Deprecations

### `Twitter` icon

The `Twitter` icon was deprecated and will be removed in a future version. The `X` icon should be used instead.
12 changes: 12 additions & 0 deletions packages/orbit-components/config/build/buildIcons.mts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ const randomId = () => Math.random().toString(36).substring(2, 9);
const camelcase = (str: string) => str.replace(/[-_.](.)/g, (_, char) => char.toUpperCase());
const firstToUpper = (str: string) => str.charAt(0).toUpperCase() + str.slice(1);

const DEPRECATED_ICONS = ["Twitter"];

(async () => {
const files = await globby("src/icons/svg/*.svg");
const [, __dirname] = filedirname();
Expand Down Expand Up @@ -45,6 +47,7 @@ const firstToUpper = (str: string) => str.charAt(0).toUpperCase() + str.slice(1)
const iconPath = t.jsxFragment(t.jsxOpeningFragment(), t.jsxClosingFragment(), jsx.children);
const iconViewbox = typeof viewBox === "string" ? t.stringLiteral(viewBox) : "";
const iconName = t.stringLiteral(componentName);
const deprecated = DEPRECATED_ICONS.includes(componentName);

return tpl`
/* eslint-disable */
Expand All @@ -54,6 +57,15 @@ const firstToUpper = (str: string) => str.charAt(0).toUpperCase() + str.slice(1)
import createIcon from "../Icon/createIcon";
${
deprecated
? `
/**
* @deprecated
*/
`
: ""
}
export default createIcon(${iconPath}, ${iconViewbox}, ${iconName});
`;
};
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions packages/orbit-components/src/icons/svg/x.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7aa181f

Please sign in to comment.