Skip to content

Commit

Permalink
In Icons.tsx refactor common transform literal as a constant.
Browse files Browse the repository at this point in the history
  • Loading branch information
kostobog committed Oct 8, 2024
1 parent ead5886 commit 391eb0c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/Icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ import { SyncProblem, Warning } from "@mui/icons-material";
import { Tooltip } from "@mui/material";
import React from "react";

const transform = "scale(0.88)";

export const warnIcon = (message: any) => {
return iconWithMessage(<Warning transform={"scale(0.88)"} />, message);
return iconWithMessage(<Warning transform={transform} />, message);
};

export const syncProblemIcon = (message: any, messageCount = 1) => {
return iconWithMessage(
<SyncProblem transform={"scale(0.88)"} />,
<SyncProblem transform={transform} />,
message,
messageCount && messageCount > 1 ? messageCount : null,
);
Expand Down

0 comments on commit 391eb0c

Please sign in to comment.