From 72dcaa0f7e298028876cee4e6f5854c9ef821cee Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Wed, 1 Oct 2025 16:17:50 +0800 Subject: [PATCH 1/4] Removed unused files --- astro.config.mjs | 30 ------------------------------ src/utils/js/generateFavicon.js | 17 ----------------- 2 files changed, 47 deletions(-) delete mode 100644 astro.config.mjs delete mode 100644 src/utils/js/generateFavicon.js 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/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 From a31e7a59b3cbbed54e79aaa3a75251647b27b480 Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Wed, 1 Oct 2025 16:18:08 +0800 Subject: [PATCH 2/4] Comment out unused function --- src/utils/functions/generateFavicon.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/utils/functions/generateFavicon.ts 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 From 3022a084bea0f32a69d925f84be0a792a5dd4396 Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Wed, 1 Oct 2025 16:18:36 +0800 Subject: [PATCH 3/4] Added function on modal button --- src/components/Modal/ModalButton.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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) => { - - - - - - + + + + + + + + + + + ))}