Skip to content
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
40 changes: 40 additions & 0 deletions calc-frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions calc-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"jsdom": "^26.0.0",
"katex": "^0.16.22",
"lucide-react": "^0.483.0",
"next-themes": "^0.4.6",
"npm": "^11.1.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.5.0",
"react-katex": "^3.0.1",
"react-loader-spinner": "^6.1.6",
"react-markdown": "^10.1.0",
"react-router": "^7.1.5",
Expand Down
6 changes: 5 additions & 1 deletion calc-frontend/src/components/ui/FunctionCard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import axios from "axios";
import { useNavigate } from "react-router";
import { toast } from "sonner";
import { InlineMath } from "react-katex";
import "katex/dist/katex.min.css";

interface FunctionCardProps {
topic: string;
Expand Down Expand Up @@ -42,7 +44,9 @@ function FunctionCard({

return (
<div className="bg-[#f6f6f7] p-4 pt-2 rounded-2xl shadow-md text-center w-[240px]">
<p className="text-xl mb-2">{equation}</p>
<p className="text-xl mb-2">
<InlineMath>{equation}</InlineMath>
</p>
<img
src={""}
alt={topic + " graph"}
Expand Down
16 changes: 16 additions & 0 deletions calc-frontend/src/types/react-katex.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
declare module "react-katex" {
import * as React from "react";

interface KatexProps {
children?: string;
math?: string;
errorColor?: string;
renderError?: (error: Error) => React.ReactNode;
}

const InlineMath: React.FC<KatexProps>;
const BlockMath: React.FC<KatexProps>;

export { InlineMath, BlockMath };
export default InlineMath;
}