From 74e844ac56ca24414a10b13c089df461a8fb8378 Mon Sep 17 00:00:00 2001 From: Alex Andreev Date: Tue, 17 May 2022 12:08:52 +0300 Subject: [PATCH] Respect id prop Signed-off-by: Alex Andreev --- .../components/update-button/update-button.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/renderer/components/update-button/update-button.tsx b/src/renderer/components/update-button/update-button.tsx index 87252610fa..d9e5f00d25 100644 --- a/src/renderer/components/update-button/update-button.tsx +++ b/src/renderer/components/update-button/update-button.tsx @@ -5,21 +5,21 @@ import styles from "./styles.module.scss"; +import type { HTMLAttributes} from "react"; import React, { useState } from "react"; import { Menu, MenuItem } from "../menu"; -import uniqueId from "lodash/uniqueId"; import { noop } from "lodash"; import { cssNames } from "../../utils"; import type { IconProps } from "../icon"; import { Icon } from "../icon"; -interface UpdateButtonProps { +interface UpdateButtonProps extends HTMLAttributes { warningLevel?: "light" | "medium" | "high"; update: () => void; } -export function UpdateButton({ warningLevel, update }: UpdateButtonProps) { - const id = uniqueId("update_button_"); +export function UpdateButton({ warningLevel, update, id }: UpdateButtonProps) { + const buttonId = id ?? "update-lens-button"; const menuIconProps: IconProps = { material: "update", small: true }; const [opened, setOpened] = useState(false); @@ -42,7 +42,7 @@ export function UpdateButton({ warningLevel, update }: UpdateButtonProps) { <>