Skip to content

Commit

Permalink
updt: dev environtment and production environtment
Browse files Browse the repository at this point in the history
  • Loading branch information
hudaputrasantosa committed Mar 31, 2024
1 parent 111254d commit 0a6c72c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 17 deletions.
7 changes: 7 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
VITE_REACT_API_KEY=
VITE_REACT_AUTH_DOMAIN=
VITE_REACT_PROJECT_ID=
VITE_REACT_STORAGE_BUCKET=
VITE_REACT_MESSAGE_SENDER_ID=
VITE_REACT_ID=
VITE_REACT_MEASUREMENT_ID=
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ env:
jobs:
# Single deploy job since we're just deploying
deploy:
environment:
environment: production
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
Expand Down
22 changes: 7 additions & 15 deletions src/helpers/VisitorCounter.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,20 @@ import { getFirestore } from "firebase/firestore";

// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
// const apiKey = import.meta.env.REACT_APP_API_KEY;
// const authDomain = import.meta.env.REACT_APP_AUTH_DOMAIN;
// const projectId = import.meta.env.REACT_APP_PROJECT_ID;
// const storageBucket = import.meta.env.REACT_APP_STORAGE_BUCKET;
// const messagingSenderId = import.meta.env.REACT_APP_MESSAGE_SENDER_ID;
// const appId = import.meta.env.REACT_APP_ID;
// const measurementId = import.meta.env.REACT_APP_MEASUREMENT_ID;

const firebaseConfig = {
apiKey: "AIzaSyAkC1sjCaxombGRV69tK7SorH2vI08memw",
authDomain: "counter-page-6279b.firebaseapp.com",
projectId: "counter-page-6279b",
storageBucket: "counter-page-6279b.appspot.com",
messagingSenderId: "761417323989",
appId: "1:761417323989:web:b781e8fb4e6b49156c595c",
measurementId: "G-5CDK9SRB5W",
apiKey: import.meta.env.VITE_REACT_API_KEY,
authDomain: import.meta.env.VITE_REACT_AUTH_DOMAIN,
projectId: import.meta.env.VITE_REACT_PROJECT_ID,
storageBucket: import.meta.env.VITE_REACT_STORAGE_BUCKET,
messagingSenderId: import.meta.env.VITE_REACT_MESSAGE_SENDER_ID,
appId: import.meta.env.VITE_REACT_ID,
measurementId: import.meta.env.VITE_REACT_MEASUREMENT_ID,
};

// Initialize Firebase
const app = initializeApp(firebaseConfig);
const db = getFirestore(app);
// initializeApp(firebaseConfig);
// const analytics = getAnalytics(app);

export default db;
2 changes: 1 addition & 1 deletion src/pages/About/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { doc, getDoc, updateDoc } from "firebase/firestore";
import db from "../../helpers/VisitorCounter";

const About = () => {
const [visitor, setVisitor] = useState(0);
const [visitor, setVisitor] = useState();

useEffect(() => {
const docRef = doc(db, "portofolio", "visitor");
Expand Down

0 comments on commit 0a6c72c

Please sign in to comment.