-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[1156] Expose a Veda UI EnvConfigProvider for providing env variables (…
…#1253) **Related Ticket:** #1166 ### Problem We need a way for future Next.js instances using veda-ui components to pass their environment variables to the library [The previous PR](#1252) tried to pass env variables as props to our components. However, this might be difficult to maintain and to scale as new environment variables will be added. This PR introduces a centralized config place through a new `VedauiConfigProvider` context to allow devs to configure all environment variables in one place via a config object. ### Description of Changes **Veda-UI changes** - Created `VedauiConfigProvider` context provider - Currently supports these configuration options: - `mapboxToken` ( `MAPBOX_TOKEN`) - `apiRasterEndpoint` (`API_RASTER_ENDPOINT`) - `apiStacEndpoint` (from `API_STAC_ENDPOINT`) - Refactored internal components to consume the environment variables from this context **Next.js ([PR here](developmentseed/next-veda-ui#13 - Imported and used the new provider - ℹ️ In Next.js, environment variables should be named according to the Next.js naming standards so that they can be applied e.g `MAPBOX_TOKEN` should be `NEXT_PUBLIC_MAPBOX_TOKEN` etc. ### Notes & Questions About Changes _{Add additonal notes and outstanding questions here related to changes in this pull request}_ ### Validation / Testing Test that the correct env variables are applied when using the library in Next.js
- Loading branch information
Showing
20 changed files
with
322 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.