core icon indicating copy to clipboard operation
core copied to clipboard

SPA: Create <Select /> component

Open fmontes opened this issue 7 years ago • 4 comments

In the original theme there is a Select components created with a JS library, we need to recreate this with a React component.

Mock

Screen Shot 2019-11-21 at 16 23 19

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

  1. Download the theme here
  2. Open site/header-classic.html
  3. Around line 230 you'll see the select

Additional context

  1. @alfredo-dotcms did this same approach with the carousel
  2. Use this components in the language select in the header

Acceptance Criteria

  1. Create and use Select component
  2. Work in all the supported browsers (don't forget IE11 and iPad)
  3. Multilanguage
  4. Unit test

fmontes avatar Nov 21 '19 22:11 fmontes

Can we use our we component?

dotcmsCodeReview avatar Nov 21 '19 22:11 dotcmsCodeReview

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;
    }
}

hmoreras avatar Dec 09 '19 22:12 hmoreras

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

bryanboza avatar Dec 12 '19 20:12 bryanboza

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.

stale[bot] avatar Apr 09 '20 16:04 stale[bot]