summaryrefslogtreecommitdiff
path: root/src/components/function_box.tsx
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth.hunt@simponic.xyz>2024-02-11 20:44:17 -0700
committerElizabeth Hunt <elizabeth.hunt@simponic.xyz>2024-02-11 20:44:17 -0700
commitc55d9d2832a46d9dc265fec36936b1313f5af6f6 (patch)
treef0cfb01dc5e89f89dd94e204ed794fa52f231c2d /src/components/function_box.tsx
parent9db4283a20d4ea751d21a8f04a49d3d95d527ac5 (diff)
downloadcompiling-the-lambda-calculus-c55d9d2832a46d9dc265fec36936b1313f5af6f6.tar.gz
compiling-the-lambda-calculus-c55d9d2832a46d9dc265fec36936b1313f5af6f6.zip
birthdays
Diffstat (limited to 'src/components/function_box.tsx')
-rw-r--r--src/components/function_box.tsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/components/function_box.tsx b/src/components/function_box.tsx
index d116a47..b2221b4 100644
--- a/src/components/function_box.tsx
+++ b/src/components/function_box.tsx
@@ -20,7 +20,7 @@ export interface FunctionBoxProps extends NodeProps {
arity?: number;
- isChild?: boolean;
+ isChild?: boolean; // todo: attach DNA
}
type FunctionArgs = { node?: Node; val: any }[];
@@ -59,7 +59,7 @@ export class FunctionBox extends Node {
this.arity = props?.arity ?? 1;
if (props.fn) {
- this.source = props.fn.toString();
+ this.source = props.source ?? props.fn.toString();
this.function = props.fn;
} else {
this.source = props?.source ?? `(x: number): number => x + 2`;
@@ -273,7 +273,7 @@ export class FunctionBox extends Node {
<CodeBlock
fontFamily={theme.font}
language="typescript"
- fontSize={15}
+ fontSize={this.outputFontSize}
code={JSON.stringify(output, null, 2)}
></CodeBlock>,
);