Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 6993 | Rev 6996 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 6993 Rev 6995
Línea 1... Línea 1...
1
import React, { useEffect, useState } from 'react'
1
import React, { useEffect, useState } from 'react'
2
import { axios } from '../../utils'
2
import { axios } from '../../utils'
3
import { Container, Row } from 'react-bootstrap'
3
import { Col, Container, Row } from 'react-bootstrap'
4
import { addNotification } from '../../redux/notification/notification.actions'
4
import { addNotification } from '../../redux/notification/notification.actions'
5
import { useDispatch, useSelector } from 'react-redux'
5
import { useDispatch, useSelector } from 'react-redux'
Línea 6... Línea 6...
6
 
6
 
Línea 77... Línea 77...
77
    load(searchParams.search, searchParams.category)
77
    load(searchParams.search, searchParams.category)
78
  }, [searchParams])
78
  }, [searchParams])
Línea 79... Línea 79...
79
 
79
 
80
  return (
80
  return (
-
 
81
    <Container>
81
    <Container>
82
      <Row className="justify-content-end">
82
      <Row>
83
        <Col md="3">
83
        <div className="form-group search_categories">
84
          <div className="form-group search_categories">
84
          <select
85
            <select
85
            name="category"
86
              name="category"
86
            className="form-control"
87
              className="form-control"
87
            value={searchParams.category}
88
              value={searchParams.category}
88
            onChange={(e) => handleChange(e)}
89
              onChange={(e) => handleChange(e)}
89
          >
90
            >
90
            <option disabled value="">
91
              <option disabled value="">
91
              {labels.select_category}
-
 
92
            </option>
-
 
93
            {categories.map((element, i) => (
-
 
94
              <option value={element.value} key={i}>
-
 
95
                {element.label}
92
                {labels.select_category}
-
 
93
              </option>
-
 
94
              {categories.map((element, i) => (
-
 
95
                <option value={element.value} key={i}>
-
 
96
                  {element.label}
96
              </option>
97
                </option>
97
            ))}
98
              ))}
98
          </select>
99
            </select>
-
 
100
          </div>
-
 
101
        </Col>
99
        </div>
102
        <Col md="3">
100
        <div className="form-group search_input">
103
          <div className="form-group search_input">
101
          <input
104
            <input
102
            type="text"
105
              type="text"
103
            name="search"
106
              name="search"
104
            className="form-control"
107
              className="form-control"
105
            onChange={(e) => handleChange(e)}
108
              onChange={(e) => handleChange(e)}
106
            value={searchParams.search}
109
              value={searchParams.search}
107
          />
110
            />
108
          <button className="search-btn">{labels.search}</button>
111
            <button className="search-btn">{labels.search}</button>
-
 
112
          </div>
109
        </div>
113
        </Col>
110
      </Row>
114
      </Row>
111
      <h3 className="mt-3">
115
      <h2 className="mt-3 font-bold">
112
        {searchParams.category === 'capsules' ? 'Cápsulas' : 'Recompensas'} de
116
        {searchParams.category === 'capsules' ? 'Cápsulas' : 'Recompensas'} de
113
        Microaprendizaje
117
        Microaprendizaje
114
      </h3>
118
      </h2>
115
      <CapsulesList
119
      <CapsulesList
116
        capsules={searchParams.category === 'capsules' ? capsules : rewards}
120
        capsules={searchParams.category === 'capsules' ? capsules : rewards}
117
        onEnroll={load}
121
        onEnroll={load}
118
      />
122
      />