Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 4127 Rev 4128
Línea 781... Línea 781...
781
            </div>
781
            </div>
782
          </div>
782
          </div>
783
        </div>
783
        </div>
784
      </div>
784
      </div>
785
      {shareFileModal}
785
      {shareFileModal}
786
      <ConferenceModal show={showConferenceModal} />
786
      <ConferenceModal show={showConferenceModal} timezones={timezones} />
787
    </>
787
    </>
788
  );
788
  );
Línea 789... Línea 789...
789
 
789
 
790
  const groupChat = (
790
  const groupChat = (
Línea 995... Línea 995...
995
    </Modal>
995
    </Modal>
996
  )
996
  )
997
}
997
}
Línea 998... Línea 998...
998
 
998
 
999
const ConferenceModal = ({
999
const ConferenceModal = ({
-
 
1000
  show = false,
1000
  show = false
1001
  timezones = {}
Línea 1001... Línea 1002...
1001
}) => {
1002
}) => {
1002
 
1003
 
-
 
1004
  const { handleSubmit, register, errors, reset } = useForm()
-
 
1005
  const [date, setDate] = useState({
-
 
1006
    year: date.toLocaleString("default", { year: "numeric" }),
-
 
1007
    month: date.toLocaleString("default", { month: "2-digit" }),
1003
  const { handleSubmit, register, watch, errors, reset } = useForm()
1008
    day: date.toLocaleString("default", { day: "2-digit" })
-
 
1009
  })
-
 
1010
  const [time, setTime] = useState({
-
 
1011
    hour: date.toLocaleString("default", { hour: "numeric" }),
-
 
1012
    minute: date.toLocaleString("default", { minute: "2-digit" }),
1004
  const [date, setDate] = useState(new Intl.DateTimeFormat('en').format(new Date()))
1013
    second: date.toLocaleString("default", { second: "2-digit" })
Línea 1005... Línea 1014...
1005
  const [time, setTime] = useState(new Intl.DateTimeFormat('en').format(new Date()))
1014
  })
Línea -... Línea 1015...
-
 
1015
  const [coferenceType, setConferenceType] = useState(1)
-
 
1016
 
-
 
1017
  const handleChange = (value) => setConferenceType(value)
-
 
1018
 
-
 
1019
  const handleDateTime = (value) => {
-
 
1020
    setDate({
-
 
1021
      ...date,
-
 
1022
      year: new Intl.DateTimeFormat('en', { year: 'numeric' }).format(value),
-
 
1023
      month: new Intl.DateTimeFormat('en', { month: '2-digit' }).format(value),
-
 
1024
      day: new Intl.DateTimeFormat('en', { day: '2-digit' }).format(value),
-
 
1025
    })
-
 
1026
    setTime({
-
 
1027
      ...time,
-
 
1028
      hour: new Intl.DateTimeFormat('en', { hour: 'numeric' }).format(value),
-
 
1029
      minute: new Intl.DateTimeFormat('en', { minute: '2-digit' }).format(value),
1006
  const [coferenceType, setConferenceType] = useState(1)
1030
      second: new Intl.DateTimeFormat('en', { second: '2-digit' }).format(value),
1007
 
1031
    })
1008
  const handleChange = (value) => setConferenceType(value)
1032
  }
Línea 1009... Línea 1033...
1009
 
1033
 
Línea 1016... Línea 1040...
1016
      title='Crea una conferencia'
1040
      title='Crea una conferencia'
1017
      size='md'
1041
      size='md'
1018
      show={show}
1042
      show={show}
1019
    >
1043
    >
1020
      <form onSubmit={handleSubmit(onSubmit)}>
1044
      <form onSubmit={handleSubmit(onSubmit)}>
1021
        <div className="d-flex flex-wrap pb-3" style={{ gap: '1rem' }}>
-
 
1022
          <div className="cp-field">
1045
        <div className="form-group">
1023
            <label htmlFor="first_name">Título</label>
1046
          <label htmlFor="first_name">Título</label>
1024
            <input
1047
          <input
1025
              type="text"
1048
            type="text"
1026
              name="title"
1049
            name="title"
-
 
1050
            className="form-control"
1027
              {...register({ required: "Por favor un título" })}
1051
            {...register({ required: "Por favor un título" })}
1028
            />
1052
          />
1029
            {errors.title && <FormErrorFeedback> {errors.title.message}</FormErrorFeedback>}
1053
          {errors.title && <FormErrorFeedback> {errors.title.message}</FormErrorFeedback>}
1030
          </div>
1054
        </div>
1031
          <div className="cp-field">
1055
        <div className="form-group">
1032
            <label htmlFor="timezone">Zona horaria</label>
1056
          <label htmlFor="timezone">Zona horaria</label>
1033
            <select
1057
          <select
1034
              name="timezone"
1058
            className="form-control"
1035
              defaultValue=""
1059
            name="timezone"
1036
              {...register({ required: "Por favor elige una Zona horaria" })}
1060
            {...register({ required: "Por favor elige una Zona horaria" })}
1037
            >
1061
          >
1038
              <option value="" hidden>
1062
            <option value="" hidden>
1039
                Zona horaria
1063
              Zona horaria
-
 
1064
            </option>
-
 
1065
            {Object.entries(timezones).map(([key, value]) => (
-
 
1066
              <option value={key} key={key}>
-
 
1067
                {value}
1040
              </option>
1068
              </option>
1041
              {Object.entries(timezones).map(([key, value]) => (
-
 
1042
                <option value={key} key={key}>
-
 
1043
                  {value}
-
 
1044
                </option>
-
 
1045
              ))}
1069
            ))}
1046
            </select>
1070
          </select>
1047
            {errors.timezone && <FormErrorFeedback>{errors.timezone.message}</FormErrorFeedback>}
1071
          {errors.timezone && <FormErrorFeedback>{errors.timezone.message}</FormErrorFeedback>}
1048
          </div>
-
 
1049
        </div>
1072
        </div>
1050
        <div className="d-flex flex-wrap pb-3" style={{ gap: '1rem' }}>
1073
        <div className="d-flex flex-wrap pb-3" style={{ gap: '1rem' }}>
1051
          <div className="cp-field">
1074
          <div className="cp-field">
1052
            <label htmlFor="timezone">Tipo de conferencia</label>
1075
            <label htmlFor="timezone">Tipo de conferencia</label>
1053
            <select
1076
            <select
Línea 1068... Línea 1091...
1068
            <div className="cp-field">
1091
            <div className="cp-field">
1069
              <label htmlFor="timezone">Tipo de conferencia</label>
1092
              <label htmlFor="timezone">Tipo de conferencia</label>
1070
              <Datetime
1093
              <Datetime
1071
                dateFormat="DD-MM-YYYY"
1094
                dateFormat="DD-MM-YYYY"
1072
                onChange={(e) => {
1095
                onChange={(e) => {
1073
                  setDate(new Intl.DateTimeFormat('en', { year: 'numeric', month: 'numeric', day: 'numeric' }).format(e.toDate()))
1096
                  handleDateTime(e.toDate());
1074
                  setTime(new Intl.DateTimeFormat('en', { hour: '2-digit', minute: '2-digit', second: '2-digit' }).format(e.toDate()))
1097
                  setTime(new Intl.DateTimeFormat('en', { hour: '2-digit', minute: '2-digit', second: '2-digit' }).format(e.toDate()))
1075
                }}
1098
                }}
1076
                inputProps={{ className: 'form-control' }}
1099
                inputProps={{ className: 'form-control' }}
1077
                initialValue={Date.parse(date)}
1100
                initialValue={Date.parse(date)}
1078
                closeOnSelect
1101
                closeOnSelect