Skip to content

Commit

Permalink
Revert "Improvement/refactor firebase files (#81)" (#91)
Browse files Browse the repository at this point in the history
This reverts commit f51b66b.
  • Loading branch information
Rodriguespn authored Mar 1, 2024
1 parent d40bd10 commit 5e4cdb9
Show file tree
Hide file tree
Showing 23 changed files with 165 additions and 1,237 deletions.
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
<head>
<meta charset="UTF-8" />
<meta name="description" content="Creating the next-gen of crypto compliance" />
<meta name="keywords" content="aml, kyt, chainalysis, elliptic, blockchain, ethereum, explorer, compliance, mica" />
<meta name="keywords" content="blockchain, compliance, graph, analytics, crypto" />
<link rel="icon" type="image/x-icon" href="./src/assets/ward-logo-icon-blue.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta property="og:title" content="Ward Analytics" />
<meta property="og:description" content="The next-gen blockchain graph explorer" />
<meta property="og:description" content="A next-gen blockchain graph explorer" />
<meta property="og:image"
content="https://firebasestorage.googleapis.com/v0/b/graphapp-bca04.appspot.com/o/banner-ward.jpg?alt=media&token=af84a606-e7d9-4883-8284-aab906b9bac3" />
<title>Ward Analytics - Graph</title>
<link
href="https://fonts.googleapis.com/css2?family=Montserrat:wght@100;200;300;400;500;600;700;800;900&family=Roboto&display=swap"
rel="stylesheet" />
rel="stylesheet">
</head>

<body>
Expand Down
14 changes: 11 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC } from "react";
import { FC, useMemo } from "react";
import { QueryClientProvider } from "react-query";
import useCustomQueryClient from "./hooks/useCustomQueryClient";

Expand All @@ -12,7 +12,15 @@ import { HelmetProvider } from 'react-helmet-async';

const App: FC = () => {
const queryClient = useCustomQueryClient();
const { userID, isAuthenticated } = useAuthState();
const { user, isAuthenticated } = useAuthState();

const userID = useMemo(() => {
if (user) {
return user.uid;
}

return "";
}, [user]);

// Ensure that context is never scoped outside of the current instance of the app
const helmetContext = {};
Expand All @@ -23,7 +31,7 @@ const App: FC = () => {
<QueryClientProvider client={queryClient}>
<MobileWarningTemplate className="h-screen w-screen sm:hidden" />
<div className="hidden h-fit w-fit sm:block">
{isAuthenticated ? <PrivateApp userID={userID!} /> : <PublicApp />}
{isAuthenticated ? <PrivateApp userID={userID} /> : <PublicApp />}
</div>
</QueryClientProvider>
</HelmetProvider>
Expand Down
14 changes: 5 additions & 9 deletions src/components/auth/AuthInput.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,25 @@
import clsx from "clsx";
import { useMemo } from "react";
import { useFormContext } from "react-hook-form";

interface AuthInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
label: string;
name: string;
className?: string;
}

const AuthInput = ({ label, name, className, ...rest }: AuthInputProps) => {
const AuthInput = ({ label, name, ...rest }: AuthInputProps) => {
const {
register,
formState: { errors },
} = useFormContext();

const error = useMemo(() => errors[name], [errors, name]);
const error = errors[name];

return (
<div className={clsx("w-full", className)}>
<div>
<label
htmlFor={label}
className="mb-2 block gap-x-1 text-sm font-medium text-gray-900 dark:text-white"
className="mb-2 block text-sm font-medium text-gray-900 dark:text-white"
>
<span>{label}</span>
{rest.required && <span className="text-red-500">*</span>}
{label}
</label>
<input
{...register(name)}
Expand Down
61 changes: 0 additions & 61 deletions src/components/auth/AuthInputCombobox.tsx

This file was deleted.

58 changes: 0 additions & 58 deletions src/components/auth/AuthInputSelect.tsx

This file was deleted.

Loading

0 comments on commit 5e4cdb9

Please sign in to comment.