From c2cd76f54df3e1eddccf83ba20008108cd97b8b5 Mon Sep 17 00:00:00 2001 From: HF Date: Mon, 5 Feb 2024 12:20:04 +0100 Subject: [PATCH] align templates with other elements --- src/components/TemplateSettings.jsx | 148 ++++++++++++++-------------- 1 file changed, 73 insertions(+), 75 deletions(-) diff --git a/src/components/TemplateSettings.jsx b/src/components/TemplateSettings.jsx index d23a2559..545393b8 100644 --- a/src/components/TemplateSettings.jsx +++ b/src/components/TemplateSettings.jsx @@ -96,85 +96,83 @@ const TemplateSettings = () => {
-
- {list.map(({ - enabled, imageId, canvasId, title, x, y, width, height, - }, index) => (editingIndices.includes(index) ? ( - - ) : ( - - )))} - {showAdd && } - {(showAdd) ? ( - close()} - > {t`Cancel adding Template`} - ) : ( - setShowAdd(true)} - > {t`Add Template`} - )} - {(list.some((z) => z.enabled)) && ( - -  |  - { - const data = await templateLoader.exportEnabledTemplates(); - if (data) { - fileDownload( - JSON.stringify(data), 'PixelplanetTemplates.json', - ); - } - }} - >{t`Export enabled templates`} - - )} -  |  + {list.map(({ + enabled, imageId, canvasId, title, x, y, width, height, + }, index) => (editingIndices.includes(index) ? ( + + ) : ( + + )))} + {showAdd && } + {(showAdd) ? ( importRef.current?.click()} - >{t`Import templates`} - { - templateLoader.importTemplates(evt.target.files?.[0]); - }} - /> -
+ onClick={() => close()} + > {t`Cancel adding Template`} + ) : ( + setShowAdd(true)} + > {t`Add Template`} + )} + {(list.some((z) => z.enabled)) && ( + +  |  + { + const data = await templateLoader.exportEnabledTemplates(); + if (data) { + fileDownload( + JSON.stringify(data), 'PixelplanetTemplates.json', + ); + } + }} + >{t`Export enabled templates`} + + )} +  |  + importRef.current?.click()} + >{t`Import templates`} + { + templateLoader.importTemplates(evt.target.files?.[0]); + }} + /> ); };