Skip to content

Commit

Permalink
misc: ui & logging updates
Browse files Browse the repository at this point in the history
  • Loading branch information
oreHGA committed Sep 3, 2024
1 parent b854420 commit 539db1c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const ActivityWatchModal: FC<IActivityWatchModalProps> = ({ isOpen, onClo
appInsights.trackEvent({
name: "ActivityWatchHostSelected",
properties: {
userNpub: user?.data?.user?.email, // this is actually the npub, need to cast the session type so I can use the right selection
userNpub: user?.data?.user?.name,
unixTimestamp: dayjs().unix(),
},
});
Expand Down Expand Up @@ -199,7 +199,7 @@ export const ActivityWatchModal: FC<IActivityWatchModalProps> = ({ isOpen, onClo
appInsights.trackEvent({
name: "ActivityWatchDataDownloaded",
properties: {
userNpub: user?.data?.user?.email, // this is actually the npub, need to cast the session type so I can use the right selection
userNpub: user?.data?.user?.name,
unixTimestamp: dayjs().unix(),
},
});
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/components/lab/experiment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const Experiment: FC<IExperiment> = (experiment) => {
properties: {
deviceInfo: connectedDevice,
experimentInfo: experimentInfo,
userNpub: session.data?.user?.email,
userNpub: session.data?.user?.name,
},
});
console.log(experimentInfo);
Expand All @@ -64,7 +64,7 @@ export const Experiment: FC<IExperiment> = (experiment) => {
properties: {
deviceInfo: connectedDevice,
experimentDetails: experimentInfo,
userNpub: session.data?.user?.email,
userNpub: session.data?.user?.name,
},
});
neurosityService.stopRecording();
Expand All @@ -85,7 +85,7 @@ export const Experiment: FC<IExperiment> = (experiment) => {
properties: {
deviceInfo: await museContext?.museClient?.deviceInfo(),
experimentInfo: experimentInfo,
userNpub: session.data?.user?.email,
userNpub: session.data?.user?.name,
},
});
await museEEGService.startRecording(experimentInfo);
Expand All @@ -100,7 +100,7 @@ export const Experiment: FC<IExperiment> = (experiment) => {
properties: {
deviceInfo: await museContext?.museClient?.deviceInfo(),
experimentInfo: experimentInfo,
userNpub: session.data?.user?.email,
userNpub: session.data?.user?.name,
},
});
await museEEGService.stopRecording(true);
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/datasets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ const DatasetPage: NextPage = () => {
description: "Manage your datasets from previous recordings. You can download your data here.",
}}
/>
<h1 className="text-2xl font-bold mb-4">Datasets</h1>
<p className="mb-4">You can download your data here. You can also delete your data from the browser.</p>
<h1 className="text-4xl font-bold mb-4">Datasets</h1>
<p className="mb-4">Manage your datasets from previous recordings. You can download your data here..</p>
<ul className="space-y-2">
{files.map((name, index) => (
<li key={index} className="flex items-center justify-between">
Expand Down
21 changes: 19 additions & 2 deletions frontend/src/pages/profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Button, Dialog, DialogContent, DialogDescription, DialogTitle } from "~
import { deletePrivateKey } from "~/utils/auth";
import Link from "next/link";
import StripeButton from "~/components/stripe-button";
import { Eye, EyeOff } from "lucide-react";

const AccountPage: NextPage = () => {
const { data: session } = useSession();
Expand All @@ -20,6 +21,8 @@ const AccountPage: NextPage = () => {
signOut();
};

const [showPrivateKey, setShowPrivateKey] = React.useState(false);

return (
<DashboardLayout>
<Meta
Expand All @@ -32,7 +35,21 @@ const AccountPage: NextPage = () => {
<p className="mb-10 mt-2 text-lg dark:text-slate-400">You have been assigned an anonymous account</p>

<p>Public Key : {session?.user?.name}</p>
<p>Private Key: {session?.user?.privateKey} </p>
<div className="relative">
<p>
Private Key:{" "}
{session?.user?.privateKey && (
<span className="inline-flex items-center">
<span className={`${showPrivateKey ? "" : "filter blur-sm"}`}>{session.user.privateKey}</span>
<Button
onClick={() => setShowPrivateKey(!showPrivateKey)}
className="ml-2 text-blue-500 hover:text-blue-700"
leftIcon={showPrivateKey ? <EyeOff size={16} /> : <Eye size={16} />}
/>
</span>
)}
</p>
</div>

<div className="flex flex-row space-x-4 mt-5">
<Button onClick={() => signOut()}>Log Out</Button>
Expand All @@ -47,7 +64,7 @@ const AccountPage: NextPage = () => {
</div>

<div>
<p className="mt-5">Fusion is open source. Fund our development!</p>
<p className="mt-5">Support NeuroFusion's open-source development!</p>
<StripeButton />
</div>
</DashboardLayout>
Expand Down

0 comments on commit 539db1c

Please sign in to comment.