Skip to content

Commit

Permalink
chore: resolve eslint errors and run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
sauhardjain committed Oct 5, 2023
1 parent 8a72bf5 commit b666101
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 42 deletions.
16 changes: 8 additions & 8 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module.exports = {
extends: ["@calblueprint/eslint-config-react", "eslint:recommended", "plugin:react/recommended", "plugin:prettier/recommended"],
rules: {
// Add any custom rules here
// Disable the rule that requires React to be in scope -- we don't need this with React 18
'react/react-in-jsx-scope': 'off',
'react/jsx-uses-react': 'off',
},
};
extends: ["@calblueprint/eslint-config-react"],
rules: {
// Add any custom rules here
// Disable the rule that requires React to be in scope -- we don't need this with React 18
'react/react-in-jsx-scope': 'off',
'react/jsx-uses-react': 'off',
},
};
29 changes: 15 additions & 14 deletions src/api/supabase/auth/auth.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import supabase from '@/api/supabase/createClient';
import supabase from '../createClient';

export const handleSignUp = async (email: string, password: string) => {
const { data, error } = await supabase.auth.signUp({
email,
password
})
console.log(error)
}
const { data, error } = await supabase.auth.signUp({
email,
password,
});
console.log(error);
};

export const signInWithEmail = async (email: string, password: string) => {
const { data, error } = await supabase.auth.signInWithPassword({
email, password,
})
console.log(data)
}
const { data, error } = await supabase.auth.signInWithPassword({
email,
password,
});
console.log(data);
};

export const signOut = async () => {
const { error } = await supabase.auth.signOut()
}
const { error } = await supabase.auth.signOut();
};
2 changes: 1 addition & 1 deletion src/api/supabase/createClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ const supabase = createClient(
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY,
);

export default supabase;
export default supabase;
14 changes: 7 additions & 7 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import './globals.css'
import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
import './globals.css';
import type { Metadata } from 'next';
import { Inter } from 'next/font/google';

const inter = Inter({ subsets: ['latin'] })
const inter = Inter({ subsets: ['latin'] });

export const metadata: Metadata = {
title: 'Shanti Project',
description: 'Application Created by Blueprint',
}
};

export default function RootLayout({
children,
}: {
children: React.ReactNode
children: React.ReactNode;
}) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
</html>
)
);
}
38 changes: 26 additions & 12 deletions src/app/login/page.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,38 @@
"use client"
'use client';

import { useState } from 'react';
import { handleSignUp, signInWithEmail, signOut } from '@/api/supabase/auth/auth'
import {
handleSignUp,
signInWithEmail,
signOut,
} from '../../api/supabase/auth/auth';

export default function Login() {
const [email, setEmail] = useState('')
const [password, setPassword] = useState('')
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');

return (
return (
<>
<input name="email" onChange={(e) => setEmail(e.target.value)} value={email} />
<input
name="email"
onChange={e => setEmail(e.target.value)}
value={email}
/>
<input
type="password"
name="password"
onChange={(e) => setPassword(e.target.value)}
onChange={e => setPassword(e.target.value)}
value={password}
/>
<button type="button" onClick={() => handleSignUp(email, password)}>Sign up</button>
<button type="button" onClick={() => signInWithEmail(email, password)}>Sign in</button>
<button type="button" onClick={signOut}>Sign out</button>
<button type="button" onClick={() => handleSignUp(email, password)}>
Sign up
</button>
<button type="button" onClick={() => signInWithEmail(email, password)}>
Sign in
</button>
<button type="button" onClick={signOut}>
Sign out
</button>
</>
)
}
);
}

0 comments on commit b666101

Please sign in to comment.