From 68f5f3b2858ea68407faedbf96a05e47be0090b6 Mon Sep 17 00:00:00 2001 From: BFlat Date: Sun, 2 Oct 2022 00:27:18 +0700 Subject: [PATCH] contact form styling and mobile menu button --- package.json | 3 - packages/storyteller-home/package.json | 4 +- packages/storyteller-home/src/App.scss | 4 + .../storyteller-home/src/common/TopNav.tsx | 16 +- .../src/pages/index/IndexPage.tsx | 141 ++++++++++-------- 5 files changed, 98 insertions(+), 70 deletions(-) diff --git a/package.json b/package.json index b6b8cf1165..37ee67fffb 100644 --- a/package.json +++ b/package.json @@ -25,8 +25,5 @@ "devDependencies": { "craco": "^0.0.3", "lerna": "^4.0.0" - }, - "dependencies": { - "@formspree/react": "^2.4.0" } } diff --git a/packages/storyteller-home/package.json b/packages/storyteller-home/package.json index 608d1eea61..b93482c719 100644 --- a/packages/storyteller-home/package.json +++ b/packages/storyteller-home/package.json @@ -9,6 +9,7 @@ "@fortawesome/free-brands-svg-icons": "^6.1.1", "@fortawesome/free-solid-svg-icons": "^6.1.1", "@fortawesome/react-fontawesome": "^0.2.0", + "@formspree/react": "^2.4.0", "@testing-library/jest-dom": "^5.16.1", "@testing-library/react": "^9.5.0", "@testing-library/user-event": "^13.5.0", @@ -34,7 +35,8 @@ "@tippyjs/react": "^4.2.6", "gsap": "^3.11.0", "split-type": "^0.3.2", - "swiper": "^8.3.2" + "swiper": "^8.3.2", + "react-toastify": "^9.0.8" }, "scripts": { "start": "craco start", diff --git a/packages/storyteller-home/src/App.scss b/packages/storyteller-home/src/App.scss index 083093e963..4e52988cd5 100644 --- a/packages/storyteller-home/src/App.scss +++ b/packages/storyteller-home/src/App.scss @@ -1022,6 +1022,10 @@ span.swiper-pagination-bullet.swiper-pagination-bullet-active { --swiper-theme-color: #fa6b68 !important; } +.contact-container { + max-width: 700px; +} + @media (max-width: 1199.98px) { .hero-img { padding-top: 100px; diff --git a/packages/storyteller-home/src/common/TopNav.tsx b/packages/storyteller-home/src/common/TopNav.tsx index 059e92cad1..d90a7b78e5 100644 --- a/packages/storyteller-home/src/common/TopNav.tsx +++ b/packages/storyteller-home/src/common/TopNav.tsx @@ -1,7 +1,7 @@ import { useLocomotiveScroll } from "react-locomotive-scroll"; import React, { useState, useEffect } from "react"; -interface Props { } +interface Props {} function TopNav(props: Props) { const { scroll } = useLocomotiveScroll(); @@ -106,7 +106,9 @@ function TopNav(props: Props) {
- Contact + + Contact +
@@ -159,6 +161,16 @@ function TopNav(props: Props) { Mentions +
  • + + Contact + +
  • diff --git a/packages/storyteller-home/src/pages/index/IndexPage.tsx b/packages/storyteller-home/src/pages/index/IndexPage.tsx index 124f69fdd7..db5c26013a 100644 --- a/packages/storyteller-home/src/pages/index/IndexPage.tsx +++ b/packages/storyteller-home/src/pages/index/IndexPage.tsx @@ -32,9 +32,9 @@ import { Swiper, SwiperSlide } from "swiper/react"; import "swiper/css"; import "swiper/css/pagination"; import { Autoplay, Pagination } from "swiper"; -import { useForm, ValidationError } from '@formspree/react'; -import { ToastContainer, toast } from 'react-toastify'; -import 'react-toastify/dist/ReactToastify.css'; +import { useForm, ValidationError } from "@formspree/react"; +import { ToastContainer, toast } from "react-toastify"; +import "react-toastify/dist/ReactToastify.css"; function IndexPage() { // Title Animation @@ -135,18 +135,20 @@ function IndexPage() { const [state, handleSubmit] = useForm("xnqrvjbo"); if (state.succeeded) { - const reset = document.getElementById("reset") - const success = document.getElementById('success_message') + const reset = document.getElementById("reset"); + const success = document.getElementById("success_message"); - if (reset) reset.click() + if (reset) reset.click(); setTimeout(function () { - if (success) success.innerHTML = '

    Thank you for your message!

    ' - }, 500) + if (success) + success.innerHTML = + '
    Thank you for your message!
    '; + }, 500); setTimeout(function () { - if (success) success.innerHTML = '' - }, 5000) + if (success) success.innerHTML = ""; + }, 5000); } return ( @@ -1112,64 +1114,75 @@ function IndexPage() {
    -

    Contact Us

    -
    -
    -
    - - - - -
    -
    -