diff --git a/astro.config.mjs b/astro.config.mjs deleted file mode 100644 index bd17d8e..0000000 --- a/astro.config.mjs +++ /dev/null @@ -1,30 +0,0 @@ -// @ts-check -import { defineConfig } from 'astro/config' -import solidJs from '@astrojs/solid-js' -import compressor from 'astro-compressor' -import robotsTxt from '@itsmatteomanf/astro-robots-txt' -import purgecss from 'astro-purgecss' - -export default defineConfig({ - output: 'static', - prefetch: true, - integrations: [ - solidJs(), - compressor({ gzip: false, brotli: true }), - robotsTxt(), - purgecss({ - fontFace: true, - variables: true, - }), - ], - vite: { - css: { - transformer: 'lightningcss', - }, - }, - build: { - assets: '_fwt', - inlineStylesheets: 'never', - }, - site: 'http://localhost:4321', -}) diff --git a/src/components/Modal/ModalButton.tsx b/src/components/Modal/ModalButton.tsx index 7153a17..ac5ff10 100644 --- a/src/components/Modal/ModalButton.tsx +++ b/src/components/Modal/ModalButton.tsx @@ -14,12 +14,16 @@ interface Props { width?: number wide?: boolean class?: string + function?: () => Promise } export default (props: Props) => { const [isOpen, setIsOpen] = createSignal(false) - const openHandler = () => { + const openHandler = async () => { + if (props.function) { + await props.function() + } setIsOpen(true) } @@ -32,6 +36,7 @@ export default (props: Props) => { - - - - - - + + + + + + + + + + + ))} diff --git a/src/utils/functions/generateFavicon.ts b/src/utils/functions/generateFavicon.ts new file mode 100644 index 0000000..48c11a6 --- /dev/null +++ b/src/utils/functions/generateFavicon.ts @@ -0,0 +1,17 @@ +// import sharp from 'sharp' + +// import * as path from 'path' + +// const generateFavicon = async () => { +// const inputSrc = 'src/assets/images/logo.png' +// const faviconPath = path.join(__dirname, '../public/favicon.png') + +// try { +// await sharp(inputSrc).png({ quality: 90 }).resize(50).toFile(faviconPath) +// console.log('Favicon generated successfully') +// } catch (error) { +// console.error('Error generating favicon:', error) +// } +// } + +// export default generateFavicon diff --git a/src/utils/js/generateFavicon.js b/src/utils/js/generateFavicon.js deleted file mode 100644 index 4b7924d..0000000 --- a/src/utils/js/generateFavicon.js +++ /dev/null @@ -1,17 +0,0 @@ -import sharp from 'sharp' - -const path = require('path') - -const generateFavicon = async () => { - const inputSrc = 'src/assets/images/logo.png' - const faviconPath = path.join(__dirname, '../public/favicon.png') - - try { - await sharp(inputSrc).png({ quality: 90 }).resize(50).toFile(faviconPath) - console.log('Favicon generated successfully') - } catch (error) { - console.error('Error generating favicon:', error) - } -} - -export default generateFavicon