Loads of fixes

This commit is contained in:
Tom Butcher 2025-03-25 22:52:10 +00:00
parent 221decc8bc
commit 1eb937ee54
9 changed files with 48 additions and 35 deletions

View File

@ -1,4 +1,4 @@
import { useState } from "react"; import { useState, useEffect } from "react";
import { Modal } from "antd"; import { Modal } from "antd";
import Turnstile from "react-turnstile"; import Turnstile from "react-turnstile";

View File

@ -71,7 +71,13 @@ const BlogView = ({ setCurrentView, slug }) => {
className={"tbbutton"} className={"tbbutton"}
key="back" key="back"
onClick={() => setCurrentView("blogs")} onClick={() => setCurrentView("blogs")}
icon={<ArrowLeftOutlined />} icon={
<img
src="https://cdn.tombutcher.work/icons/web/w-back.svg"
alt="Back"
style={{ height: "14px", marginBottom: "1px" }}
/>
}
> >
Back Back
</Button>, </Button>,

View File

@ -92,7 +92,13 @@ const BlogsView = ({ setCurrentView }) => {
className={"tbbutton"} className={"tbbutton"}
key="back" key="back"
onClick={() => setCurrentView("index")} onClick={() => setCurrentView("index")}
icon={<ArrowLeftOutlined />} icon={
<img
src="https://cdn.tombutcher.work/icons/web/w-back.svg"
alt="Back"
style={{ height: "14px", marginBottom: "1px" }}
/>
}
> >
Back Back
</Button>, </Button>,
@ -195,19 +201,5 @@ const BlogsView = ({ setCurrentView }) => {
); );
}; };
// CSS for hover effect
const blogCardStyles = `
.blog-card:hover {
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.tbtag {
background: transparent !important;
}
.tbdisabledtag {
background: transparent !important;
}
`;
export default BlogsView; export default BlogsView;

View File

@ -11,7 +11,7 @@ const CVView = ({ setCurrentView }) => {
console.log("Form values:", values); console.log("Form values:", values);
}; };
const isMobile = useMediaQuery({ maxWidth: 600 }); const isMobile = useMediaQuery({ maxWidth: 600 });
const [isEmailFocused, setIsEmailFocused] = useState(false); // Track focus state
return ( return (
<div className="tbview"> <div className="tbview">
<Card <Card
@ -26,7 +26,13 @@ const CVView = ({ setCurrentView }) => {
className={"tbbutton"} className={"tbbutton"}
key="back" key="back"
onClick={() => setCurrentView("index")} onClick={() => setCurrentView("index")}
icon={<ArrowLeftOutlined />} icon={
<img
src="https://cdn.tombutcher.work/icons/web/w-back.svg"
alt="Back"
style={{ height: "14px", marginBottom: "1px" }}
/>
}
> >
Back Back
</Button>, </Button>,
@ -60,8 +66,6 @@ const CVView = ({ setCurrentView }) => {
type="email" type="email"
placeholder="example@example.com" placeholder="example@example.com"
style={{ flex: 1 }} style={{ flex: 1 }}
onFocus={() => setIsEmailFocused(true)} // Set focused state to true
onBlur={() => setIsEmailFocused(false)} // Set focused state to false
/> />
<Button type="primary" htmlType="submit"> <Button type="primary" htmlType="submit">
<CloudDownloadOutlined /> <CloudDownloadOutlined />
@ -95,8 +99,6 @@ const CVView = ({ setCurrentView }) => {
type="email" type="email"
placeholder="example@example.com" placeholder="example@example.com"
style={{ flex: 1 }} style={{ flex: 1 }}
onFocus={() => setIsEmailFocused(true)} // Set focused state to true
onBlur={() => setIsEmailFocused(false)} // Set focused state to false
/> />
<Button type="primary" htmlType="submit"> <Button type="primary" htmlType="submit">
<CloudDownloadOutlined /> <CloudDownloadOutlined />

View File

@ -9,12 +9,14 @@ const ContactView = ({ setCurrentView }) => {
const [turnstileOpen, setTurnstileOpen] = useState(false); const [turnstileOpen, setTurnstileOpen] = useState(false);
const [email, setEmail] = useState(""); const [email, setEmail] = useState("");
const handleSubmit = async (token) => { const handleSubmit = async (token) => {
console.log(token);
if (!token) { if (!token) {
setTurnstileOpen(true); // Open Turnstile modal setTurnstileOpen(true); // Open Turnstile modal
return; return;
} }
console.log("Got token", token);
console.log("Got email", email);
try { try {
const response = await fetch("https://web.tombutcher.work/api/contact", { const response = await fetch("https://web.tombutcher.work/api/contact", {
method: "POST", method: "POST",
@ -46,7 +48,13 @@ const ContactView = ({ setCurrentView }) => {
className={"tbbutton"} className={"tbbutton"}
key="back" key="back"
onClick={() => setCurrentView("index")} onClick={() => setCurrentView("index")}
icon={<ArrowLeftOutlined />} icon={
<img
src="https://cdn.tombutcher.work/icons/web/w-back.svg"
alt="Back"
style={{ height: "14px", marginBottom: "1px" }}
/>
}
> >
Back Back
</Button>, </Button>,
@ -65,6 +73,7 @@ const ContactView = ({ setCurrentView }) => {
name="email" name="email"
rules={[{ required: true, message: "Please enter your email" }]} rules={[{ required: true, message: "Please enter your email" }]}
style={{ marginBottom: "8px" }} style={{ marginBottom: "8px" }}
onChange={(e) => setEmail(e.target.value)}
> >
<Flex gap="small"> <Flex gap="small">
<Input <Input

View File

@ -18,7 +18,13 @@ const ExperienceView = ({ setCurrentView }) => {
className={"tbbutton"} className={"tbbutton"}
key="back" key="back"
onClick={() => setCurrentView("index")} onClick={() => setCurrentView("index")}
icon={<ArrowLeftOutlined />} icon={
<img
src="https://cdn.tombutcher.work/icons/web/w-back.svg"
alt="Back"
style={{ height: "14px", marginBottom: "1px" }}
/>
}
> >
Back Back
</Button>, </Button>,
@ -30,27 +36,27 @@ const ExperienceView = ({ setCurrentView }) => {
style={{ margin: "0 10%", paddingBottom: "15px" }} style={{ margin: "0 10%", paddingBottom: "15px" }}
> >
<img <img
src={`https://cdn.tombutcher.work/logos/nucleus-logo.svg`} src={"https://cdn.tombutcher.work/logos/nucleus-logo.svg"}
alt="Nucleus Logo" alt="Nucleus Logo"
height={"80px"} height={"80px"}
/> />
<img <img
src={`https://cdn.tombutcher.work/logos/greeneking-logo.svg`} src={"https://cdn.tombutcher.work/logos/greeneking-logo.svg"}
alt="Greene King Logo" alt="Greene King Logo"
height={"60px"} height={"60px"}
/> />
<img <img
src={`https://cdn.tombutcher.work/logos/thelondonoffice-logo.svg`} src={"https://cdn.tombutcher.work/logos/thelondonoffice-logo.svg"}
alt="The London Office Logo" alt="The London Office Logo"
height={"55px"} height={"55px"}
/> />
<img <img
src={`https://cdn.tombutcher.work/logos/revolution-logo.svg`} src={"https://cdn.tombutcher.work/logos/revolution-logo.svg"}
alt="Revolution Logo" alt="Revolution Logo"
height={"65px"} height={"65px"}
/> />
<img <img
src={`https://cdn.tombutcher.work/logos/istore-logo.svg`} src={"https://cdn.tombutcher.work/logos/istore-logo.svg"}
alt="Revolution Logo" alt="Revolution Logo"
height={"40px"} height={"40px"}
/> />

View File

@ -1,11 +1,10 @@
// views/MainView.jsx // views/MainView.jsx
import React from "react"; import React from "react";
import { Typography, Button, Flex, Space } from "antd"; import { Button, Flex } from "antd";
import { ReactComponent as LogoHorizontal } from "./logo-horizontal.svg"; import { ReactComponent as LogoHorizontal } from "./logo-horizontal.svg";
import { ReactComponent as LogoVertical } from "./logo-vertical.svg"; import { ReactComponent as LogoVertical } from "./logo-vertical.svg";
import { useMediaQuery } from "react-responsive"; import { useMediaQuery } from "react-responsive";
const { Paragraph } = Typography;
const MainView = ({ setCurrentView }) => { const MainView = ({ setCurrentView }) => {
const isMobile = useMediaQuery({ maxWidth: 600 }); const isMobile = useMediaQuery({ maxWidth: 600 });

View File

@ -1,6 +1,5 @@
import React from "react"; import React from "react";
import { Button, Flex } from "antd"; import { Button, Flex } from "antd";
import { useMediaQuery } from "react-responsive";
const NotFoundView = ({ setCurrentView }) => { const NotFoundView = ({ setCurrentView }) => {
return ( return (

View File

@ -7,7 +7,7 @@ import { LoadingOutlined } from "@ant-design/icons";
import { useEffect } from "react"; import { useEffect } from "react";
import * as FaIcons from "react-icons/fa6"; // Import all FA6 icons dynamically import * as FaIcons from "react-icons/fa6"; // Import all FA6 icons dynamically
const SocialsView = ({ setCurrentView, referrer }) => { const SocialsView = ({ referrer }) => {
const isMobile = useMediaQuery({ maxWidth: 600 }); const isMobile = useMediaQuery({ maxWidth: 600 });
const [socials, setSocials] = useState([]); const [socials, setSocials] = useState([]);
const [loading, setLoading] = useState(true); // Loading state const [loading, setLoading] = useState(true); // Loading state