0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2024-12-22 21:53:27 -05:00
penpot-exporter-figma-plugin/ui-src/components/PluginReload.tsx
Jordi Sala Morales 4b711b3526
Refactor context (#139)
* Refactor context

* fix

* fix
2024-06-04 18:02:59 +02:00

25 lines
712 B
TypeScript

import { Banner, Button, IconInfo32 } from '@create-figma-plugin/ui';
import { Stack } from '@ui/components/Stack';
import { useFigmaContext } from '@ui/context';
export const PluginReload = () => {
const { reload, cancel } = useFigmaContext();
return (
<Stack space="small">
<Banner icon={<IconInfo32 />}>
Changes detected. Please reload the plug-in to ensure all modifications are included in the
exported file.
</Banner>
<Stack space="xsmall" direction="row">
<Button onClick={reload} fullWidth>
Reload
</Button>
<Button secondary onClick={cancel} fullWidth>
Cancel
</Button>
</Stack>
</Stack>
);
};