Skip to content

Commit 7a25648

Browse files
committed
pass initialValue instead of defaultvalue
1 parent 09c5ec6 commit 7a25648

5 files changed

Lines changed: 12 additions & 12 deletions

File tree

apps/roam/src/components/settings/DiscourseNodeCanvasSettings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ const DiscourseNodeCanvasSettings = ({ nodeType, uid }: { nodeType: string; uid:
9797
title="Key Image"
9898
description="Add an image to the discourse node"
9999
settingKeys={["canvasSettings", "key-image"]}
100-
defaultValue={isKeyImage}
100+
initialValue={isKeyImage}
101101
onChange={(checked) => {
102102
setIsKeyImage(checked);
103103
if (checked && !keyImageOption) setKeyImageOption("first-image");

apps/roam/src/components/settings/DiscourseNodeSpecification.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ const NodeSpecification = ({
125125
title="enabled"
126126
description=""
127127
settingKeys={["specification", "enabled"]}
128-
defaultValue={enabled}
128+
initialValue={enabled}
129129
parentUid={parentUid}
130130
uid={enabledBlockUid}
131131
order={2}

apps/roam/src/components/settings/DiscourseNodeSuggestiveRules.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ const DiscourseNodeSuggestiveRules = ({
9696
title="Embedding Block Ref"
9797
description="Copy block ref from template which you want to be embedded and ranked."
9898
settingKeys={["suggestiveRules", "embeddingRef"]}
99-
defaultValue={node.embeddingRef || ""}
99+
initialValue={node.embeddingRef || ""}
100100
placeholder="((block-uid))"
101101
onChange={setEmbeddingRef}
102102
order={1}
@@ -116,7 +116,7 @@ const DiscourseNodeSuggestiveRules = ({
116116
title="First Child"
117117
description="If the block is the first child of the embedding block ref, it will be embedded and ranked."
118118
settingKeys={["suggestiveRules", "isFirstChild"]}
119-
defaultValue={node.isFirstChild?.value || false}
119+
initialValue={node.isFirstChild?.value || false}
120120
order={2}
121121
uid={node.isFirstChild?.uid || ""}
122122
parentUid={parentUid}

apps/roam/src/components/settings/NodeConfig.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ const NodeConfig = ({
262262
title="Description"
263263
description={`Describing what the ${node.text} node represents in your graph.`}
264264
settingKeys={["description"]}
265-
defaultValue={node.description}
265+
initialValue={node.description}
266266
order={1}
267267
parentUid={node.type}
268268
uid={descriptionUid}
@@ -272,7 +272,7 @@ const NodeConfig = ({
272272
title="Shortcut"
273273
description={`The trigger to quickly create a ${node.text} page from the node menu.`}
274274
settingKeys={["shortcut"]}
275-
defaultValue={node.shortcut}
275+
initialValue={node.shortcut}
276276
order={0}
277277
parentUid={node.type}
278278
uid={shortcutUid}
@@ -282,7 +282,7 @@ const NodeConfig = ({
282282
title="Tag"
283283
description={`Designate a hashtag for marking potential ${node.text}.`}
284284
settingKeys={["tag"]}
285-
defaultValue={node.tag}
285+
initialValue={node.tag}
286286
placeholder={generateTagPlaceholder(node)}
287287
getValidationError={validateTag}
288288
onChange={setTagValue}
@@ -390,7 +390,7 @@ const NodeConfig = ({
390390
title="Graph Overview"
391391
description="Whether to color the node in the graph overview based on canvas color. This is based on the node's plain title as described by a `has title` condition in its specification."
392392
settingKeys={["graphOverview"]}
393-
defaultValue={node.graphOverview}
393+
initialValue={node.graphOverview}
394394
order={0}
395395
parentUid={node.type}
396396
uid={graphOverviewUid}

apps/roam/src/components/settings/components/BlockPropSettingPanels.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ export const DiscourseNodeTextPanel = ({
577577
nodeType,
578578
...props
579579
}: DiscourseNodeBaseProps & RoamBlockSyncProps & {
580-
defaultValue?: string;
580+
initialValue?: string;
581581
placeholder?: string;
582582
getValidationError?: Validator<string>;
583583
onChange?: (value: string) => void;
@@ -592,7 +592,7 @@ export const DiscourseNodeFlagPanel = ({
592592
nodeType,
593593
...props
594594
}: DiscourseNodeBaseProps & RoamBlockSyncProps & {
595-
defaultValue?: boolean;
595+
initialValue?: boolean;
596596
disabled?: boolean;
597597
onBeforeChange?: (checked: boolean) => Promise<boolean>;
598598
onChange?: (checked: boolean) => void;
@@ -606,7 +606,7 @@ export const DiscourseNodeFlagPanel = ({
606606
export const DiscourseNodeSelectPanel = ({
607607
nodeType,
608608
...props
609-
}: DiscourseNodeBaseProps & RoamBlockSyncProps & { options: string[]; defaultValue?: string }) => (
609+
}: DiscourseNodeBaseProps & RoamBlockSyncProps & { options: string[]; initialValue?: string }) => (
610610
<BaseSelectPanel
611611
{...props}
612612
setter={createDiscourseNodeSetter(nodeType)}
@@ -616,7 +616,7 @@ export const DiscourseNodeSelectPanel = ({
616616
export const DiscourseNodeNumberPanel = ({
617617
nodeType,
618618
...props
619-
}: DiscourseNodeBaseProps & RoamBlockSyncProps & { defaultValue?: number; min?: number; max?: number }) => (
619+
}: DiscourseNodeBaseProps & RoamBlockSyncProps & { initialValue?: number; min?: number; max?: number }) => (
620620
<BaseNumberPanel
621621
{...props}
622622
setter={createDiscourseNodeSetter(nodeType)}

0 commit comments

Comments
 (0)