+
{form.submitted_text ?? "Thanks for your response!"}
Return Home
--
cgit v1.2.3
From 8d3469e69d1030b5d83108c6e967bffbb9e1d9a9 Mon Sep 17 00:00:00 2001
From: ks129 <45097959+ks129@users.noreply.github.com>
Date: Thu, 21 Jan 2021 20:13:51 +0200
Subject: Use relative units
---
src/commonStyles.tsx | 4 ++--
src/components/ErrorMessage.tsx | 6 +++---
src/pages/FormPage.tsx | 3 ++-
3 files changed, 7 insertions(+), 6 deletions(-)
(limited to 'src/pages')
diff --git a/src/commonStyles.tsx b/src/commonStyles.tsx
index cbfc40a..2caa77e 100644
--- a/src/commonStyles.tsx
+++ b/src/commonStyles.tsx
@@ -54,8 +54,8 @@ const textInputs = css`
const invalidStyles = css`
.invalid-box {
-webkit-appearance: none;
- -webkit-box-shadow: 0 0 10px ${colors.error};
- box-shadow: 0 0 10px ${colors.error};
+ -webkit-box-shadow: 0 0 0.6rem ${colors.error};
+ box-shadow: 0 0 0.6rem ${colors.error};
border: none;
}
`;
diff --git a/src/components/ErrorMessage.tsx b/src/components/ErrorMessage.tsx
index 55e3759..1cf3cbc 100644
--- a/src/components/ErrorMessage.tsx
+++ b/src/components/ErrorMessage.tsx
@@ -9,9 +9,9 @@ interface ErrorMessageProps {
const styles = css`
color: ${colors.error};
- font-size: 18px;
- line-height: 15px;
- margin: 15px 0 0;
+ font-size: 1.15rem;
+ line-height: 1.1rem;
+ margin: 1rem 0 0;
`;
export default function ErrorMessage(props: ErrorMessageProps): JSX.Element|null {
diff --git a/src/pages/FormPage.tsx b/src/pages/FormPage.tsx
index 72b073f..21303ab 100644
--- a/src/pages/FormPage.tsx
+++ b/src/pages/FormPage.tsx
@@ -107,11 +107,12 @@ function FormPage(): JSX.Element {
useEffect(() => {
getForm(id).then(form => {
setForm(form);
+ setSent(true);
});
}, []);
if (form && sent) {
- const thanksStyle = css`font-family: "Uni Sans", "Hind", "Arial", sans-serif; margin-top: 250px;`;
+ const thanksStyle = css`font-family: "Uni Sans", "Hind", "Arial", sans-serif; margin-top: 15.5rem;`;
const divStyle = css`width: 80%;`;
return (
--
cgit v1.2.3
From 646469028115dd7005e2a4427d55adc9f4150aa4 Mon Sep 17 00:00:00 2001
From: ks129 <45097959+ks129@users.noreply.github.com>
Date: Sat, 23 Jan 2021 15:38:11 +0200
Subject: Remove debugging setSent
---
src/pages/FormPage.tsx | 1 -
1 file changed, 1 deletion(-)
(limited to 'src/pages')
diff --git a/src/pages/FormPage.tsx b/src/pages/FormPage.tsx
index 21303ab..36ca86f 100644
--- a/src/pages/FormPage.tsx
+++ b/src/pages/FormPage.tsx
@@ -107,7 +107,6 @@ function FormPage(): JSX.Element {
useEffect(() => {
getForm(id).then(form => {
setForm(form);
- setSent(true);
});
}, []);
--
cgit v1.2.3
From e221e20a82411dabc4d6c21172f0c68badc64364 Mon Sep 17 00:00:00 2001
From: ks129 <45097959+ks129@users.noreply.github.com>
Date: Thu, 28 Jan 2021 19:31:25 +0200
Subject: Remove unnecessary separator from sent form return home button
---
src/commonStyles.tsx | 10 ----------
src/pages/FormPage.tsx | 12 ++++++++++--
2 files changed, 10 insertions(+), 12 deletions(-)
(limited to 'src/pages')
diff --git a/src/commonStyles.tsx b/src/commonStyles.tsx
index 2caa77e..1136b34 100644
--- a/src/commonStyles.tsx
+++ b/src/commonStyles.tsx
@@ -93,15 +93,6 @@ const containerStyles = css`
}
`;
-const separatorStyles = css`
- height: 0;
- display: none;
-
- @media (max-width: 850px) {
- display: block;
- }
-`;
-
const returnStyles = css`
padding: 0.5rem 2rem;
border-radius: 8px;
@@ -126,6 +117,5 @@ export {
textInputs,
invalidStyles,
containerStyles,
- separatorStyles,
returnStyles
};
diff --git a/src/pages/FormPage.tsx b/src/pages/FormPage.tsx
index 36ca86f..abb008f 100644
--- a/src/pages/FormPage.tsx
+++ b/src/pages/FormPage.tsx
@@ -13,7 +13,7 @@ import ScrollToTop from "../components/ScrollToTop";
import { Form, FormFeatures, getForm } from "../api/forms";
import colors from "../colors";
-import { unselectable, containerStyles, separatorStyles, returnStyles } from "../commonStyles";
+import { unselectable, containerStyles, returnStyles } from "../commonStyles";
import { Question, QuestionType } from "../api/question";
import ApiClient from "../api/client";
@@ -27,6 +27,15 @@ interface NavigationProps {
}
class Navigation extends React.Component
{
+ separatorStyles = css`
+ height: 0;
+ display: none;
+
+ @media (max-width: 850px) {
+ display: block;
+ }
+ `;
+
submitStyles = css`
text-align: right;
white-space: nowrap;
@@ -121,7 +130,6 @@ function FormPage(): JSX.Element {
Return Home
-
);
--
cgit v1.2.3
From 978754f9bc81d0d836ddea6656af4a3dadce5248 Mon Sep 17 00:00:00 2001
From: ks129 <45097959+ks129@users.noreply.github.com>
Date: Thu, 28 Jan 2021 19:34:15 +0200
Subject: Move container and return styles back to FormPage
---
src/commonStyles.tsx | 53 +-------------------------------------------------
src/pages/FormPage.tsx | 52 +++++++++++++++++++++++++++++++++++++++++++++++--
2 files changed, 51 insertions(+), 54 deletions(-)
(limited to 'src/pages')
diff --git a/src/commonStyles.tsx b/src/commonStyles.tsx
index 1136b34..57002a9 100644
--- a/src/commonStyles.tsx
+++ b/src/commonStyles.tsx
@@ -60,62 +60,11 @@ const invalidStyles = css`
}
`;
-const containerStyles = css`
- margin: auto;
- width: 50%;
-
- text-align: center;
- font-size: 1.5rem;
-
- > div {
- display: inline-block;
- margin: 2rem auto;
- width: 50%;
- }
-
- @media (max-width: 850px) {
- width: 100%;
-
- > div {
- display: flex;
- justify-content: center;
-
- margin: 0 auto;
- }
- }
-
- .return_button {
- text-align: left;
- }
-
- .return_button.closed {
- text-align: center;
- }
-`;
-
-const returnStyles = css`
- padding: 0.5rem 2rem;
- border-radius: 8px;
-
- color: white;
- text-decoration: none;
- white-space: nowrap;
-
- background-color: ${colors.greyple};
- transition: background-color 300ms;
-
- :hover {
- background-color: ${colors.darkerGreyple};
- }
-`;
-
export {
selectable,
unselectable,
hiddenInput,
multiSelectInput,
textInputs,
- invalidStyles,
- containerStyles,
- returnStyles
+ invalidStyles
};
diff --git a/src/pages/FormPage.tsx b/src/pages/FormPage.tsx
index abb008f..de80e8a 100644
--- a/src/pages/FormPage.tsx
+++ b/src/pages/FormPage.tsx
@@ -13,10 +13,58 @@ import ScrollToTop from "../components/ScrollToTop";
import { Form, FormFeatures, getForm } from "../api/forms";
import colors from "../colors";
-import { unselectable, containerStyles, returnStyles } from "../commonStyles";
+import { unselectable } from "../commonStyles";
import { Question, QuestionType } from "../api/question";
import ApiClient from "../api/client";
+const containerStyles = css`
+ margin: auto;
+ width: 50%;
+
+ text-align: center;
+ font-size: 1.5rem;
+
+ > div {
+ display: inline-block;
+ margin: 2rem auto;
+ width: 50%;
+ }
+
+ @media (max-width: 850px) {
+ width: 100%;
+
+ > div {
+ display: flex;
+ justify-content: center;
+
+ margin: 0 auto;
+ }
+ }
+
+ .return_button {
+ text-align: left;
+ }
+
+ .return_button.closed {
+ text-align: center;
+ }
+`;
+
+const returnStyles = css`
+ padding: 0.5rem 2rem;
+ border-radius: 8px;
+
+ color: white;
+ text-decoration: none;
+ white-space: nowrap;
+
+ background-color: ${colors.greyple};
+ transition: background-color 300ms;
+
+ :hover {
+ background-color: ${colors.darkerGreyple};
+ }
+`;
interface PathParams {
id: string
@@ -74,7 +122,7 @@ class Navigation extends React.Component