Skip to content
Open
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
20 changes: 20 additions & 0 deletions .codesandbox/workspace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"responsive-preview": {
"Mobile": [
320,
675
],
"Tablet": [
1024,
765
],
"Desktop": [
1400,
800
],
"Desktop HD": [
1920,
1080
]
}
}
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"production": [">0.2%", "not dead", "not op_mini all"],
"development": [
"last 1 chrome version",
"last 1 firefox version",
Expand Down
9 changes: 6 additions & 3 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link href="https://fonts.googleapis.com/css?family=Nanum+Gothic&display=swap" rel="stylesheet">
<link
href="https://fonts.googleapis.com/css?family=Nanum+Gothic&display=swap"
rel="stylesheet"
/>
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
Expand All @@ -25,10 +28,10 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>GYMium</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<noscript>Find Your Fit</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
Expand Down
20 changes: 10 additions & 10 deletions src/components/Copyright/index.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React from 'react';
import Typography from '@material-ui/core/Typography';
import React from "react";
import Typography from "@material-ui/core/Typography";

function Copyright() {
return (
<Typography variant="body2" color="textSecondary" align="center">
{'Created by © Sander de Bruijn '}
{new Date().getFullYear()}
{'.'}
</Typography>
);
return (
<Typography variant="body2" color="textSecondary" align="center">
{"Created by © Akarsh, Devesh, Punit "}
{new Date().getFullYear()}
{"."}
</Typography>
);
}

export default Copyright;
export default Copyright;
84 changes: 41 additions & 43 deletions src/components/Firebase/firebase.js
Original file line number Diff line number Diff line change
@@ -1,50 +1,48 @@
import app from 'firebase/app';
import 'firebase/auth';
import 'firebase/database';
import app from "firebase/app";
import "firebase/auth";
import "firebase/database";

const config = {
apiKey: "AIzaSyCfsvXKJguArR_axE1-806BgdPhfyW1c90",
authDomain: "workout-tracker-a7ac5.firebaseapp.com",
databaseURL: "https://workout-tracker-a7ac5.firebaseio.com",
projectId: "workout-tracker-a7ac5",
storageBucket: "workout-tracker-a7ac5.appspot.com",
messagingSenderId: "32174510048",
appId: "1:32174510048:web:a1305976bd438222402585"
apiKey: "AIzaSyCB7o_9eBk_8WhKFzBKZheHTa434laQcXY",
authDomain: "gymium.firebaseapp.com",
databaseURL: "https://gymium-default-rtdb.firebaseio.com",
projectId: "gymium",
storageBucket: "gymium.appspot.com",
messagingSenderId: "398955724572",
appId: "1:398955724572:web:12caf11fdfab3909f444d9"
};

class Firebase {
constructor() {
app.initializeApp(config);
this.auth = app.auth();
this.db = app.database();
}

/*** Authentication ***/
doCreateUserWithEmailAndPassword = (email, password) =>
this.auth.createUserWithEmailAndPassword(email, password);

doSignInWithEmailAndPassword = (email, password) =>
this.auth.signInWithEmailAndPassword(email, password);

doSignOut = () =>
this.auth.signOut();

doPasswordReset = email =>
this.auth.sendPasswordResetEmail(email);

/*** Database ***/
user = uid => this.db.ref(`users/${uid}`);
users = () => this.db.ref('users');

addActivity = (uid, activity) => {
const ref = this.db.ref().child(`users/${uid}/activities`);
ref.push(activity);
};

updateActivity = (uid, activity, activityKey) => {
const ref = this.db.ref().child(`users/${uid}/activities/${activityKey}`);
ref.update(activity);
}
constructor() {
app.initializeApp(config);
this.auth = app.auth();
this.db = app.database();
}

/*** Authentication ***/
doCreateUserWithEmailAndPassword = (email, password) =>
this.auth.createUserWithEmailAndPassword(email, password);

doSignInWithEmailAndPassword = (email, password) =>
this.auth.signInWithEmailAndPassword(email, password);

doSignOut = () => this.auth.signOut();

doPasswordReset = (email) => this.auth.sendPasswordResetEmail(email);

/*** Database ***/
user = (uid) => this.db.ref(`users/${uid}`);
users = () => this.db.ref("users");

addActivity = (uid, activity) => {
const ref = this.db.ref().child(`users/${uid}/activities`);
ref.push(activity);
};

updateActivity = (uid, activity, activityKey) => {
const ref = this.db.ref().child(`users/${uid}/activities/${activityKey}`);
ref.update(activity);
};
}

export default Firebase;
export default Firebase;
20 changes: 10 additions & 10 deletions src/config/theme.config.jsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { createMuiTheme } from '@material-ui/core/styles';
import { createMuiTheme } from "@material-ui/core/styles";

const theme = createMuiTheme({
typography: {
fontFamily: 'Nanum Gothic',
fontFamily: "Nanum Gothic"
},
palette: {
primary: {
main: '#313131'
},
secondary: {
main: '#8ec5fc',
}
},
primary: {
main: "#313131"
},
secondary: {
main: "#8ec5fc"
}
}
});

export default theme;
export default theme;