Skip to content

Commit

Permalink
chore: fix some icons migration (#8512)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirpotekhin authored Aug 13, 2024
1 parent 7e2ca6f commit 54c6a8d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ export function renameIcons(pattern = ALL_FILES): void {
from: new RegExp(`["'\`]${from}["'\`]`, 'g'),
to,
})).forEach(({from, to}) => {
text = text.replaceAll(from, `"${to}"`);
text = text.replaceAll(
from,
(match) => `${match.slice(0, 1)}${to}${match.slice(0, 1)}`,
);
});

const regex = /['"`]tuiIcon(?!Button\b)[A-Z][a-zA-Z0-9]*\b/g;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ const TEMPLATE_BEFORE = `
></tui-avatar>
<button tuiIconButton icon="tuiIconClose">Button</button>
<button tuiIconButton icon="tuiIconCloseLarge">Button</button>
<tui-icon [icon]="featureValue.value === 'true' ? 'tuiIconCheck' : 'tuiIconClose'"></tui-icon>
`;

const TEMPLATE_AFTER = `
Expand All @@ -100,6 +101,7 @@ const TEMPLATE_AFTER = `
></tui-avatar>
<button tuiIconButton icon="@tui.x">Button</button>
<button tuiIconButton icon="@tui.x">Button</button>
<tui-icon [icon]="featureValue.value === 'true' ? '@tui.check' : '@tui.x'"></tui-icon>
`;

const PROPRIETARY_TEMPLATE_BEFORE = `
Expand Down

0 comments on commit 54c6a8d

Please sign in to comment.