Skip to content
This repository has been archived by the owner on Dec 24, 2022. It is now read-only.

Generic svelte component for json objects #3

Open
mrbrianevans opened this issue Nov 2, 2021 · 2 comments
Open

Generic svelte component for json objects #3

mrbrianevans opened this issue Nov 2, 2021 · 2 comments
Labels
ui svelte user interface

Comments

@mrbrianevans
Copy link
Owner

Add component for arbitrary simple key-value pair objects.

Eg input:

{
    "name": "user1",
    "account_created_on": "2020-10-21",
    "public": true
}
  • Make sure dates, numbers and booleans are parsed correctly
  • Rename keys to sentence case if they are camelCase or snake_case etc
@mrbrianevans mrbrianevans added the ui svelte user interface label Nov 3, 2021
@mrbrianevans
Copy link
Owner Author

A start to this was made in #27 (specifically 2edfd6d) with a component to display instagram profiles being generic.

There are various improvements needed:

  • it should be the same component for deeply nested and shallow objects
  • use section headings if there is a lot of data under a key (go from h1-h6)
  • sort by most shallow at the top, deeply nested last on the page
  • styling for the outer component that any child <a> or <h1> are styled correctly

@mrbrianevans mrbrianevans changed the title Generic svelte component for non-nested objects Generic svelte component for json objects Nov 6, 2021
mrbrianevans added a commit that referenced this issue Nov 6, 2021
Much easier to do this using JSX than svelte

Signed-off-by: Brian Evans <[email protected]>
@mrbrianevans
Copy link
Owner Author

Can use <svelte:self /> special component to render recursively. This should remove the need for Preact.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ui svelte user interface
Projects
None yet
Development

No branches or pull requests

1 participant