feat: introduce AlertButtonWithConfig with variant from config #789
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
Introduces a new component,
DefaultAlertButton
, in thereact
module. It intends to be used by consuming MFEs in theAlert
component'sactions
prop to ensure thatAlert
's CTAs can be reasonably configured to rely on a different defaultButton
variant than is used in the upstream MFE code. For example,@edx/elm-theme
calls forHowever, this approach on its own, does not adequately address how the Paragon docs site itself would adhere to a change in the default
Button
variant used withAlert
when previewing@edx/elm-theme
.To ensure the overridden alert button variant is applied consistently across all MFEs for a given instance, it may be recommended that operators define a common
env.config
(e.g.,env.config.common.js
) that is consumed by all MFE-specificenv.config
files so that MFEs don't need to duplicate the same style overrides in multiple places.The idea here would be that
openedx
MFEs that supplyactions
to theAlert
component should begin usingDefaultAlertButton
from@edx/frontend-platform/react
instead so the configured button variant override is applied without any additional effort within the MFE. It should be as simple as replacing<Button>
with<DefaultAlertButton>
in the appropriate places.See more details from the Paragon Working Group meeting on 4/2 here.
Next steps:
openedx
.env.config
for such style overrides, considering future use cases beyond the immediateAlert
.Merge checklist:
frontend-platform
. This can be done by runningnpm start
and opening http://localhost:8080.module.config.js
file infrontend-build
.fix
,feat
) and is appropriate for your code change. Consider whether your code is a breaking change, and modify your commit accordingly.Post merge: