Skip to content

Commit 0c9b3a8

Browse files
committed
Add support email config
1 parent 11daa0f commit 0c9b3a8

File tree

6 files changed

+41
-10
lines changed

6 files changed

+41
-10
lines changed

.github/workflows/jekyll-gh-pages.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ jobs:
3939
run: npm ci
4040
- name: Build
4141
run: npm run build
42+
env:
43+
VITE_SUPPORT_EMAIL: ${{ secrets.SUPPORT_EMAIL }}
4244
- name: Setup Pages
4345
uses: actions/configure-pages@v5
4446
- name: Upload artifact

package-lock.json

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
},
2929
"devDependencies": {
3030
"@eslint/js": "^9.26.0",
31+
"@types/node": "^22.15.30",
3132
"@types/react": "^19.1.2",
3233
"@types/react-dom": "^19.1.2",
3334
"@vitejs/plugin-react": "^4.4.1",

src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,14 @@ export default function Home() {
156156
</a>
157157
<a
158158
className="flex items-center gap-2 hover:underline hover:underline-offset-4"
159-
href="https://github.com/Minimuino/galiguessr"
159+
href={`mailto:${import.meta.env.VITE_SUPPORT_EMAIL}`}
160160
target="_blank"
161161
rel="noopener"
162162
>
163163
<img
164164
aria-hidden
165165
src="./email.svg"
166-
alt="Error icon"
166+
alt="Email icon"
167167
width={18}
168168
height={16}
169169
/>

src/components/MapView.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ export default function MapView({ data, pendingGuessFeatures, rightGuessFeatures
8787
const onTouchEnd = (event: MapLayerTouchEvent) => {
8888
const { target } = event;
8989
if (timeoutRef.current) {
90-
clearTimeout(timeoutRef.current);
90+
window.clearTimeout(timeoutRef.current);
9191
}
92-
timeoutRef.current = setTimeout(() => {
92+
timeoutRef.current = window.setTimeout(() => {
9393
if (hoveredFeatureId.current) {
9494
target.setFeatureState(
9595
{ source: "hoverable", id: hoveredFeatureId.current },
@@ -103,7 +103,7 @@ export default function MapView({ data, pendingGuessFeatures, rightGuessFeatures
103103
useEffect(() => {
104104
return () => {
105105
if (timeoutRef.current) {
106-
clearTimeout(timeoutRef.current);
106+
window.clearTimeout(timeoutRef.current);
107107
}
108108
};
109109
}, []);

vite.config.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,20 @@
66
*/
77

88
import react from "@vitejs/plugin-react";
9-
import { defineConfig } from "vite";
9+
import { defineConfig, loadEnv } from "vite";
1010

1111
// https://vite.dev/config/
12-
export default defineConfig({
13-
plugins: [react()],
14-
base: "/galiguessr/",
15-
});
12+
export default defineConfig(({ mode }) => {
13+
14+
const env = loadEnv(mode, process.cwd(), "VITE_");
15+
16+
return {
17+
plugins: [react()],
18+
base: "/galiguessr/",
19+
define: {
20+
"process.env": {
21+
VITE_SUPPORT_EMAIL: JSON.stringify(env.VITE_SUPPORT_EMAIL),
22+
},
23+
},
24+
};
25+
});

0 commit comments

Comments
 (0)