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

Component Integration #313

Closed
thanasis457 opened this issue Oct 23, 2024 · 0 comments · Fixed by #328
Closed

Component Integration #313

thanasis457 opened this issue Oct 23, 2024 · 0 comments · Fixed by #328
Assignees

Comments

@thanasis457
Copy link
Contributor

thanasis457 commented Oct 23, 2024

Description

Providers have access to components such as Galleries, Directories, Text, etc that they can choose to add in their page.

The components are initialized in the admin page during the "Content" step of the Provider creation and are displayed on the Map after a user clicks on a Provider.

  1. Right now, in the admin page, the components are initialized locally and their "state" is saved on a useState variable that is inside the component. Lift this state up so that the admin page can read it and upload it to Firebase along with the rest of the Provider's information (such as tags, hours, etc). In short, push to Firebase the component information of the "Content" step in the Provider creation flow.

  2. On the map, any components shown have dummy data. After you complete the first part of the ticket, make the provider page on the Map show only the components that the provider has initialized and pass the actual Firebase data (not some dummy data).

As it had been mentioned at #294, the schema of the object you save on a provider's entry in Firebase should look like this:

    "Content": {
        "sections": [
            {
                "name": "Section 1",
                "components": [ /* Empty array which will later contain component descriptions */]
            },
            {
                "name": "Section 2",
                "components": []
            }
        ]
    }
}

I leave it up to you how you want each a component's schema to look like but it could be something like this:

{
    "type": "/* component type eg. progress bar, text, directory etc */",
    "data": "/* Data for the component */"
}

Should you make any changes to the schema, make sure to document them in your PR.

@thanasis457 thanasis457 linked a pull request Nov 4, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants