Skip to content

Commit

Permalink
Переименовла переменную, убрала лишнюю точку с запятой
Browse files Browse the repository at this point in the history
  • Loading branch information
EugiSma committed Mar 15, 2024
1 parent a7d70fc commit 60b1163
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/HtmlTag/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,13 @@ export const HtmlTag: RedactorComponent = ({
*/

// Добавила пустой обьект для хранения функции
let useclick = {};
let clickProp = {}
// Проверяем тег элемента
if (tagLower === 'button') {
// Если элемент кнопка и у него есть аттрибут data-href, то добавляем функцию перехода по ссылке, указанной пользователем
if (object.props['data-href']) {
if (!inEditMode) {
useclick = {
clickProp = {
onClick:() => {
window.location.href = object.props['data-href']
}
Expand All @@ -220,7 +220,7 @@ export const HtmlTag: RedactorComponent = ({
ref={ref as (el: any) => void}
{...tagPropsExt}
// Добавляем клик
{...useclick}
{...clickProp}
>
{object.props.children || childrenContent}
</Tag>
Expand Down

0 comments on commit 60b1163

Please sign in to comment.