mirror of
https://github.com/BradNut/weddingsite
synced 2025-09-08 17:40:36 +00:00
Rename to story, add webpack 5 to next, modify rsvp for test site.
This commit is contained in:
parent
80f287a24c
commit
4def277228
9 changed files with 1799 additions and 2574 deletions
6
.env
6
.env
|
|
@ -1,6 +0,0 @@
|
||||||
MONGO_URL=
|
|
||||||
SECRET_COOKIE_PASSWORD=fjdk47fh48djsk3jdh8f9hdjshaj3eu4
|
|
||||||
ROOT_DOMAIN=localhost:3000
|
|
||||||
NEXT_PUBLIC_CLOUD_NAME=
|
|
||||||
NEXT_PUBLIC_FOLDER_NAME=
|
|
||||||
SITE_ENV=TEST_SITE
|
|
||||||
|
|
@ -7,8 +7,8 @@ export default function Nav() {
|
||||||
<NavLink href="/">
|
<NavLink href="/">
|
||||||
<a>Home</a>
|
<a>Home</a>
|
||||||
</NavLink>
|
</NavLink>
|
||||||
<NavLink href="/cats">
|
<NavLink href="/story">
|
||||||
<a>Our Cats</a>
|
<a>Our Story</a>
|
||||||
</NavLink>
|
</NavLink>
|
||||||
<NavLink href="/party">
|
<NavLink href="/party">
|
||||||
<a>Wedding Party</a>
|
<a>Wedding Party</a>
|
||||||
|
|
|
||||||
|
|
@ -2,4 +2,7 @@ module.exports = {
|
||||||
images: {
|
images: {
|
||||||
domains: ['res.cloudinary.com', 'via.placeholder.com'],
|
domains: ['res.cloudinary.com', 'via.placeholder.com'],
|
||||||
},
|
},
|
||||||
|
future: {
|
||||||
|
webpack5: true,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
4198
package-lock.json
generated
4198
package-lock.json
generated
File diff suppressed because it is too large
Load diff
16
package.json
16
package.json
|
|
@ -15,8 +15,8 @@
|
||||||
"cloudinary-build-url": "^0.2.1",
|
"cloudinary-build-url": "^0.2.1",
|
||||||
"dotenv": "^10.0.0",
|
"dotenv": "^10.0.0",
|
||||||
"jsonwebtoken": "^8.5.1",
|
"jsonwebtoken": "^8.5.1",
|
||||||
"mongodb": "^3.6.8",
|
"mongodb": "^3.6.9",
|
||||||
"mongoose": "^5.12.11",
|
"mongoose": "^5.12.13",
|
||||||
"next": "^10.2.3",
|
"next": "^10.2.3",
|
||||||
"next-iron-session": "^4.1.13",
|
"next-iron-session": "^4.1.13",
|
||||||
"next-with-apollo": "^5.1.1",
|
"next-with-apollo": "^5.1.1",
|
||||||
|
|
@ -31,23 +31,23 @@
|
||||||
"waait": "^1.0.5"
|
"waait": "^1.0.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.13.13",
|
"@babel/core": "^7.14.3",
|
||||||
"@babel/preset-env": "^7.14.2",
|
"@babel/preset-env": "^7.14.2",
|
||||||
"@typescript-eslint/eslint-plugin": "^4.25.0",
|
"@typescript-eslint/eslint-plugin": "^4.25.0",
|
||||||
"@typescript-eslint/parser": "^4.25.0",
|
"@typescript-eslint/parser": "^4.25.0",
|
||||||
"babel-eslint": "^10.1.0",
|
"babel-eslint": "^10.1.0",
|
||||||
"eslint": "^7.27.0",
|
"eslint": "^7.27.0",
|
||||||
"eslint-config-airbnb": "^18.2.1",
|
"eslint-config-airbnb": "^18.2.1",
|
||||||
"eslint-config-prettier": "^7.1.0",
|
"eslint-config-prettier": "^8.3.0",
|
||||||
"eslint-config-wesbos": "^2.0.0-beta.5",
|
"eslint-config-wesbos": "^2.0.0-beta.7",
|
||||||
"eslint-plugin-html": "^6.1.2",
|
"eslint-plugin-html": "^6.1.2",
|
||||||
"eslint-plugin-import": "^2.23.3",
|
"eslint-plugin-import": "^2.23.4",
|
||||||
"eslint-plugin-jsx-a11y": "^6.4.1",
|
"eslint-plugin-jsx-a11y": "^6.4.1",
|
||||||
"eslint-plugin-prettier": "^3.4.0",
|
"eslint-plugin-prettier": "^3.4.0",
|
||||||
"eslint-plugin-react": "^7.23.2",
|
"eslint-plugin-react": "^7.24.0",
|
||||||
"eslint-plugin-react-hooks": "^4.2.0",
|
"eslint-plugin-react-hooks": "^4.2.0",
|
||||||
"prettier": "^2.3.0",
|
"prettier": "^2.3.0",
|
||||||
"typescript": "^4.2.4"
|
"typescript": "^4.3.2"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
"extends": [
|
"extends": [
|
||||||
|
|
|
||||||
|
|
@ -19,20 +19,20 @@ export default withSession(async (req, res) => {
|
||||||
// TODO: REMOVE THIS WHEN TAKING YOUR SITE TO PRODUCTION
|
// TODO: REMOVE THIS WHEN TAKING YOUR SITE TO PRODUCTION
|
||||||
if (process.env.SITE_ENV === 'TEST_SITE') {
|
if (process.env.SITE_ENV === 'TEST_SITE') {
|
||||||
res.status(200).json({ status: 'SUCCESS', groupId: 'TESTID_12345' });
|
res.status(200).json({ status: 'SUCCESS', groupId: 'TESTID_12345' });
|
||||||
}
|
} else {
|
||||||
|
await connectDb();
|
||||||
|
const { firstName, lastName } = await req.body;
|
||||||
|
|
||||||
await connectDb();
|
try {
|
||||||
const { firstName, lastName } = await req.body;
|
const result = await Guest.findOne({
|
||||||
|
firstName: { $regex: new RegExp(firstName.trim(), 'i') },
|
||||||
try {
|
lastName: { $regex: new RegExp(lastName.trim(), 'i') },
|
||||||
const result = await Guest.findOne({
|
});
|
||||||
firstName: { $regex: new RegExp(firstName.trim(), 'i') },
|
// console.log(JSON.stringify(result));
|
||||||
lastName: { $regex: new RegExp(lastName.trim(), 'i') },
|
res.status(200).json({ status: 'SUCCESS', groupId: result.group });
|
||||||
});
|
} catch (error) {
|
||||||
// console.log(JSON.stringify(result));
|
const { response: fetchResponse } = error;
|
||||||
res.status(200).json({ status: 'SUCCESS', groupId: result.group });
|
res.status(fetchResponse?.status || 500).json({ status: 'FAILURE' });
|
||||||
} catch (error) {
|
}
|
||||||
const { response: fetchResponse } = error;
|
|
||||||
res.status(fetchResponse?.status || 500).json({ status: 'FAILURE' });
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,80 +0,0 @@
|
||||||
import Head from 'next/head';
|
|
||||||
import { RiExternalLinkLine } from 'react-icons/ri';
|
|
||||||
import CustomNextImage from '../components/CustomNextImage';
|
|
||||||
import Layout from '../components/Layout';
|
|
||||||
import useUser from '../lib/useUser';
|
|
||||||
import { PhotoPageStyles, PhotosStyles } from './photos';
|
|
||||||
|
|
||||||
export default function CatsPage() {
|
|
||||||
const { user } = useUser({ redirectTo: '/login' });
|
|
||||||
|
|
||||||
if (!user || user.isLoggedIn === false) {
|
|
||||||
return <Layout>Loading...</Layout>;
|
|
||||||
}
|
|
||||||
|
|
||||||
const cats = [
|
|
||||||
{
|
|
||||||
url: 'https://via.placeholder.com/500x500.png',
|
|
||||||
alt: 'Cat 1',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: 'https://via.placeholder.com/500x500.png',
|
|
||||||
alt: 'Cat 2',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: 'https://via.placeholder.com/500x500.png',
|
|
||||||
alt: 'Cat 3',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: 'https://via.placeholder.com/500x500.png',
|
|
||||||
alt: 'Cat 4',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: 'https://via.placeholder.com/500x500.png',
|
|
||||||
alt: 'Cat 5',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: 'https://via.placeholder.com/500x500.png',
|
|
||||||
alt: 'Cat 6',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<Head>
|
|
||||||
<title key="title">N & N | Our Cats</title>
|
|
||||||
</Head>
|
|
||||||
<PhotoPageStyles className="center">
|
|
||||||
<h1>Photos</h1>
|
|
||||||
<a
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer nofollow"
|
|
||||||
aria-label="Link to Photo Gallery"
|
|
||||||
href="https://example.com"
|
|
||||||
>
|
|
||||||
Link to full photo gallery <RiExternalLinkLine />
|
|
||||||
</a>
|
|
||||||
<PhotosStyles>
|
|
||||||
{cats.map((cat) => (
|
|
||||||
<CustomNextImage
|
|
||||||
key={cat.url}
|
|
||||||
src={cat.url}
|
|
||||||
alt={cat.alt}
|
|
||||||
height={500}
|
|
||||||
width={500}
|
|
||||||
blur
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</PhotosStyles>
|
|
||||||
<a
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer nofollow"
|
|
||||||
aria-label="Link to Photo Gallery"
|
|
||||||
href="https://example.com"
|
|
||||||
>
|
|
||||||
Link to full photo gallery <RiExternalLinkLine />
|
|
||||||
</a>
|
|
||||||
</PhotoPageStyles>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -99,7 +99,7 @@ export default function PartyPage() {
|
||||||
<h1 className="center">Meet our Wedding Party</h1>
|
<h1 className="center">Meet our Wedding Party</h1>
|
||||||
<CustomNextImage
|
<CustomNextImage
|
||||||
src="https://via.placeholder.com/450X800.png"
|
src="https://via.placeholder.com/450X800.png"
|
||||||
alt="Wedding Part"
|
alt="Wedding Party"
|
||||||
height={450}
|
height={450}
|
||||||
width={800}
|
width={800}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
36
pages/story.js
Normal file
36
pages/story.js
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
import Head from 'next/head';
|
||||||
|
import CustomNextImage from '../components/CustomNextImage';
|
||||||
|
import Layout from '../components/Layout';
|
||||||
|
import useUser from '../lib/useUser';
|
||||||
|
import { PhotoPageStyles } from './photos';
|
||||||
|
|
||||||
|
export default function StoryPage() {
|
||||||
|
const { user } = useUser({ redirectTo: '/login' });
|
||||||
|
|
||||||
|
if (!user || user.isLoggedIn === false) {
|
||||||
|
return <Layout>Loading...</Layout>;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Head>
|
||||||
|
<title key="title">N & N | Our Story</title>
|
||||||
|
</Head>
|
||||||
|
<PhotoPageStyles className="center">
|
||||||
|
<h1>Our Story</h1>
|
||||||
|
<CustomNextImage
|
||||||
|
src="https://via.placeholder.com/450X800.png"
|
||||||
|
alt="Placeholder Our Story Image"
|
||||||
|
height={450}
|
||||||
|
width={800}
|
||||||
|
/>
|
||||||
|
<p>
|
||||||
|
Our story Lorem ipsum dolor sit amet consectetur adipisicing elit.
|
||||||
|
Natus, illo. Vitae rerum officia, commodi atque reprehenderit tempore
|
||||||
|
amet accusantium dicta corrupti sint vero laboriosam quae explicabo,
|
||||||
|
repellat quisquam. Vitae, cumque.
|
||||||
|
</p>
|
||||||
|
</PhotoPageStyles>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue