Skip to content

Commit

Permalink
feat(project): add variable for GA
Browse files Browse the repository at this point in the history
  • Loading branch information
olga-jwp committed Jul 4, 2023
1 parent 4bb194d commit fa0e0d7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/firebase-live.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
- name: Build
env:
APP_PLAYER_LICENSE_KEY: ${{ secrets.PLAYER_LICENSE_KEY }}
APP_GOOGLE_SITE_VERIFICATION_ID: ${{ variables.GOOGLE_SITE_VERIFICATION_ID }}
run: yarn && MODE=demo yarn build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
Expand Down
18 changes: 13 additions & 5 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useEffect, useState } from 'react';
import { BrowserRouter, HashRouter } from 'react-router-dom';
import { Helmet } from 'react-helmet';

import QueryProvider from '#src/containers/QueryProvider/QueryProvider';
import '#src/screenMapping';
Expand Down Expand Up @@ -41,10 +42,17 @@ export default function App() {
const Router = import.meta.env.APP_PUBLIC_GITHUB_PAGES ? HashRouter : BrowserRouter;

return (
<QueryProvider>
<Router>
<Root />
</Router>
</QueryProvider>
<>
{import.meta.env.APP_GOOGLE_SITE_VERIFICATION_ID && (
<Helmet>
<meta name="google-site-verification" content={import.meta.env.APP_GOOGLE_SITE_VERIFICATION_ID} />
</Helmet>
)}
<QueryProvider>
<Router>
<Root />
</Router>
</QueryProvider>
</>
);
}
1 change: 1 addition & 0 deletions types/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ interface ImportMetaEnv {
readonly APP_GITHUB_PUBLIC_BASE_URL: string | undefined;
readonly APP_DEFAULT_LANGUAGE: string | undefined;
readonly APP_ENABLED_LANGUAGES: string | undefined;
readonly APP_GOOGLE_SITE_VERIFICATION_ID: string | undefined;
}

interface ImportMeta {
Expand Down

0 comments on commit fa0e0d7

Please sign in to comment.