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

New hotbar and bug fixing #23

Merged
merged 25 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7bd27bb
removed unnused imports
Rodriguespn Jan 9, 2024
0fd1139
resolve merge conflicty
Rodriguespn Jan 11, 2024
e2be491
resolve merge conflict
Rodriguespn Jan 11, 2024
1d65048
fixed spell errors on README
Rodriguespn Jan 11, 2024
01d4474
searchbar with logo and footer v1.0
Rodriguespn Jan 11, 2024
2d8b999
aligned logo with search buttons and minor styling fixes
Rodriguespn Jan 11, 2024
c8e59ba
changed analyze text, added icons to the buttons and text to footer
Rodriguespn Jan 11, 2024
b9643e4
fixed footer margins
Rodriguespn Jan 11, 2024
a1d4e26
solved conflict issues
Rodriguespn Jan 14, 2024
aee2967
removed unused imports and comments unused variables
Rodriguespn Jan 14, 2024
cb2a438
Merge branch 'main' of github.com:WardAnalytics/WardGraph
Rodriguespn Jan 14, 2024
6fe29df
removed unused imports and comments unused variables
Rodriguespn Jan 14, 2024
da0d19b
Merge branch 'main' of github.com:WardAnalytics/WardGraph
Rodriguespn Jan 15, 2024
82c44ef
resolved merge conflicts and firebase hosting setup
Rodriguespn Jan 15, 2024
c0fbb4d
Feature/landing page (#5)
Rodriguespn Jan 15, 2024
3bee18f
Merge branch 'development' of github.com:WardAnalytics/WardGraph into…
Rodriguespn Jan 15, 2024
63ab775
Merge branch 'main' of github.com:WardAnalytics/WardGraph
Rodriguespn Jan 15, 2024
d928bc3
resolved merge conflicts
Rodriguespn Jan 15, 2024
b66255e
Initial deployment graph app (#7)
Rodriguespn Jan 15, 2024
9d365a4
Merge branch 'development' of github.com:WardAnalytics/WardGraph into…
Rodriguespn Jan 15, 2024
8f856e9
Feature/firebase (#9)
Rodriguespn Jan 15, 2024
f121d1b
Configure github actions to PR and main merge (#13)
Rodriguespn Jan 15, 2024
920dc76
Feature/firebase (#15)
Rodriguespn Jan 15, 2024
6a89337
New hotbar and bug fixing (#22)
Rodriguespn Jan 15, 2024
11cad36
Merge branch 'main' into development
Rodriguespn Jan 15, 2024
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
12 changes: 11 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
VITE_WARD_API_BASE_URL=https://wardanalyticsapi.com
VITE_WARD_API_KEY=
VITE_WARD_API_KEY=

# Firebase config
VITE_FIREBASE_API_KEY=
VITE_FIREBASE_AUTH_DOMAIN=
VITE_FIREBASE_PROJECT_ID=
VITE_FIREBASE_STORAGE_BUCKET=
VITE_FIREBASE_MESSAGING_SENDER_ID=
VITE_FIREBASE_APP_ID=
# For Google Analytics
VITE_FIREBASE_MEASUREMENT_ID=
33 changes: 33 additions & 0 deletions .github/workflows/firebase-dev-hosting-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Configuration for deploying to production on merge to development
# For more information, see https://github.com/marketplace/actions/deploy-to-firebase-hosting#options

name: Deploy to Firebase Dev Hosting on merge
"on":
push:
branches:
- development

env:
VITE_WARD_API_BASE_URL: "https://wardanalyticsapi.com"
VITE_WARD_API_KEY: ${{ secrets.WARD_API_KEY }}
VITE_FIREBASE_API_KEY: "AIzaSyBZCnEQus6G42SodGNRf6o2zmBnGN0nXes"
VITE_FIREBASE_AUTH_DOMAIN: "graphapp-dev.firebaseapp.com"
VITE_FIREBASE_PROJECT_ID: "graphapp-dev"
VITE_FIREBASE_STORAGE_BUCKET: "graphapp-dev.appspot.com"
VITE_FIREBASE_MESSAGING_SENDER_ID: "897485812844"
VITE_FIREBASE_APP_ID: "1:897485812844:web:039de3b976c1559fded449"
# For Google Analytics
VITE_FIREBASE_MEASUREMENT_ID: "G-V2S9JPMH7S"

jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: yarn install && yarn build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_GRAPHAPP_DEV }}"
channelId: live
projectId: graphapp-dev
23 changes: 18 additions & 5 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools
# Configuration for deploying to production on merge to main
# For more information, see https://github.com/marketplace/actions/deploy-to-firebase-hosting#options

name: Deploy to Firebase Hosting on merge
'on':
"on":
push:
branches:
- main

env:
VITE_WARD_API_BASE_URL: https://wardanalyticsapi.com
VITE_WARD_API_KEY: ${{ secrets.WARD_API_KEY }}
VITE_FIREBASE_API_KEY: AIzaSyD1LUGU2RM-bhxKgeYdnzItbwBC0VSTOV0
VITE_FIREBASE_AUTH_DOMAIN: graphapp-bca04.firebaseapp.com
VITE_FIREBASE_PROJECT_ID: graphapp-bca04
VITE_FIREBASE_STORAGE_BUCKET: graphapp-bca04.appspot.com
VITE_FIREBASE_MESSAGING_SENDER_ID: "1030502540585"
VITE_FIREBASE_APP_ID: "1:1030502540585:web:cfe727695aad44d0494338"
# For Google Analytics
VITE_FIREBASE_MEASUREMENT_ID: G-RYB03B2Q13

jobs:
build_and_deploy:
runs-on: ubuntu-latest
Expand All @@ -14,7 +27,7 @@ jobs:
- run: yarn install && yarn build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_GRAPHAPP_BCA04 }}'
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_GRAPHAPP_BCA04 }}"
channelId: live
projectId: graphapp-bca04
21 changes: 19 additions & 2 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools
# Configuration for deploy a preview of the PR to a temporary url
# The goal is to be able to test the PR before merging it
# This action is triggered on every PR, regardless of the branch
# The preview url has a lifetime of 7 days
# For more information, see https://github.com/marketplace/actions/deploy-to-firebase-hosting#options

name: Deploy to Firebase Hosting on PR
"on": pull_request

env:
VITE_WARD_API_BASE_URL: "https://wardanalyticsapi.com"
VITE_WARD_API_KEY: ${{ secrets.WARD_API_KEY }}
VITE_FIREBASE_API_KEY: "AIzaSyD1LUGU2RM-bhxKgeYdnzItbwBC0VSTOV0"
VITE_FIREBASE_AUTH_DOMAIN: "graphapp-bca04.firebaseapp.com"
VITE_FIREBASE_PROJECT_ID: "graphapp-bca04"
VITE_FIREBASE_STORAGE_BUCKET: "graphapp-bca04.appspot.com"
VITE_FIREBASE_MESSAGING_SENDER_ID: "1030502540585"
VITE_FIREBASE_APP_ID: "1:1030502540585:web:cfe727695aad44d0494338"
# For Google Analytics
VITE_FIREBASE_MEASUREMENT_ID: "G-RYB03B2Q13"

jobs:
build_and_preview:
if: "${{ github.event.pull_request.head.repo.full_name == github.repository }}"
Expand All @@ -14,4 +30,5 @@ jobs:
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_GRAPHAPP_BCA04 }}"
expires: 7d
projectId: graphapp-bca04
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ dist-ssr
build
*.local
.env
.env.development
.env.test
.env.production

# Yarn installation state file
.yarn/install-state.gz

# Firebase
.firebase/*
firebase.json
.firebaserc

# Editor directories and files
Expand Down
16 changes: 16 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"hosting": {
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
1 change: 1 addition & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { QueryClientProvider } from 'react-query'

import Routes from './Routes';
import useCustomQueryClient from './hooks/useCustomQueryClient';
import './firebase/firebase'

function App() {
const queryClient = useCustomQueryClient()
Expand Down
17 changes: 14 additions & 3 deletions src/components/Graph/Graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ import Legend from "./Legend";
import TransactionTooltip, {
TransactionTooltipProps,
} from "./TransactionTooltip";
import { default as firebase } from "../../firebase/firebase"
import { logEvent } from "firebase/analytics";

/* Pan on drag settings */
const panOnDrag = [1, 2];
Expand Down Expand Up @@ -531,6 +533,17 @@ const Graph: FC = () => {
}
}, []);

const onSetSearchedAddress = (newAddress: string) => {
setSearchedAddresses([newAddress]);

logEvent(firebase.analytics, "search_address", {
address: newAddress,
});

console.log("Searched address: ", newAddress);
console.log(firebase.analytics)
}

return (
<div className="h-full w-full overflow-hidden">
<Transition
Expand All @@ -542,9 +555,7 @@ const Graph: FC = () => {
className="fixed flex h-full w-full flex-col items-center justify-center"
>
<LandingPage
setSearchedAddress={(address: string) => {
setSearchedAddresses([address]);
}}
setSearchedAddress={onSetSearchedAddress}
/>
</Transition>
<Transition
Expand Down
32 changes: 32 additions & 0 deletions src/firebase/firebase.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Import the functions you need from the SDKs you need
import { Analytics, getAnalytics } from "firebase/analytics";
import { FirebaseApp, initializeApp } from "firebase/app";

const {
VITE_FIREBASE_API_KEY: apiKey,
VITE_FIREBASE_AUTH_DOMAIN: authDomain,
VITE_FIREBASE_PROJECT_ID: projectId,
VITE_FIREBASE_STORAGE_BUCKET: storageBucket,
VITE_FIREBASE_MESSAGING_SENDER_ID: messagingSenderId,
VITE_FIREBASE_APP_ID: appId,
VITE_FIREBASE_MEASUREMENT_ID: measurementId,
} = import.meta.env;

const firebaseConfig = {
apiKey: apiKey,
authDomain: authDomain,
projectId: projectId,
storageBucket: storageBucket,
messagingSenderId: messagingSenderId,
appId: appId,
measurementId: measurementId,
};

// Initialize Firebase
const app: FirebaseApp = initializeApp(firebaseConfig);
const analytics: Analytics = getAnalytics(app);

export default {
app,
analytics,
};
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3007,7 +3007,7 @@ [email protected], find-up@^5.0.0:

firebase@^10.7.1:
version "10.7.1"
resolved "https://registry.npmjs.org/firebase/-/firebase-10.7.1.tgz"
resolved "https://registry.yarnpkg.com/firebase/-/firebase-10.7.1.tgz#71fa17a10146f388746ecc216a3e1e477a7bf9b5"
integrity sha512-Mlt7y7zQ43FtKp4SCyYie3tnrOL3UMF2XXiV4ZXMrC0d0wtcOYmABuybhkJpJCKILpdekxr39wjnaai0DZlWFg==
dependencies:
"@firebase/analytics" "0.10.0"
Expand Down