Skip to content

Commit e1553f8

Browse files
committed
fix: section content mapping for links
1 parent 835cbb8 commit e1553f8

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

packages/teleport-types/src/uidl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export interface UIDLURLLinkNode {
203203

204204
export interface UIDLSectionLinkNode {
205205
type: 'section'
206-
content: { id: string }
206+
content: { section: string }
207207
}
208208

209209
export interface UIDLNavLinkNode {

packages/teleport-uidl-resolver/__tests__/abilities/mocks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const phoneMockedDefinition = (): UIDLPhoneLinkNode => ({
3232
export const sectionMockedDefinition = (): UIDLSectionLinkNode => ({
3333
type: 'section',
3434
content: {
35-
id: 'contact',
35+
section: 'contact',
3636
},
3737
})
3838

packages/teleport-uidl-resolver/__tests__/abilities/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,6 @@ describe('createLink', () => {
121121
const result = createLinkNode(link, {})
122122

123123
expect(result.content.elementType).toBe('link')
124-
expect(result.content.attrs.url.content).toBe(`#${link.content.id}`)
124+
expect(result.content.attrs.url.content).toBe(`#${link.content.section}`)
125125
})
126126
})

packages/teleport-uidl-resolver/src/resolvers/abilities/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export const createLinkNode = (link: UIDLLinkNode, options: GeneratorOptions): U
8181
attrs: {
8282
url: {
8383
type: 'static',
84-
content: `#${link.content.id}`,
84+
content: `#${link.content.section}`,
8585
},
8686
},
8787
children: [],

0 commit comments

Comments
 (0)