cmspageblocks 1.0.45 → 1.0.46

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cmspageblocks",
3
- "version": "1.0.45",
3
+ "version": "1.0.46",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "repository": {
@@ -2,6 +2,7 @@ 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
+ import { ButtonStyle } from './Styling/ButtonStyle';
5
6
 
6
7
  const Form = ({ options }) => {
7
8
  const form = options.content;
@@ -22,9 +23,9 @@ const Form = ({ options }) => {
22
23
  }).then((resp) => {
23
24
  if (resp.ok === true) {
24
25
  alert('Form has been sent!');
25
- actions.resetForm({ values: {} });
26
+ actions.resetForm({ values: {} });
26
27
  } else {
27
- alert('Please try again later.');
28
+ alert('Please try again later.');
28
29
  }
29
30
  });
30
31
  actions.setSubmitting(false);
@@ -32,9 +33,7 @@ const Form = ({ options }) => {
32
33
  }}
33
34
  render={({ values, errors, handleBlur, handleChange, handleSubmit }) => (
34
35
  <FormContainer>
35
- <form
36
- onSubmit={handleSubmit}
37
- >
36
+ <form onSubmit={handleSubmit}>
38
37
  {form.options.fields.map((field) => {
39
38
  if (field.type === 'select') {
40
39
  return (
@@ -91,9 +90,9 @@ const Form = ({ options }) => {
91
90
  );
92
91
  }
93
92
  })}
94
- <button type="submit" disabled={isSubmitting}>
93
+ <ButtonStyle type="submit" disabled={isSubmitting}>
95
94
  Verzenden
96
- </button>
95
+ </ButtonStyle>
97
96
  </form>
98
97
  </FormContainer>
99
98
  )}
@@ -138,13 +137,5 @@ const FormContainer = styled.div`
138
137
  width: 100%;
139
138
  appearance: none;
140
139
  border: 1px solid rgba(0, 0, 0, 0.25);
141
- }
142
- button {
143
- border: 0;
144
- padding: 8px 16px;
145
- font-size: 1.4rem;
146
- line-height: 1.4;
147
- font-weight: bold;
148
- background: ${(props) => props.theme.primaryColor};
149
- }
140
+ }
150
141
  `;
@@ -0,0 +1,45 @@
1
+ import styled from 'styled-components';
2
+
3
+ export const ButtonStyle = styled.button`
4
+ display: block;
5
+ padding: 12px 24px !important;
6
+ border-radius: 12px;
7
+ color: #fff !important;
8
+ color: ${(props) => (props.purple ? '#642C8F' : '#000')};
9
+ border: 2px solid
10
+ ${(props) =>
11
+ props.theme.primaryColor ? props.theme.primaryColor : '#642C8F'};
12
+ font-weight: bold;
13
+ text-decoration: none;
14
+ box-shadow: -2px 2px 4px rgba(0, 0, 0, 0.25);
15
+ transition: all 0.5s ease;
16
+ width: fit-content;
17
+ position: relative;
18
+ overflow: hidden;
19
+ z-index: 1;
20
+ cursor: pointer;
21
+ &:before {
22
+ background-color: ${(props) =>
23
+ props.theme.primaryColor
24
+ ? props.theme.primaryColor
25
+ : props.theme.primaryColor} !important;
26
+ width: 100% !important;
27
+ position: absolute;
28
+ right: 0;
29
+ top: 0;
30
+ content: '';
31
+ height: 100% !important;
32
+ z-index: -1;
33
+ transition: all 0.5s ease;
34
+ }
35
+ &:hover {
36
+ border: 2px solid
37
+ ${(props) => (props.purple ? '#642C8F' : props.theme.primaryColor)};
38
+ box-shadow: -1px 1px 4px rgba(0, 0, 0, 0.25);
39
+ color: ${(props) => props.theme.primaryColor} !important;
40
+ &:before {
41
+ width: 1px !important;
42
+ right: -1px;
43
+ }
44
+ }
45
+ `;