Skip to content

Instantly share code, notes, and snippets.

View codebucks27's full-sized avatar
🎯
Focusing

CodeBucks codebucks27

🎯
Focusing
View GitHub Profile
import React,{useState} from "react";
import "./styles.css";
import styled from "styled-components";
const MenuLabel = styled.label`
background-color: #B6EDC8;
position: fixed;
top: 6rem;
right: 6rem;
@codebucks27
codebucks27 / GeoLocation.js
Created November 24, 2020 08:02
Medium Article GeoLocation --2
import React, { Component } from "react";
var options = {
enableHighAccuracy: true,
timeout: 5000,
maximumAge: 0,
};
function success(pos) {
var crd = pos.coords;
@codebucks27
codebucks27 / GeoLocation.js
Last active November 24, 2020 07:59
Medium Article GeoLocation -- 1
import React, { Component } from "react";
export default class GeoLocation extends Component {
componentDidMount() {
if (navigator.geolocation) {
navigator.permissions
.query({ name: "geolocation" })
.then(function (result) {
if (result.state === "granted") {
console.log(result.state);