Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a data-supplier component that wraps a collection of others #79

Open
Sing-Li opened this issue Feb 18, 2022 · 2 comments
Open

Create a data-supplier component that wraps a collection of others #79

Sing-Li opened this issue Feb 18, 2022 · 2 comments
Assignees

Comments

@Sing-Li
Copy link
Member

Sing-Li commented Feb 18, 2022

Investigate into the possibility of creating a component that takes datasource (strapi, URL to JSON, URL to CSV) and populate its children components iteratively with that data. Without:

  1. touching or modifying the styling of its children
  2. having any major assumption about its childrren (except perhaps an exported data population method)
@abhinavkrin
Copy link
Member

Hi @Sing-Li , could you give me an example? I would like to work on this issue.

@Sing-Li
Copy link
Member Author

Sing-Li commented Feb 18, 2022

@abhinavkrin Please see this ...

/~https://github.com/RocketChat/RC4Community/blob/master/app/components/infotiles.js#L6

Simplified to:

<DataLoader  id="dl1" src="strapi://infotiles">
   <Infotile    title={dl1.data.1.title}    desc={dl1.data.1.desc}  />
   <Infotile    title={dl1.data.2.title}    desc={dl1.data.2.desc}  />
   <Infotile    title={dl1.data.3.title}    desc={dl1.data.3.desc}  />
  <Infotile    title={dl1.data.4.title}    desc={dl1.data.4.desc}  />
 </DataLoader>

Hope you get the idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants