Skip to content

Commit

Permalink
😅💈 ↣ Removing magical element seen in [#1] [HDASH-4 & HDASH-5], focus…
Browse files Browse the repository at this point in the history
…ing on this in signal-k/theclub repo
  • Loading branch information
Gizmotronn committed Oct 29, 2022
1 parent 9356d8c commit 062714e
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 174 deletions.
65 changes: 0 additions & 65 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,12 @@
import React, { useState, useEffect, useContext } from 'react';
import './App.css';

import { Switch, Route, BrowserRouter as Router } from "react-router-dom";
//import SignIn from './pages/Signin';

/* Eth Providers
import { createClient, configureChains, defaultChains, WagmiConfig } from 'wagmi';
import { publicProvider } from 'wagmi/providers/public';
import { SessionProvider } from 'next-auth/react'; */

// Sass components
import Body from './components/Body Section/Body';

// Menu components
import Sidebar from './components/SideBar Section/Sidebar';

// Magic
import { magic } from './lib/magic';
import { loadStripe } from "@stripe/stripe-js";
import { Elements } from "@stripe/react-stripe-js";
import { UserContext } from "./lib/UserContext";

// Magic UI components
import Layout from './components/layout';
import PaymentForm from './components/payment-form';
import Payment from './components/payment';
import Login from './components/login';

// Magic promises
const promise = loadStripe("pk_test_51L1UB5EXgarheYLkmZE9jqvsPe0d5UjoH2aZJvrIv6W55J0HEsQHE6wmJtXRSRMI4GulhzAetAxQE1yiVi2XvYVO00khAvACG1");

/* If isLoggedIn is true, set the UserContext with user data -> Otherwise, set it to {user: null}
useEffect(() => {
setUser({ loading: true });
magic.user.isLoggedIn().then(isLoggedIn => {
return isLoggedIn ? magic.user.getMetadata().then(userData => setUser(userData)) : setUser({ user: null });
});
}, []); */

function App() {
/*const [currentTime, setCurrentTime] = useState(0);
const [planetTitle, setPlanetTitle] = useState('')
Expand All @@ -55,40 +24,6 @@ function App() {
setPlanetTitle(data.title);
});
}, [])*/
// Create a hook to check whether or not user has lifetime acess
const [lifetimeAccess, setLifetimeAccess] = useState(false);
// Create a hook to prevent infinite loop in useEffect inside of /components/premium-content
const [
lifetimeAccessRequestStatus,
setLifetimeAccessRequestStatus,
] = useState("");
// Create a hook to help us determine whether or not the user is logged in
const [user, setUser] = useState();

// If isLoggedIn is true, set the UserContext with user data
// Otherwise, set it to {user: null}
useEffect(() => {
setUser({ loading: true });
magic.user.isLoggedIn().then((isLoggedIn) => {
return isLoggedIn
? magic.user.getMetadata().then((userData) => setUser(userData))
: setUser({ user: null });
});
}, []);

<Router>
<Switch>
<UserContext.Provider value={[user, setUser]}>
<Layout>
<Route path="/" exact component={App} />
<Route path="/login" component={Login} />
<Route path="/profile" component={Profile} />
<Route path="/callback" component={Callback} />
</Layout>
</UserContext.Provider>
</Switch>
</Router>

return (
/*<div className='App'>
<header className='App-header'>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/components/login.js → src/components/auth/login.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState, useEffect, useContext } from "react";
import { useHistory } from "react-router-dom";
import { magic } from "../lib/magic";
import { UserContext } from "../lib/UserContext";
import { magic } from "../../lib/magic";
import { UserContext } from "../../lib/UserContext";
import LoginForm from "./login-form";

const Login = () => {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useContext, useEffect } from "react";
import { useHistory } from "react-router";
import { UserContext } from "../lib/UserContext";
import { UserContext } from "../../lib/UserContext";
import Loading from "./loading";

export default function Payment({ Elements, PaymentForm, promise }) {
Expand Down
106 changes: 0 additions & 106 deletions src/components/header.js

This file was deleted.

0 comments on commit 062714e

Please sign in to comment.