cleaning things up

This commit is contained in:
Arjun Patel
2022-01-13 18:12:43 -08:00
parent 6ac73c8c13
commit 9a945edd87
13 changed files with 186 additions and 247 deletions
+35
View File
@@ -0,0 +1,35 @@
import Head from "next/head"
export default function Layout({ children }) {
return (
<>
<Head>
<meta charSet="UTF-8" />
<title>nirvana</title>
<link rel="icon" href="/icon.png" />
{/* Google Fonts */}
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link
rel="preconnect"
href="https://fonts.gstatic.com"
crossOrigin="true"
/>
<link
href="https://fonts.googleapis.com/css2?family=Satisfy&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Baloo+Bhaijaan+2&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700" />
</Head>
<main>
{children}
</main>
</>
)
}
+1 -1
View File
@@ -1,6 +1,6 @@
import { getAuth, GoogleAuthProvider, onAuthStateChanged, signInWithPopup, signOut, User } from "firebase/auth";
import React, { useContext, useEffect, useState } from "react";
import firebase from '../services/firebase'
import firebase from '../services/firebaseService'
const AuthContext = React.createContext(null);
const googleProvider = new GoogleAuthProvider()
+8 -34
View File
@@ -2,42 +2,16 @@ import '../styles/globals.css'
import 'antd/dist/antd.css';
import Head from 'next/head'
import { AuthProvider } from '../contexts/authContext'
import SiteLayout from '../components/Layouts/SiteLayout'
function MyApp({ Component, pageProps }) {
return <>
<Head>
<meta name="description" content="Generated by create next app" />
<meta charSet="UTF-8" />
<title>nirvana</title>
<link rel="icon" href="/icon.png" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link
rel="preconnect"
href="https://fonts.gstatic.com"
crossOrigin="true"
/>
<link
href="https://fonts.googleapis.com/css2?family=Satisfy&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Baloo+Bhaijaan+2&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700" />
</Head>
<main>
<AuthProvider>
<Component {...pageProps} />
</AuthProvider>
</main>
</>
return (
<SiteLayout>
<AuthProvider>
<Component {...pageProps} />
</AuthProvider>
</SiteLayout>
)
}
export default MyApp
+1 -2
View File
@@ -1,6 +1,5 @@
import Head from 'next/head';
import Image from 'next/image';
import styles from '../styles/Home.module.css';
export default function Home() {
return (
@@ -12,7 +11,7 @@ export default function Home() {
<p>
tired of the rat race on{' '}
<font className='text-gray-300'>insta, tiktok, snap, &quot;meta&quot;...</font>?
<font className='text-gray-500'>insta, tiktok, snap, &quot;meta&quot;...</font>?
</p>
<p>
+8 -9
View File
@@ -75,18 +75,18 @@ export default function Dashboard() {
const { currUser, logOut } = useAuth()
const router = useRouter()
useEffect(() => {
// if not authenticated, take user to the login
if (!currUser) {
console.log('not authenticated...routing from dashboard to teams home')
router.push('/teams/login')
}
}, [currUser])
const [selectedChannel, setSelectedChannel] = useState(null)
console.log("in dashboard " + currUser)
useEffect(() => {
// if not authed, go to home
if (!currUser) {
console.log('not authenticated...routing from dashboard to teams home')
router.push('/teams')
}
}, [currUser])
async function handleSignOut() {
console.log("clicked log out button")
@@ -218,7 +218,6 @@ export default function Dashboard() {
</button>
</span>
{/* list of team members */}
{
testFriends.map((friend, i) => {
+27 -78
View File
@@ -1,81 +1,30 @@
import Head from 'next/head';
import Image from 'next/image';
import styles from '/styles/Home.module.css';
import Link from 'next/link';
import { useAuth } from "../../contexts/authContext"
import { useRouter } from "next/router"
import { useEffect } from "react"
/**
* figure out where to take the user based on everything
*/
function RouteHandler() {
const { currUser, logOut } = useAuth()
const router = useRouter()
useEffect(() => {
// if not authenticated, take user to the login
if (!currUser) {
console.log('not authenticated...routing from dashboard to teams home')
router.push('/teams/login')
}
}, [currUser])
export default function Home() {
return (
<div className={styles.container}>
<Head>
<meta charSet="UTF-8" />
<title>nirvana for teams</title>
<link rel="icon" href="/icon.png" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link
rel="preconnect"
href="https://fonts.gstatic.com"
crossOrigin="true"
/>
<link
href="https://fonts.googleapis.com/css2?family=Satisfy&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Baloo+Bhaijaan+2&display=swap"
rel="stylesheet"
/>
</Head>
<main className="space-y-10">
<p id="main-title">nirvana</p>
<p>🍃voice first collaboration for remote teams</p>
<p>
tired of spending most of the work day on{' '}
<font className="text-gray-300 text-3xl">slack, <font className="text-2xl">zoom,</font> <font className="text-xl">ms teams,</font> <font className="text-lg">trello,</font> <font className="text-base">outlook,</font> <font className="text-base">gcal, </font><font className="text-sm">notion,</font> <font className="text-xs">gmail...</font>?</font>
</p>
<p>
focus on actually working and:
<br />
- cut the texting, emojis, and notifications
<br />
- increase collaboration without endless threads
<br />
- avoid 80% of meetings with asynchronous and spontaneous convos
<br />
- form better relationships with your team
<br />
</p>
<p>
wanna test the beta? text us @ <font className="text-gray-300">949.237.2715</font>
</p>
{/* <marquee
direction="left"
width="100%"
height="100%"
behavior="scroll"
scrollamount="12"
offset="0%"
>
<p id="marquee-text">waitlist currently sitting at 2,324 people...</p>
</marquee> */}
<p id="side-note">
why? we live in a distracted world. let&apos;s fix it, because less is more.
</p>
<Link exact href='/teams/login' className='text-3xl text-white'>
<button className='mt-10 text-sm text-emerald-500 font-semibold py-1 px-4 bg-gray-200 rounded'>👋 Login</button>
</Link>
</main>
</div>
);
<div className="text-white">this is the route handler page</div>
)
}
export async function getServerSideProps() {
// Pass data to the page via props
return { props: { } }
}
export default RouteHandler
+80
View File
@@ -0,0 +1,80 @@
import Head from 'next/head';
import Image from 'next/image';
import Link from 'next/link';
export default function Landing() {
return (
<div className='container m-20'>
<Head>
<meta charSet="UTF-8" />
<title>nirvana for teams</title>
<link rel="icon" href="/icon.png" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link
rel="preconnect"
href="https://fonts.gstatic.com"
crossOrigin="true"
/>
<link
href="https://fonts.googleapis.com/css2?family=Satisfy&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Baloo+Bhaijaan+2&display=swap"
rel="stylesheet"
/>
</Head>
<main className="space-y-10">
<p id="main-title">nirvana</p>
<p>🍃voice first collaboration for remote teams</p>
<p>
tired of spending most of the work day on{' '}
<font className="text-gray-300 text-3xl">slack, <font className="text-2xl">zoom,</font> <font className="text-xl">ms teams,</font> <font className="text-lg">trello,</font> <font className="text-base">outlook,</font> <font className="text-base">gcal, </font><font className="text-sm">notion,</font> <font className="text-xs">gmail...</font>?</font>
</p>
<p>
focus on actually working and:
<br />
- cut the texting, emojis, and notifications
<br />
- increase collaboration without endless threads
<br />
- avoid 80% of meetings with asynchronous and spontaneous convos
<br />
- form better relationships with your team
<br />
</p>
<p>
wanna test the beta? text us @ <font className="text-gray-300">949.237.2715</font>
</p>
{/* <marquee
direction="left"
width="100%"
height="100%"
behavior="scroll"
scrollamount="12"
offset="0%"
>
<p id="marquee-text">waitlist currently sitting at 2,324 people...</p>
</marquee> */}
<p id="side-note">
why? we live in a distracted world. let&apos;s fix it, because less is more.
</p>
<Link exact href='/teams/login' className='text-3xl text-white'>
<button className='mt-10 text-sm text-emerald-500 font-semibold py-1 px-4 bg-gray-200 rounded'>👋 Login</button>
</Link>
</main>
</div>
);
}
+2 -2
View File
@@ -10,8 +10,8 @@ export default function Login() {
useEffect(() => {
// if auth, go to dashboard
if (currUser) {
console.log('already logged in, redirecting to the dashboard')
router.push('/teams/dashboard')
console.log('already logged in, redirecting to router')
router.push('/teams')
}
}, [currUser])
+18
View File
@@ -0,0 +1,18 @@
export function requireAuthentication(gssp) {
return async (context) => {
const { req, res } = context;
const token = req.cookies.userToken;
if (!token) {
// Redirect to login page
return {
redirect: {
destination: '/admin/login',
statusCode: 302
}
};
}
return await gssp(context); // Continue on to call `getServerSideProps` logic
}
}
+5
View File
@@ -0,0 +1,5 @@
class UserService {
}
export {}
-116
View File
@@ -1,116 +0,0 @@
.container {
padding: 0 2rem;
}
.main {
min-height: 100vh;
padding: 4rem 0;
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.footer {
display: flex;
flex: 1;
padding: 2rem 0;
border-top: 1px solid #eaeaea;
justify-content: center;
align-items: center;
}
.footer a {
display: flex;
justify-content: center;
align-items: center;
flex-grow: 1;
}
.title a {
color: #0070f3;
text-decoration: none;
}
.title a:hover,
.title a:focus,
.title a:active {
text-decoration: underline;
}
.title {
margin: 0;
line-height: 1.15;
font-size: 4rem;
}
.title,
.description {
text-align: center;
}
.description {
margin: 4rem 0;
line-height: 1.5;
font-size: 1.5rem;
}
.code {
background: #fafafa;
border-radius: 5px;
padding: 0.75rem;
font-size: 1.1rem;
font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
Bitstream Vera Sans Mono, Courier New, monospace;
}
.grid {
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
max-width: 800px;
}
.card {
margin: 1rem;
padding: 1.5rem;
text-align: left;
color: inherit;
text-decoration: none;
border: 1px solid #eaeaea;
border-radius: 10px;
transition: color 0.15s ease, border-color 0.15s ease;
max-width: 300px;
}
.card:hover,
.card:focus,
.card:active {
color: #0070f3;
border-color: #0070f3;
}
.card h2 {
margin: 0 0 1rem 0;
font-size: 1.5rem;
}
.card p {
margin: 0;
font-size: 1.25rem;
line-height: 1.5;
}
.logo {
height: 1em;
margin-left: 0.5rem;
}
@media (max-width: 600px) {
.grid {
width: 100%;
flex-direction: column;
}
}
+1 -5
View File
@@ -21,7 +21,7 @@ main {
font-family: "Poppins", sans-serif;
}
body {
bg {
background: url("/wallpapers/dark-mountains.jpg") no-repeat center center
fixed;
-webkit-background-size: cover;
@@ -47,20 +47,16 @@ body {
color: teal;
}
#side-note {
font-family: "Baloo Bhaijaan 2", cursive;
font-size: 1.5em;
}
p {
font-family: "Baloo Bhaijaan 2", cursive;
font-size: 2em;
color: white;
}
#marquee-text {
font-style: italic;
font-size: 1.5em;
font-family: "Baloo Bhaijaan 2", cursive;
}
/* Mobile :320px. */