Skip to content

Commit

Permalink
Merge branch 'main' into evelyn_branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavilien authored Nov 18, 2024
2 parents 0d86516 + b6f6c82 commit 4c4d409
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 5 deletions.
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"mapkit-react": "^1.14.1",
"million": "latest",
"netlify-plugin-mapkitjs-token": "^1.2.0",
"posthog-js": "^1.181.0",
"prettier-eslint": "^16.3.0",
"prettier-eslint-cli": "^8.0.1",
"react": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,5 @@ body {
font-size: 1.5em;
color: white;
text-align: center;
background-color: #007fff;
background-color: #00af00;
}
6 changes: 3 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ function App() {
<div className="AdBanner">
Pre-register for{' '}
<a
href="https://tartanhacks.com/"
href="https://go.scottylabs.org/tartanhacks-cmueats"
style={{ color: 'white' }}
>
<strong>TartanHacks (February 7-8, 2025)</strong>
<strong>TartanHacks</strong>
</a>
, CMU's Largest Hackathon! 🖥️
, Pittsburgh&apos;s LARGEST hackathon! 🖥️
</div>
<div className="MainContent">
<Routes>
Expand Down
10 changes: 9 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,22 @@ import React from 'react';
import { createRoot } from 'react-dom/client';
import './index.css';

import posthog from 'posthog-js';
import { PostHogProvider } from 'posthog-js/react';
import App from './App';

posthog.init(process.env.REACT_APP_PUBLIC_POSTHOG_KEY || '', {
person_profiles: 'identified_only',
});

const rootElement = document.getElementById('root');

if (rootElement) {
createRoot(rootElement).render(
<React.StrictMode>
<App />
<PostHogProvider client={posthog}>
<App />
</PostHogProvider>
</React.StrictMode>,
);
}
2 changes: 2 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export default defineConfig(({ command, mode }) => {
env.MAPKIT_JS_TOKEN_ENV_VARIABLE || 'MAPKIT_JS_TOKEN';
const ttl = +(env.MAPKIT_JS_TTL || 31_536_000); // 1 year
const origin = env.MAPKIT_JS_ORIGIN || env.DEPLOY_PRIME_URL;
const posthog = env.REACT_APP_PUBLIC_POSTHOG_KEY;

if (!teamId || !keyId || !authKey || !tokenEnvVariable || !ttl) {
console.error('Missing one or more .env variables! Make sure you have a .env file locally.');
Expand Down Expand Up @@ -96,6 +97,7 @@ export default defineConfig(({ command, mode }) => {
return {
define: {
'process.env.VITE_MAPKITJS_TOKEN': JSON.stringify(env[tokenEnvVariable]),
'process.env.REACT_APP_PUBLIC_POSTHOG_KEY': JSON.stringify(posthog),
},
plugins: [
million.vite({ auto: true }),
Expand Down

0 comments on commit 4c4d409

Please sign in to comment.