SPA: Create <Select /> component
In the original theme there is a Select components created with a JS library, we need to recreate this with a React component.
Mock
Describe the solution you'd like
Recreate the component from the library with React use the same css class name but the events use React.
Technical Approach
- Download the theme here
- Open
site/header-classic.html - Around line 230 you'll see the select
Additional context
- @alfredo-dotcms did this same approach with the carousel
- Use this components in the language select in the header
Acceptance Criteria
- Create and use
Selectcomponent - Work in all the supported browsers (don't forget IE11 and iPad)
- Multilanguage
- Unit test
Can we use our we component?
After review this taks, the current template include a library call Select2. We don't want create a custom library that do the same. So we just are adding the arrow to the current select element that is missing in the current starter style. By adding to this file /application/themes/travel/css/custom-styles/components/_forms.scss the following styles:
// Form select
select.form-input {
padding-right: 38px;
}
// Form select arrow
.form-wrap-select:after {
font-weight: 400;
content: "";
font-family: "Material Design Icons";
font-size: 20px;
position: absolute;
bottom: 10px;
right: 15px;
pointer-events: none;
}
.rd-navbar-aside-outer {
.form-input {
background-color: transparent;
display: inline;
width: auto;
border: 0;
outline: none;
border-left: 1px solid #aeb1be;
}
.form-wrap-select {
position: relative;
display: inline-flex;
}
}
The language component is not working as expected, when you select some different language in the drop-down, we need to refresh the page and translate
This issue has been automatically marked as stale because it has not had activity within the past 90 days. It will be closed in 30 days no further activity occurs. Thank you.