From 10d7fcd2c3707d6183db9802d8159fcb99b2504e Mon Sep 17 00:00:00 2001 From: Hoang Vo <40987398+hoangvvo@users.noreply.github.com> Date: Tue, 5 May 2020 17:41:48 -0400 Subject: [PATCH] Feat: other user profile (#63) * Fix some issues * Add note at sign up * rename useUser to useCurrentUser * Move sendVerificationEmail * eslint * Move settings page * add fields * Change profile link in layout * add _id field * Add user page * add an ugly default profile picture * Add babel-eslint * Move from profile to user/[userId] * update roadmap * Fix --- .env.example | 4 +- .eslintrc | 5 +- README.md | 12 ++++- components/layout.jsx | 12 ++--- lib/api-helpers.js | 5 +- lib/db.js | 20 ++++++++ lib/hooks.jsx | 2 +- now.json | 2 +- package.json | 3 +- pages/api/users.js | 6 ++- pages/index.jsx | 4 +- pages/login.jsx | 4 +- pages/{profile => }/settings.jsx | 46 +++++++++++------ pages/signup.jsx | 8 ++- pages/{profile => user/[userId]}/index.jsx | 57 +++++++++------------- 15 files changed, 116 insertions(+), 74 deletions(-) create mode 100644 lib/db.js rename pages/{profile => }/settings.jsx (77%) rename pages/{profile => user/[userId]}/index.jsx (57%) diff --git a/.env.example b/.env.example index 666a92b..28c280c 100644 --- a/.env.example +++ b/.env.example @@ -2,5 +2,5 @@ MONGODB_URI=mongodb+srv://testuser:dontreusethis@cluster0-gc0a7.mongodb.net/next CLOUDINARY_URL=cloudinary://741947492169653:vkyuRmZ3EbSULnkfXJdtSqwhURw@dbplcha6k DB_NAME=nextjsmongodbapp SENDGRID_API_KEY=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 -EMAIL_FROM=averyniceguy@nextjs-mongodb-app.hoangvvo.now.sh -WEB_URI=http://localhost:3000 \ No newline at end of file +EMAIL_FROM=averyniceguy@nextjs-mongodb.now.sh +WEB_URI=https://nextjs-mongodb.now.sh \ No newline at end of file diff --git a/.eslintrc b/.eslintrc index d55ce37..4cb52e9 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,5 +1,6 @@ { "extends": "airbnb", + "parser": "babel-eslint", "env": { "browser": true, "node": true @@ -31,6 +32,8 @@ ], "jsx-a11y/click-events-have-key-events": "off", "react/prop-types": "off", - "react/jsx-props-no-spreading": "off" + "react/jsx-props-no-spreading": "off", + "import/prefer-default-export": "off", + "no-param-reassign": "off" } } diff --git a/README.md b/README.md index 64c976c..2bd3510 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,16 @@ A full-fledged app made with [**Next.js**](https://github.com/zeit/next.js/) and +

:eyes: Users and social

+ +
+ +- [x] Other user profile +- [ ] Posting +- [ ] PM? + +
+
Have any features that interest you, [make an issue](https://github.com/hoangvvo/nextjs-mongodb-app/issues). Would like to work on a feature, [make a PR](https://github.com/hoangvvo/nextjs-mongodb-app/pulls). @@ -101,8 +111,6 @@ Required environmental variables in this project include: Start the development server by running `yarn dev` or `npm run dev`. The project supports using `.env`. Getting started by create a `.env` file with the above variables. -**Styles (CSS):** This project does not contain any stylesheets, and no component has classes. To remove the style, simply remove all `