Skip to content

Commit c58315a

Browse files
committed
Fix empty string key, Add documentation to component library
1 parent 1eb2003 commit c58315a

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

custom-component-library/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ These are the ones currently available:
2727
- [x] `NaN`
2828
- [x] `BigInt`
2929
- [x] Markdown
30+
- [x] "Enhanced" link
3031
- [ ] Image (to-do)
3132

3233
## Development

custom-component-library/src/App.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ function App() {
4444
{
4545
...(STORE_DATE_AS_DATE_OBJECT ? DateObjectDefinition : DatePickerDefinition),
4646
customNodeProps: {
47+
// Display the time depending on whether or not the "Show time"
48+
// toggle is checked
4749
showTime: (data as TestData)?.['Date & Time']?.['Show Time in Date?'] ?? false,
4850
},
4951
},
@@ -53,6 +55,8 @@ function App() {
5355
NanDefinition,
5456
SymbolDefinition,
5557
BigIntDefinition,
58+
// Can override specific definition properties when using the
59+
// components
5660
{
5761
...MarkdownNodeDefinition,
5862
condition: ({ key }) => key === 'Markdown',

src/hooks/useCommon.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export const useCommon = ({ props, collapsed }: CommonProps) => {
104104

105105
const derivedValues = { isEditing, isEditingKey, isArray, canEditKey }
106106

107-
const emptyStringKey = name === '' && path.length > 1 ? translate('EMPTY_STRING', nodeData) : null
107+
const emptyStringKey = name === '' && path.length > 0 ? translate('EMPTY_STRING', nodeData) : null
108108

109109
return {
110110
pathString,

0 commit comments

Comments
 (0)