Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Favicon ENV #3

Merged
merged 4 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions web/.env

This file was deleted.

7 changes: 6 additions & 1 deletion web/.env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# BRANDING

VITE_FAVICON_PATH=/favicon.png
VITE_LOGO_PATH=/gpt-logo-white-transparent.svg
VITE_BACKGROUND_PATH=/gpt-background.jpg
VITE_BACKGROUND_PATH=/gpt-background.jpg

# OTHER

VITE_SYMBOL=ETH
2 changes: 2 additions & 0 deletions web/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ dist-ssr
*.njsproj
*.sln
*.sw?

.env
3 changes: 1 addition & 2 deletions web/index.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Svelte</title>
</head>
Expand Down
3 changes: 3 additions & 0 deletions web/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
import 'animate.css';
import 'bulma/css/bulma.css';
import Faucet from './Faucet.svelte';

const faviconPath = import.meta.env.VITE_FAVICON_PATH
</script>

<svelte:head>
<link
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
rel="stylesheet"
/>
<link rel="icon" type="image/png" href="{faviconPath}" />
</svelte:head>

<Faucet />
4 changes: 3 additions & 1 deletion web/src/Faucet.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
import { CloudflareProvider } from '@ethersproject/providers';
import { setDefaults as setToast, toast } from 'bulma-toast';

const symbol = import.meta.env.VITE_SYMBOL

let input = null;
let faucetInfo = {
account: '0x0000000000000000000000000000000000000000',
network: 'testnet',
payout: 1,
symbol: 'ETH',
symbol: symbol,
hcaptcha_sitekey: '',
};

Expand Down
2 changes: 2 additions & 0 deletions web/src/env/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
interface ImportMetaEnv {
readonly VITE_LOGO_PATH: string;
readonly VITE_BACKGROUND_PATH: string;
readonly VITE_FAVICON_PATH: string;
readonly VITE_SYMBOL: string;
}

interface ImportMeta {
Expand Down
Loading