-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
useDevice hook #151
Comments
Good shout, will be in the next release! |
I'm not sure what you're referring to by the header actions though - however I've refactored the Modal to use the |
Given the following code: const Separator = styled.div`
height: 30px;
width: 1px;
background-color: var(--ha-S400);
`;
return (
<ErrorBoundary {...fallback({ prefix: 'UpdateCard' })}>
<Modal
id={useId()}
open={open}
onClose={() => setOpen(false)}
title={
entity.attributes.title || entity.attributes.friendly_name || `Update for ${entityId}`
}
headerActions={() => (
<>
{device && device.device_id && (
<FabCard
title="Open Device"
tooltipPlacement="left"
icon="mdi:cog"
size={30}
onClick={openDevice}
/>
)}
{device && device.device_id && <Separator />}
</>
)}
>
<Column fullWidth fullHeight gap="1rem">
<Row fullWidth>
// ... I want to include my own modal, with my own content. Basically, what I am saying is: I want the header (actions) of |
This is locally I assume? Or am I missing a branch / PR somewhere? |
Yes sorry, it's not deployed yet! Gotcha, I'll have a think about the Modal changes you're after and see how we can achieve something more dynamic! I am off for the day now but will most likely release this early tomorrow! |
FYI - I've changed the |
I would like to request a
useDevice
hook.Currently there is already a
useLowDevices
hook but that serves a completely different purpose.The reason I am requesting this, is because I've built my own custom "update card"; whether an update is available or not.
From that card, I open a modal where I display detailed information, such as current and latest versions.
For the header actions, I would like to have the "view device" action in there, similar to what you have in the
ModalByDomain
.However, I have to recreate the hook that you create in there, in order to use it.
So while typing, I think the request should be two fold, and perhaps this issue should be split up;
useDevice
hook.Something along the lines of this, but then it would also need some
Props
that can be passed along to the message.And the correlating story for Storybook etc..
The text was updated successfully, but these errors were encountered: