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