cmspageblocks 1.0.41 → 1.0.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.js CHANGED
@@ -3517,15 +3517,18 @@ var NewGallery = styled__default["default"].div(_templateObject3$1 || (_template
3517
3517
 
3518
3518
  function CustomSlider(_ref) {
3519
3519
  var options = _ref.options;
3520
- var content = options.content;
3520
+ options.content;
3521
3521
  return /*#__PURE__*/React__default["default"].createElement(SliderContainer, null, /*#__PURE__*/React__default["default"].createElement(js.Carousel, {
3522
3522
  showThumbs: false,
3523
3523
  swipeable: true,
3524
- showStatus: false,
3524
+ showStatus: true,
3525
3525
  dynamicHeight: false,
3526
+ showArrows: true,
3526
3527
  width: "100%",
3527
- showIndicators: content.length > 1 ? true : false,
3528
- centerSlidePercentage: 50
3528
+ infiniteLoop: true,
3529
+ emulateTouch: true,
3530
+ interval: 2000 // showIndicators={content.length > 1 ? true : false}
3531
+
3529
3532
  }, options.content.map(function (slide, index) {
3530
3533
  return /*#__PURE__*/React__default["default"].createElement("div", {
3531
3534
  key: index,
@@ -7731,7 +7734,8 @@ var Form = function Form(_ref) {
7731
7734
  }, errors[field.name]));
7732
7735
  }
7733
7736
  }), /*#__PURE__*/React__default["default"].createElement("button", {
7734
- type: "submit"
7737
+ type: "submit",
7738
+ disabled: isSubmitting
7735
7739
  }, "Verzenden")));
7736
7740
  }
7737
7741
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cmspageblocks",
3
- "version": "1.0.41",
3
+ "version": "1.0.45",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "repository": {
package/src/Main.css.js CHANGED
@@ -11,6 +11,11 @@ flex-wrap: wrap;
11
11
  .justify-evenly {
12
12
  justify-content: space-evenly;
13
13
  }
14
+
15
+ .align-center {
16
+ align-items: center;
17
+ }
18
+
14
19
  ul {
15
20
  list-style: initial;
16
21
  list-style-position: outside;
@@ -8,17 +8,20 @@ export default function CustomSlider({ options }) {
8
8
  <SliderContainer>
9
9
  <Carousel
10
10
  showThumbs={false}
11
- swipeable={true}
12
- showStatus={false}
11
+ swipeable
12
+ showStatus
13
13
  dynamicHeight={false}
14
+ showArrows
14
15
  width="100%"
15
- showIndicators={content.length > 1 ? true : false}
16
- centerSlidePercentage={50}
16
+ infiniteLoop
17
+ emulateTouch
18
+ interval={2000}
19
+ // showIndicators={content.length > 1 ? true : false}
17
20
  >
18
21
  {options.content.map((slide, index) => {
19
22
  return (
20
23
  <div
21
- key={index}
24
+ key={index}
22
25
  dangerouslySetInnerHTML={{ __html: slide.content }}
23
26
  ></div>
24
27
  );
@@ -1,30 +1,30 @@
1
- import React from 'react';
1
+ import React, { useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { Formik } from 'formik';
4
4
  import styled from 'styled-components';
5
5
 
6
6
  const Form = ({ options }) => {
7
- const form = options.content
7
+ const form = options.content;
8
8
  return (
9
9
  <Formik
10
- initialValues={{}}
10
+ initialValues={{}}
11
11
  onSubmit={(values, actions) => {
12
12
  setTimeout(() => {
13
13
  fetch(`https://cms.burobork.nl/recieve/form/${form.id}`, {
14
14
  method: 'POST',
15
15
  headers: { 'Content-Type': 'application/json' },
16
- body: JSON.stringify(
17
- { form: {
16
+ body: JSON.stringify({
17
+ form: {
18
18
  locale: 'nl',
19
19
  content: values,
20
- }},
21
- )
20
+ },
21
+ }),
22
22
  }).then((resp) => {
23
23
  if (resp.ok === true) {
24
24
  alert('Form has been sent!');
25
- actions.resetForm({ values: {}})
25
+ actions.resetForm({ values: {} });
26
26
  } else {
27
- alert('Please try again later.');
27
+ alert('Please try again later.');
28
28
  }
29
29
  });
30
30
  actions.setSubmitting(false);
@@ -32,8 +32,10 @@ const Form = ({ options }) => {
32
32
  }}
33
33
  render={({ values, errors, handleBlur, handleChange, handleSubmit }) => (
34
34
  <FormContainer>
35
- <form onSubmit={handleSubmit}>
36
- {form.options.fields.map(field => {
35
+ <form
36
+ onSubmit={handleSubmit}
37
+ >
38
+ {form.options.fields.map((field) => {
37
39
  if (field.type === 'select') {
38
40
  return (
39
41
  <div key={field.model}>
@@ -45,7 +47,7 @@ const Form = ({ options }) => {
45
47
  value={values[field.model]}
46
48
  name={field.model}
47
49
  >
48
- {field.values.map(opt => (
50
+ {field.values.map((opt) => (
49
51
  <option key={opt.option_value} value={opt.option_value}>
50
52
  {opt.label}
51
53
  </option>
@@ -54,14 +56,19 @@ const Form = ({ options }) => {
54
56
  </div>
55
57
  );
56
58
  } else if (field.type === 'textarea') {
57
- return <div key={field.model}>
58
- <label htmlFor={field.model}>
59
- {field.label}
60
- </label>
61
- <textarea id={field.model} onChange={handleChange} onBlur={handleBlur} value={values[field.model]} name={field.model} rows="5">
62
-
63
- </textarea>
64
- </div>;
59
+ return (
60
+ <div key={field.model}>
61
+ <label htmlFor={field.model}>{field.label}</label>
62
+ <textarea
63
+ id={field.model}
64
+ onChange={handleChange}
65
+ onBlur={handleBlur}
66
+ value={values[field.model]}
67
+ name={field.model}
68
+ rows="5"
69
+ ></textarea>
70
+ </div>
71
+ );
65
72
  } else {
66
73
  return (
67
74
  <div key={field.model}>
@@ -84,7 +91,9 @@ const Form = ({ options }) => {
84
91
  );
85
92
  }
86
93
  })}
87
- <button type="submit">Verzenden</button>
94
+ <button type="submit" disabled={isSubmitting}>
95
+ Verzenden
96
+ </button>
88
97
  </form>
89
98
  </FormContainer>
90
99
  )}
@@ -136,6 +145,6 @@ const FormContainer = styled.div`
136
145
  font-size: 1.4rem;
137
146
  line-height: 1.4;
138
147
  font-weight: bold;
139
- background: ${props => props.theme.primaryColor};
148
+ background: ${(props) => props.theme.primaryColor};
140
149
  }
141
150
  `;