make it make sense now
All checks were successful
Build and Deploy Docker Image / build (push) Successful in 53s

close dialog after someone clicks subscribe

fix:

adjust v

adjust revision

adjustments

adjustments

adjusting

fix

testing

testing

testing

testing

testing

tag

may work now

testing

testing

testing

testing

fix: owner

feat: favicon and title fix
This commit is contained in:
Mike 2024-10-21 21:16:18 -04:00 committed by mike
parent 8c06947ebe
commit 88d1556f78
4 changed files with 123 additions and 109 deletions

View file

@ -7,24 +7,26 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-docker
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v2
- name: Log in to Gitea Container Registry - name: Log in to Gitea Container Registry
run: echo "${{ secrets.GITEA_PASSWORD }}" | docker login ${{ secrets.GITEA_REGISTRY }} -u ${{ secrets.GITEA_USERNAME }} --password-stdin uses: docker/login-action@v3
with:
password: ${{ secrets.PASSWORD }}
username: ${{ secrets.USERNAME }}
registry: git.thecodedom.com
- name: Build and push Docker image - name: Build and push Docker image
uses: docker/build-push-action@v2 uses: docker/build-push-action@v6
with: with:
context: . context: .
push: true push: true
tags: ${{ secrets.GITEA_REGISTRY }}/smig/dotechbro-website:latest tags: git.thecodedom.com/dotechbro/dotechbro-website:latest
- name: Log out from Gitea Container Registry
run: docker logout ${{ secrets.GITEA_REGISTRY }}

View file

@ -1,17 +1,18 @@
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
<head>
<meta charset="UTF-8" />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
/>
<link rel="icon" type="image/svg+xml" href="/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Do Tech Bro</title>
</head>
<head> <body>
<meta charset="UTF-8" /> <div id="root"></div>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script type="module" src="/src/main.jsx"></script>
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> </body>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html> </html>

BIN
public/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

View file

@ -1,96 +1,107 @@
import React, { useState } from 'react'; import React, { useState } from "react";
import Dialog from '@mui/material/Dialog'; import Dialog from "@mui/material/Dialog";
import DialogActions from '@mui/material/DialogActions'; import DialogActions from "@mui/material/DialogActions";
import DialogContent from '@mui/material/DialogContent'; import DialogContent from "@mui/material/DialogContent";
import DialogContentText from '@mui/material/DialogContentText'; import DialogContentText from "@mui/material/DialogContentText";
import DialogTitle from '@mui/material/DialogTitle'; import DialogTitle from "@mui/material/DialogTitle";
import Button from '@mui/material/Button'; import Button from "@mui/material/Button";
import TextField from '@mui/material/TextField'; import TextField from "@mui/material/TextField";
const MailingListDialog = ({ open, onClose }) => { const MailingListDialog = ({ open, onClose }) => {
const [name, setName] = useState(''); const [name, setName] = useState("");
const [email, setEmail] = useState(''); const [email, setEmail] = useState("");
const [error, setError] = useState(''); const [error, setError] = useState("");
const [success, setSuccess] = useState(''); const [success, setSuccess] = useState("");
const handleSubmit = (e) => { const handleSubmit = (e) => {
e.preventDefault(); e.preventDefault();
setError(''); setError("");
setSuccess(''); setSuccess("");
const form = document.createElement('form'); const form = document.createElement("form");
form.action = 'https://tech.us9.list-manage.com/subscribe/post'; form.action = "https://tech.us9.list-manage.com/subscribe/post";
form.method = 'POST'; form.method = "POST";
form.target = '_blank'; form.target = "_blank";
const hiddenFields = { const hiddenFields = {
u: 'aaf43cf1740b320b738dade27', u: "aaf43cf1740b320b738dade27",
id: '344e2f39e6', id: "344e2f39e6",
MERGE1: name, MERGE1: name,
MERGE0: email, MERGE0: email,
};
Object.keys(hiddenFields).forEach((key) => {
const input = document.createElement('input');
input.type = 'hidden';
input.name = key;
input.value = hiddenFields[key];
form.appendChild(input);
});
document.body.appendChild(form);
form.submit();
document.body.removeChild(form);
setSuccess('Thank you for subscribing!');
setName('');
setEmail('');
}; };
return ( Object.keys(hiddenFields).forEach((key) => {
<Dialog open={open} onClose={onClose}> const input = document.createElement("input");
<DialogTitle>Join Our Mailing List</DialogTitle> input.type = "hidden";
<DialogContent> input.name = key;
<DialogContentText> input.value = hiddenFields[key];
Stay updated with the latest news and updates from Do Tech Bro. form.appendChild(input);
</DialogContentText> });
<TextField
autoFocus document.body.appendChild(form);
margin="dense" form.submit();
id="name" document.body.removeChild(form);
label="Name"
type="text" setSuccess("Thank you for subscribing!");
fullWidth setName("");
variant="outlined" setEmail("");
value={name} onClose();
onChange={(e) => setName(e.target.value)} };
/>
<TextField return (
margin="dense" <Dialog open={open} onClose={onClose}>
id="email" <DialogTitle>Join Our Mailing List</DialogTitle>
label="Email Address" <DialogContent>
type="email" <DialogContentText>
fullWidth Stay updated with the latest news and updates from Do Tech Bro.
variant="outlined" </DialogContentText>
value={email} <TextField
onChange={(e) => setEmail(e.target.value)} autoFocus
/> margin="dense"
<DialogContentText className="mt-2 text-xs text-gray-600"> id="name"
We promise not to sell your information or email you more than once or twice a month. label="Name"
</DialogContentText> type="text"
{error && <DialogContentText className="mt-2 text-xs text-red-600">{error}</DialogContentText>} fullWidth
{success && <DialogContentText className="mt-2 text-xs text-green-600">{success}</DialogContentText>} variant="outlined"
</DialogContent> value={name}
<DialogActions> onChange={(e) => setName(e.target.value)}
<Button onClick={onClose} color="primary"> />
Cancel <TextField
</Button> margin="dense"
<Button onClick={handleSubmit} color="primary"> id="email"
Subscribe label="Email Address"
</Button> type="email"
</DialogActions> fullWidth
</Dialog> variant="outlined"
); value={email}
onChange={(e) => setEmail(e.target.value)}
/>
<DialogContentText className="mt-2 text-xs text-gray-600">
We promise not to sell your information or email you more than once or
twice a month.
</DialogContentText>
{error && (
<DialogContentText className="mt-2 text-xs text-red-600">
{error}
</DialogContentText>
)}
{success && (
<DialogContentText className="mt-2 text-xs text-green-600">
{success}
</DialogContentText>
)}
</DialogContent>
<DialogActions>
<Button onClick={onClose} color="primary">
Cancel
</Button>
<Button onClick={handleSubmit} color="primary">
Subscribe
</Button>
</DialogActions>
</Dialog>
);
}; };
export default MailingListDialog; export default MailingListDialog;