-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 930b287
Showing
28 changed files
with
9,277 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
AUTH0_CLIENT_ID= | ||
AUTH0_CLIENT_SECRET= | ||
AUTH0_SCOPE= | ||
AUTH0_DOMAIN= | ||
AUTH0_REDIRECT_URI= | ||
AUTH0_LOGOUT_REDIRECT_URI= | ||
AUTH0_SESSION_SECRET= | ||
AUTH0_SESSION_COOKIE_TIME= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.now | ||
.env | ||
now.json | ||
firebase-secret.json | ||
.next | ||
.now | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react' | ||
|
||
const Footer = () => { | ||
return ( | ||
<div className='py-4 text-center bg-gray-400'> | ||
MyDailyStatus é um projeto criado durante o Fullstack Lab do DevPleno. | ||
<br /> | ||
Implementado por:{' '} | ||
<a href='https://linkedin.com/in/tuliofaria'>Tulio Faria</a> | ||
</div> | ||
) | ||
} | ||
export default Footer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react' | ||
import NavBar from './NavBar' | ||
|
||
const Header = () => { | ||
return ( | ||
<div className='bg-gray-200'> | ||
<h1> | ||
<img | ||
className='h-24 mx-auto py-4' | ||
src='/logo.png' | ||
alt='Olá FSL!' | ||
height='60' | ||
/> | ||
</h1> | ||
<NavBar /> | ||
</div> | ||
) | ||
} | ||
export default Header |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react' | ||
import Link from 'next/link' | ||
|
||
const NavLink = ({ href, children }) => { | ||
return ( | ||
<Link href={href}> | ||
<a className='p-2 hover:underline hover:text-red-800'>{children}</a> | ||
</Link> | ||
) | ||
} | ||
|
||
const NavBar = () => { | ||
return ( | ||
<div className='bg-gray-500 py-4 text-center'> | ||
<NavLink href='/sobre'>Sobre</NavLink> | ||
<NavLink href='/cadastro'>Cadastro</NavLink> | ||
<NavLink href='/entrar'>Entrar</NavLink> | ||
</div> | ||
) | ||
} | ||
export default NavBar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { initAuth0 } from '@auth0/nextjs-auth0' | ||
console.log(process.env) | ||
export default initAuth0({ | ||
clientId: process.env.AUTH0_CLIENT_ID, | ||
clientSecret: process.env.AUTH0_CLIENT_SECRET, | ||
scope: process.env.AUTH0_SCOPE, | ||
domain: process.env.AUTH0_DOMAIN, | ||
redirectUri: process.env.AUTH0_REDIRECT_URI, | ||
postLogoutRedirectUri: process.env.AUTH0_LOGOUT_REDIRECT_URI, | ||
session: { | ||
cookieSecret: process.env.AUTH0_SESSION_SECRET, | ||
cookieLifetime: process.env.AUTH0_SESSION_COOKIE_TIME | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const admin = require('firebase-admin') | ||
const secret = require('../firebase-secret.json') | ||
const { GeoFirestore } = require('geofirestore') | ||
|
||
if (!admin.apps.length) { | ||
admin.initializeApp({ | ||
credential: admin.credential.cert(secret) | ||
}) | ||
} | ||
|
||
const firestore = admin.firestore() | ||
const db = new GeoFirestore(firestore) | ||
|
||
module.exports = { | ||
db | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
//alert(calcCrow(59.3293371,13.4877472,59.3225525,13.4619422).toFixed(1)); | ||
|
||
// Converts numeric degrees to radians | ||
function toRad (Value) { | ||
return (Value * Math.PI) / 180 | ||
} | ||
|
||
//This function takes in latitude and longitude of two location and returns the distance between them as the crow flies (in km) | ||
export function distance (lat1, lon1, lat2, lon2) { | ||
var R = 6371 // km | ||
var dLat = toRad(lat2 - lat1) | ||
var dLon = toRad(lon2 - lon1) | ||
var lat1 = toRad(lat1) | ||
var lat2 = toRad(lat2) | ||
|
||
var a = | ||
Math.sin(dLat / 2) * Math.sin(dLat / 2) + | ||
Math.sin(dLon / 2) * Math.sin(dLon / 2) * Math.cos(lat1) * Math.cos(lat2) | ||
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)) | ||
var d = R * c | ||
return d | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
require('dotenv').config() | ||
|
||
module.exports = {} |
Oops, something went wrong.