mirror of
https://github.com/BradNut/weddingsite
synced 2025-09-08 17:40:36 +00:00
Updating dependencies and removing unused vars.
This commit is contained in:
parent
6ac507e1f1
commit
57092ea420
13 changed files with 1405 additions and 1181 deletions
|
|
@ -27,7 +27,7 @@ export default function Event({ event }) {
|
||||||
venueName,
|
venueName,
|
||||||
attire,
|
attire,
|
||||||
description,
|
description,
|
||||||
openToAll,
|
// openToAll,
|
||||||
showSchedule,
|
showSchedule,
|
||||||
scheduleEvents,
|
scheduleEvents,
|
||||||
} = event;
|
} = event;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
import { useState } from 'react';
|
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import PlusOneRSVP from './PlusOneRSVP';
|
import PlusOneRSVP from './PlusOneRSVP';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ const HeaderStyles = styled.header`
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const Header = () => {
|
const Header = () => {
|
||||||
const { user, mutateUser } = useUser();
|
const { user } = useUser();
|
||||||
return (
|
return (
|
||||||
<HeaderStyles>
|
<HeaderStyles>
|
||||||
<div>
|
<div>
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ const FormStyles = styled.form`
|
||||||
const Login = () => {
|
const Login = () => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const { inputs, handleChange, clearForm, resetForm } = useForm({
|
const { inputs, handleChange } = useForm({
|
||||||
username: 'weddinguser',
|
username: 'weddinguser',
|
||||||
password: '',
|
password: '',
|
||||||
penguin: 'penguin',
|
penguin: 'penguin',
|
||||||
|
|
@ -105,7 +105,7 @@ const Login = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await mutateUser(
|
await mutateUser(
|
||||||
fetchJson('/api/login', {
|
fetchJson('/api/login', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
import { useState } from 'react';
|
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
|
||||||
const PlusOneStyles = styled.div`
|
const PlusOneStyles = styled.div`
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ function useWeddingStart({ update = 60000 }) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function WeddingStart() {
|
export default function WeddingStart() {
|
||||||
const { timeToWedding, timeAsDays } = useWeddingStart({
|
const { timeAsDays } = useWeddingStart({
|
||||||
update: 60000,
|
update: 60000,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
2525
package-lock.json
generated
2525
package-lock.json
generated
File diff suppressed because it is too large
Load diff
26
package.json
26
package.json
|
|
@ -10,7 +10,7 @@
|
||||||
"test": "NODE_ENV=test jest --watch"
|
"test": "NODE_ENV=test jest --watch"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@plaiceholder/next": "^2.2.0",
|
"@plaiceholder/next": "^2.3.0",
|
||||||
"@reach/dialog": "^0.16.2",
|
"@reach/dialog": "^0.16.2",
|
||||||
"@reach/portal": "^0.16.2",
|
"@reach/portal": "^0.16.2",
|
||||||
"@reach/visually-hidden": "^0.16.0",
|
"@reach/visually-hidden": "^0.16.0",
|
||||||
|
|
@ -18,35 +18,35 @@
|
||||||
"babel-plugin-styled-components": "^2.0.2",
|
"babel-plugin-styled-components": "^2.0.2",
|
||||||
"bcryptjs": "^2.4.3",
|
"bcryptjs": "^2.4.3",
|
||||||
"cloudinary-build-url": "^0.2.4",
|
"cloudinary-build-url": "^0.2.4",
|
||||||
"dotenv": "^14.3.2",
|
"dotenv": "^16.0.0",
|
||||||
"escape-html": "^1.0.3",
|
"escape-html": "^1.0.3",
|
||||||
"iron-session": "^6.0.5",
|
"iron-session": "^6.0.5",
|
||||||
"jsonwebtoken": "^8.5.1",
|
"jsonwebtoken": "^8.5.1",
|
||||||
"mongodb": "^4.3.1",
|
"mongodb": "^4.3.1",
|
||||||
"mongoose": "^6.1.8",
|
"mongoose": "^6.2.2",
|
||||||
"next": "^12.0.9",
|
"next": "^12.0.10",
|
||||||
"next-with-apollo": "^5.2.1",
|
"next-with-apollo": "^5.2.1",
|
||||||
"normalize.css": "^8.0.1",
|
"normalize.css": "^8.0.1",
|
||||||
"nprogress": "^0.2.0",
|
"nprogress": "^0.2.0",
|
||||||
"plaiceholder": "^2.2.0",
|
"plaiceholder": "^2.3.0",
|
||||||
"prop-types": "^15.8.1",
|
"prop-types": "^15.8.1",
|
||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
"react-dom": "^17.0.2",
|
"react-dom": "^17.0.2",
|
||||||
"react-icons": "^4.3.1",
|
"react-icons": "^4.3.1",
|
||||||
"sharp": "^0.29.3",
|
"sharp": "^0.30.1",
|
||||||
"styled-components": "^5.3.3",
|
"styled-components": "^5.3.3",
|
||||||
"swr": "^0.5.6",
|
"swr": "^0.5.6",
|
||||||
"waait": "^1.0.5"
|
"waait": "^1.0.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.16.12",
|
"@babel/core": "^7.17.4",
|
||||||
"@babel/preset-env": "^7.16.11",
|
"@babel/preset-env": "^7.16.11",
|
||||||
"@testing-library/jest-dom": "^5.16.1",
|
"@testing-library/jest-dom": "^5.16.2",
|
||||||
"@testing-library/react": "^12.1.2",
|
"@testing-library/react": "^12.1.3",
|
||||||
"@testing-library/user-event": "^13.5.0",
|
"@testing-library/user-event": "^13.5.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.10.1",
|
"@typescript-eslint/eslint-plugin": "^5.12.0",
|
||||||
"@typescript-eslint/parser": "^5.10.1",
|
"@typescript-eslint/parser": "^5.12.0",
|
||||||
"eslint": "^8.8.0",
|
"eslint": "^8.9.0",
|
||||||
"eslint-config-airbnb": "^19.0.4",
|
"eslint-config-airbnb": "^19.0.4",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.3.0",
|
||||||
"eslint-config-wesbos": "^3.0.2",
|
"eslint-config-wesbos": "^3.0.2",
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
"eslint-plugin-prettier": "^4.0.0",
|
"eslint-plugin-prettier": "^4.0.0",
|
||||||
"eslint-plugin-react": "^7.28.0",
|
"eslint-plugin-react": "^7.28.0",
|
||||||
"eslint-plugin-react-hooks": "^4.3.0",
|
"eslint-plugin-react-hooks": "^4.3.0",
|
||||||
"jest": "^27.4.7",
|
"jest": "^27.5.1",
|
||||||
"prettier": "^2.5.1",
|
"prettier": "^2.5.1",
|
||||||
"typescript": "^4.5.5"
|
"typescript": "^4.5.5"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ const LandingStyles = styled.div`
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export default function Home({ alt, imageProps }) {
|
export default function Home({ alt, imageProps }) {
|
||||||
const { user, mutateUser } = useUser();
|
const { user } = useUser();
|
||||||
|
|
||||||
if (!user) {
|
if (!user) {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { Router, useRouter } from 'next/router';
|
import { useRouter } from 'next/router';
|
||||||
import Layout from '../components/Layout';
|
import Layout from '../components/Layout';
|
||||||
import fetchJson from '../lib/fetchJson';
|
import fetchJson from '../lib/fetchJson';
|
||||||
import useUser from '../lib/useUser';
|
import useUser from '../lib/useUser';
|
||||||
|
|
@ -15,7 +15,7 @@ async function logout(router) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error();
|
console.error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,12 +22,12 @@ const FormStyles = styled.form`
|
||||||
export default function RegisterPage() {
|
export default function RegisterPage() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const { inputs, handleChange, clearForm, resetForm } = useForm({
|
const { inputs, handleChange } = useForm({
|
||||||
username: '',
|
username: '',
|
||||||
password: '',
|
password: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
const { mutateUser } = useUser({
|
useUser({
|
||||||
redirectTo: '/',
|
redirectTo: '/',
|
||||||
redirectIfFound: true,
|
redirectIfFound: true,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -173,8 +173,7 @@ export default function SingleGroupPage({ group }) {
|
||||||
return initial;
|
return initial;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { inputs, handleChange, clearForm, resetForm } =
|
const { inputs, handleChange } = useForm(getInitialFormData);
|
||||||
useForm(getInitialFormData);
|
|
||||||
|
|
||||||
if (!user || user.isLoggedIn === false) {
|
if (!user || user.isLoggedIn === false) {
|
||||||
return <Layout>Loading...</Layout>;
|
return <Layout>Loading...</Layout>;
|
||||||
|
|
@ -185,8 +184,8 @@ export default function SingleGroupPage({ group }) {
|
||||||
async function handleSubmit(groupId) {
|
async function handleSubmit(groupId) {
|
||||||
const keys = Object.keys(inputs);
|
const keys = Object.keys(inputs);
|
||||||
const guestData = [];
|
const guestData = [];
|
||||||
// console.log(JSON.stringify(inputs));
|
|
||||||
keys.forEach((key, index) => {
|
keys.forEach((key) => {
|
||||||
if (key !== 'note') {
|
if (key !== 'note') {
|
||||||
guestData.push({
|
guestData.push({
|
||||||
id: key,
|
id: key,
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ const ErrorContactStyles = styled.p`
|
||||||
export default function RsvpPage() {
|
export default function RsvpPage() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const { inputs, handleChange, clearForm, resetForm } = useForm({
|
const { inputs, handleChange } = useForm({
|
||||||
firstName: '',
|
firstName: '',
|
||||||
lastName: '',
|
lastName: '',
|
||||||
});
|
});
|
||||||
|
|
@ -31,13 +31,13 @@ export default function RsvpPage() {
|
||||||
const [errorCount, setErrorCount] = useState(0);
|
const [errorCount, setErrorCount] = useState(0);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
const { user, mutateUser } = useUser({ redirectTo: '/login' });
|
const { user } = useUser({ redirectTo: '/login' });
|
||||||
|
|
||||||
if (!user || user.isLoggedIn === false) {
|
if (!user || user.isLoggedIn === false) {
|
||||||
return <Layout>Loading...</Layout>;
|
return <Layout>Loading...</Layout>;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleSubmit(firstName, lastName, groupId) {
|
async function handleSubmit(firstName, lastName) {
|
||||||
const body = {
|
const body = {
|
||||||
firstName,
|
firstName,
|
||||||
lastName,
|
lastName,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue