Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: minor fixes and UI changes #148

Merged
merged 1 commit into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
998 changes: 517 additions & 481 deletions frontend/pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion frontend/src/app/api/home/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export async function GET() {
last_name: user.last_name,
verified: user.verified,
level: `${user.level} - Coming Soon`,
points: user.level_points,
points: user.level_points ?? 0,
maxPoints: 100,
},
};
Expand Down
8 changes: 6 additions & 2 deletions frontend/src/app/insights/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,14 @@ export default function InsightsPage() {
// Convert canvas to Blob
const blob = await new Promise<Blob>((resolve, reject) => {
canvasRef.current?.toBlob((b) => {
b ? resolve(b) : reject(new Error("Canvas conversion failed"));
if (b) {
resolve(b);
} else {
reject(new Error("Canvas conversion failed"));
}
}, "image/png");
});
const file = new File([blob], "results.png", { type: "image/png" });
const file = new File([await blob], "results.png", { type: "image/png" });

// Use native share if available
if (
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/app/sign-in/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default function SignIn() {
nonce,
statement: "Sign in with your Ethereum wallet",
})
.catch((error) => {
.catch((error: unknown) => {
console.error("Wallet auth command failed:", error);
if (error instanceof DOMException) {
if (error.name === "SyntaxError") {
Expand Down Expand Up @@ -267,7 +267,7 @@ export default function SignIn() {
className="flex justify-center mb-8"
>
<Image
src="/mindvault-logo.png"
src="/MindVaultLogoTransparentHD.svg"
alt="MindVault Logo"
width={64}
height={64}
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/components/ui/AchievementButton.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"use client";

import { cn } from "@/lib/utils";
import { useRouter } from "next/navigation";
import type * as React from "react";

interface AchievementButtonProps {
Expand All @@ -10,9 +11,12 @@ interface AchievementButtonProps {
export function AchievementButton({
hasNewAchievement = true,
}: AchievementButtonProps) {
const router = useRouter();

return (
<button
type="button"
onClick={() => router.push("/achievements")}
className={cn(
"relative h-[50px] w-[320px] rounded-[20px] bg-brand-secondary shadow-[0px_4px_4px_rgba(0,0,0,0.25)] hover:bg-brand-secondary/90",
"flex items-center justify-center",
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/ui/ProfileCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface User {
name: string;
last_name: string;
level: string;
level_points: number;
points: number;
maxPoints: number;
}

Expand Down Expand Up @@ -68,7 +68,7 @@ export function ProfileCard({
name: "John",
last_name: "Doe",
level: "Conscious Explorer",
level_points: 45,
points: 45,
maxPoints: 100,
},
}: ProfileCardProps) {
Expand Down Expand Up @@ -119,7 +119,7 @@ export function ProfileCard({
</p>
</div>

<LevelProgress points={user.level_points} maxPoints={user.maxPoints} />
<LevelProgress points={user.points} maxPoints={user.maxPoints} />

<div className="mt-4 w-full">
<p className="mb-2 font-spaceGrotesk text-sm font-medium text-white">
Expand Down
24 changes: 14 additions & 10 deletions frontend/src/components/ui/QuizCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,48 @@

import { FilledButton } from "@/components/ui/FilledButton";
import { cn } from "@/lib/utils";
import { ArrowRight, ClockIcon } from "lucide-react";
import { Flame, LockIcon } from "lucide-react";
import type * as React from "react";

export function QuizCard() {
return (
<div
className={cn(
"mx-auto h-[160px] w-[280px] relative overflow-hidden flex flex-col rounded-[16px] bg-gradient-to-br from-[#DA9540] via-[#E5AB5C] to-[#F1C17A]",
"mx-auto h-[180px] w-[280px] relative overflow-hidden flex flex-col rounded-[16px] bg-gradient-to-br from-[#DA9540] via-[#E5AB5C] to-[#F1C17A]",
"transform hover:scale-105 hover:-translate-y-1 hover:rotate-1 sm:w-[320px]",
"shadow-[0_10px_20px_rgba(0,0,0,0.2),_0_6px_6px_rgba(0,0,0,0.25)]",
"hover:shadow-[0_14px_28px_rgba(0,0,0,0.25),_0_10px_10px_rgba(0,0,0,0.22)]",
"transition-all duration-300",
)}
>

<div className="relative z-10 flex h-full flex-col justify-between p-4">
<div className="mb-3 text-center font-spaceGrotesk text-base font-medium leading-tight text-white sm:text-lg">
Keep your streak alive! <br />
Complete a quiz today
<div className="flex items-center justify-center gap-2 mb-1">
<span>Daily Streaks</span>
</div>
Build your learning path
</div>
<div className="space-y-3">
<div className="w-full rounded-[12px] bg-white/20 p-2 backdrop-blur-md">
<div className="flex items-center justify-between">
<div className="ml-2 font-spaceGrotesk text-xs font-medium leading-tight text-white sm:text-sm">
DAILY QUESTIONNAIRE
DAILY CHALLENGES
</div>
<ClockIcon
className="h-5 w-5 animate-pulse text-accent-red"
<Flame
className="h-5 w-5 text-accent-red animate-pulse"
aria-hidden="true"
/>
</div>
</div>
<FilledButton
variant="default"
size="sm"
icon={ArrowRight}
className="h-8 w-full transform text-xs transition-all duration-300 hover:scale-105"
icon={LockIcon}
className="h-10 w-full transform text-sm transition-all duration-300 cursor-not-allowed opacity-80"
disabled
>
Start Quiz
Coming Soon
</FilledButton>
</div>
</div>
Expand Down
Loading