diff --git a/Dockerfile b/Dockerfile index 361b5a633..1788d68c0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -112,6 +112,9 @@ COPY --from=builder /app/apps/website/next.config.js \ COPY --from=builder /app/apps/ideaspace/next.config.js \ /app/apps/ideaspace/package.json \ ./apps/ideaspace/ +COPY --from=builder /app/apps/user-profile/next.config.js \ + /app/apps/user-profile/package.json \ + ./apps/user-profile/ COPY --from=builder /app/apps/site-projects/next.config.js \ /app/apps/site-projects/package.json \ ./apps/site-projects/ diff --git a/apps/app/.env.development b/apps/app/.env.development index 48dd1a498..d2c9f2c3e 100644 --- a/apps/app/.env.development +++ b/apps/app/.env.development @@ -1,4 +1,5 @@ NEXT_PUBLIC_NAME=DEVELOPMENT +NEXT_PUBLIC_BASE_SITE_URL=http://localhost:3000 NEXT_PUBLIC_API_URL=https://api-staging.devlaunchers.org NEXT_PUBLIC_STRAPI_URL=https://api-staging.devlaunchers.org NEXT_PUBLIC_GOOGLE_AUTH_URL=https://api-staging.devlaunchers.org/connect/google diff --git a/apps/app/.env.production b/apps/app/.env.production index b61e83afa..6f9ef2d2c 100644 --- a/apps/app/.env.production +++ b/apps/app/.env.production @@ -1,4 +1,5 @@ NEXT_PUBLIC_NAME=PRODUCTION +NEXT_PUBLIC_BASE_SITE_URL=https://devlaunchers.org NEXT_PUBLIC_API_URL=https://api.devlaunchers.org NEXT_PUBLIC_STRAPI_URL=https://api.devlaunchers.org NEXT_PUBLIC_GOOGLE_AUTH_URL=https://api.devlaunchers.org/connect/google diff --git a/apps/app/.env.staging b/apps/app/.env.staging index 50456d86c..5394f3b79 100644 --- a/apps/app/.env.staging +++ b/apps/app/.env.staging @@ -1,4 +1,5 @@ NEXT_PUBLIC_NAME=STAGING +NEXT_PUBLIC_BASE_SITE_URL=https://staging.devlaunchers.org NEXT_PUBLIC_API_URL=https://api-staging.devlaunchers.org NEXT_PUBLIC_STRAPI_URL=https://api-staging.devlaunchers.org NEXT_PUBLIC_GOOGLE_AUTH_URL=https://api-staging.devlaunchers.org/connect/google diff --git a/apps/app/.env.test b/apps/app/.env.test index 50456d86c..5394f3b79 100644 --- a/apps/app/.env.test +++ b/apps/app/.env.test @@ -1,4 +1,5 @@ NEXT_PUBLIC_NAME=STAGING +NEXT_PUBLIC_BASE_SITE_URL=https://staging.devlaunchers.org NEXT_PUBLIC_API_URL=https://api-staging.devlaunchers.org NEXT_PUBLIC_STRAPI_URL=https://api-staging.devlaunchers.org NEXT_PUBLIC_GOOGLE_AUTH_URL=https://api-staging.devlaunchers.org/connect/google diff --git a/apps/app/next.config.js b/apps/app/next.config.js index 43dd7e2b3..ffd7ad3ce 100644 --- a/apps/app/next.config.js +++ b/apps/app/next.config.js @@ -3,6 +3,7 @@ const withPlugins = require('next-compose-plugins'); const imagesPlugin = require('next-optimized-images'); const withTM = require('next-transpile-modules')([ '@devlaunchers/ideaspace', + '@devlaunchers/user-profile', '@devlaunchers/site-projects', '@devlaunchers/dev-recruiters', '@devlaunchers/website', diff --git a/apps/app/package.json b/apps/app/package.json index 255d700d7..ae13fecc1 100644 --- a/apps/app/package.json +++ b/apps/app/package.json @@ -9,6 +9,7 @@ "@devlaunchers/dev-recruiters": "workspace:^", "@devlaunchers/ideaspace": "*", "@devlaunchers/site-projects": "*", + "@devlaunchers/user-profile": "*", "@devlaunchers/website": "*", "@next/env": "^12.2.3", "@ramonak/react-progress-bar": "^5.0.2", diff --git a/apps/app/pages/_app.js b/apps/app/pages/_app.js index 70dac4520..0d1bb03bd 100644 --- a/apps/app/pages/_app.js +++ b/apps/app/pages/_app.js @@ -14,6 +14,7 @@ import theme from '../styles/theme'; import Script from 'next/script'; import iubendaScript from '../scripts/iubendaScript'; + const hashRedirect = (router) => { // Strip out hash from url (if any) so we can transition from HashRouter to BrowserRouter if (router.asPath.startsWith('/#')) { @@ -48,24 +49,31 @@ function MyApp({ Component, pageProps }) { <> -
- - +
- + src="//cdn.iubenda.com/cs/iubenda_cs.js" + > + + + + +
+
+ -
+ + {/* {props.children} */} +
- - - - {/* {props.children} */} -
-
diff --git a/apps/app/pages/onboarding.js b/apps/app/pages/onboarding.js new file mode 100644 index 000000000..5196287d9 --- /dev/null +++ b/apps/app/pages/onboarding.js @@ -0,0 +1,7 @@ +import Page from '@devlaunchers/user-profile/src/pages/onboarding'; +import App from '@devlaunchers/user-profile/src/pages/_app'; + +///////////////////////////////////////// + +import { constructAppPage } from '../utils/routingTools.js'; +export default constructAppPage(App, Page); diff --git a/apps/app/pages/users/[userId].js b/apps/app/pages/users/[userId].js new file mode 100644 index 000000000..ee5c23b5b --- /dev/null +++ b/apps/app/pages/users/[userId].js @@ -0,0 +1,8 @@ +import Page from '@devlaunchers/user-profile/src/pages/users/[userId].js'; +import App from '@devlaunchers/user-profile/src/pages/_app'; +export { getStaticPaths, getStaticProps} from '@devlaunchers/user-profile/src/pages/users/[userId].js' + +///////////////////////////////////////// + +import { constructAppPage } from '../../utils/routingTools.js'; +export default constructAppPage(App, Page); diff --git a/apps/app/pages/users/[username].js b/apps/app/pages/users/[username].js deleted file mode 100644 index c59acfecd..000000000 --- a/apps/app/pages/users/[username].js +++ /dev/null @@ -1,8 +0,0 @@ -import Page from '@devlaunchers/website/src/pages/users/[username]'; -import IdeaApp from '@devlaunchers/website/src/pages/_app'; -export { getStaticProps } from '@devlaunchers/website/src/pages/index'; - -///////////////////////////////////////// - -import { constructAppPage } from '../../utils/routingTools.js'; -export default constructAppPage(IdeaApp, Page); diff --git a/apps/app/pages/users/me.js b/apps/app/pages/users/me.js index 485fb370b..52413956b 100644 --- a/apps/app/pages/users/me.js +++ b/apps/app/pages/users/me.js @@ -1,6 +1,5 @@ -import Page from '@devlaunchers/website/src/pages/users/me'; -import IdeaApp from '@devlaunchers/website/src/pages/_app'; -export { getStaticProps } from '@devlaunchers/website/src/pages/index'; +import Page from '@devlaunchers/user-profile/src/pages/users/me'; +import IdeaApp from '@devlaunchers/user-profile/src/pages/_app'; ///////////////////////////////////////// diff --git a/apps/user-profile/.babelrc b/apps/user-profile/.babelrc new file mode 100644 index 000000000..af1f9a5f5 --- /dev/null +++ b/apps/user-profile/.babelrc @@ -0,0 +1,4 @@ +{ + "presets": ["next/babel"], + "plugins": [["babel-plugin-styled-components", { "ssr": true }]] +} diff --git a/apps/user-profile/.eslintignore b/apps/user-profile/.eslintignore new file mode 100644 index 000000000..07819b9cf --- /dev/null +++ b/apps/user-profile/.eslintignore @@ -0,0 +1,12 @@ +node_modules +production +staging +workload +.next +/out/ +.vscode +.github +*.json +*.lock +*.md + diff --git a/apps/user-profile/.eslintrc-example.js b/apps/user-profile/.eslintrc-example.js new file mode 100644 index 000000000..df9dfa589 --- /dev/null +++ b/apps/user-profile/.eslintrc-example.js @@ -0,0 +1,38 @@ +// Workaround for https://github.com/eslint/eslint/issues/3458 (re-export of @rushstack/eslint-patch) +require("@devlaunchers/eslint-config-bases/patch/modern-module-resolution"); + +module.exports = { + // Be sure to set root to true in monorepo. + root: true, + // Will help typescript extended rules. + parserOptions: { + tsconfigRootDir: __dirname, + project: "tsconfig.json", + }, + ignorePatterns: ["**/node_modules", "**/.cache", "build", ".next"], + extends: [ + "@devlaunchers/eslint-config-bases/typescript", + "@devlaunchers/eslint-config-bases/sonar", + "@devlaunchers/eslint-config-bases/regexp", + "@devlaunchers/eslint-config-bases/react", + "@devlaunchers/eslint-config-bases/rtl", + + + + // Add specific rules for your framework if needed. + // ie: + // - nextjs: 'plugin:@next/next/core-web-vitals', + // - remix: '@remix-run/eslint-config', + // ... + + // Post configure the prettier base so there won't be + // any conficts between eslint / prettier + "@devlaunchers/eslint-config-bases/prettier", + ], + rules: { + // Specific global rules for your app or package + }, + overrides: [ + // Specific file rules for your app or package + ], +}; \ No newline at end of file diff --git a/apps/user-profile/.eslintrc.json b/apps/user-profile/.eslintrc.json new file mode 100644 index 000000000..bffb357a7 --- /dev/null +++ b/apps/user-profile/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "next/core-web-vitals" +} diff --git a/apps/user-profile/.flux.yaml b/apps/user-profile/.flux.yaml new file mode 100644 index 000000000..d7a8a89d4 --- /dev/null +++ b/apps/user-profile/.flux.yaml @@ -0,0 +1,5 @@ +version: 1 +patchUpdated: + generators: + - command: kustomize build . + patchFile: flux-patch.yaml \ No newline at end of file diff --git a/apps/user-profile/.gitignore b/apps/user-profile/.gitignore new file mode 100644 index 000000000..c87c9b392 --- /dev/null +++ b/apps/user-profile/.gitignore @@ -0,0 +1,36 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# local env files +.env*.local + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/apps/user-profile/.gitignore copy b/apps/user-profile/.gitignore copy new file mode 100644 index 000000000..09b1ebbdd --- /dev/null +++ b/apps/user-profile/.gitignore copy @@ -0,0 +1,28 @@ +# See https://help.github.com/ignore-files/ for more about ignoring files. + +# dependencies +/node_modules + +# testing +/coverage + +# production +/build + +# next.js +/.next/ +/out/ + +# Workers site +/workers-site + +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/apps/user-profile/.husky/.gitignore b/apps/user-profile/.husky/.gitignore new file mode 100644 index 000000000..31354ec13 --- /dev/null +++ b/apps/user-profile/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/apps/user-profile/.husky/pre-commit b/apps/user-profile/.husky/pre-commit new file mode 100644 index 000000000..36af21989 --- /dev/null +++ b/apps/user-profile/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx lint-staged diff --git a/apps/user-profile/.prettierignore b/apps/user-profile/.prettierignore new file mode 100644 index 000000000..f3144cdff --- /dev/null +++ b/apps/user-profile/.prettierignore @@ -0,0 +1,4 @@ +.next +/out/ +/node_modules/ +.github \ No newline at end of file diff --git a/apps/user-profile/.travis.yml b/apps/user-profile/.travis.yml new file mode 100644 index 000000000..b3899bb6e --- /dev/null +++ b/apps/user-profile/.travis.yml @@ -0,0 +1,27 @@ +language: node_js +node_js: + - "stable" +cache: + directories: + - node_modules +script: + - CI=false npm run build +deploy: + # release -> master branch of dev-launchers/website + - provider: pages + skip_cleanup: true + github_token: $GITHUB_TOKEN + local_dir: build + keep_history: true + repo: dev-launchers/private__website + target_branch: master + on: + branch: release + # deploy Github page to gh-pages branch + - provider: pages + skip_cleanup: true + github_token: $GITHUB_TOKEN + local_dir: build + on: + branch: master + diff --git a/apps/user-profile/CONTRIBUTING.md b/apps/user-profile/CONTRIBUTING.md new file mode 100644 index 000000000..5a24d3bf8 --- /dev/null +++ b/apps/user-profile/CONTRIBUTING.md @@ -0,0 +1,98 @@ +# How to Contribute to the DevLaunchers website + +## Requirements: +Before you start contributing, you're going to need a few things: +- **Code Editor:** + - Either [Atom](https://atom.io/) or [Visual Studio Code](https://code.visualstudio.com/) **VS Code is recommended due to the extensions provided** + - Why? These are code editors that are 100% guaranteed to support the extensions we use. +- **Communication:** + - While it may be obvious, you're going to need a GitHub account. + - You're also going to need a Discord account, so you can: + - Communicate effectively with other contributors + - Test the changes you've made to the website + - Receive help as you need it + - Message `Nathan D.#8643` or `Enjoy2Live#0001` + +# Standards + +## Code Style +To prevent formatting wars and be consistent, here are the coding style guidelines we have made: +- Use 2 space indentation (2 space tabs are fine too) +- Remove **all** unused variables, and make sure you do before every commit + - This helps make sure the code runs as smooth as possible, as JavaScripts garbage collector has to do **much** less work. +- Remove **console.log()** from files before commiting +- Remove **all** unnecessary comments prior to commiting + - Example: + ```js + // This needs to be changed, I don't like the font! + ``` +- Make sure to annotate your code with [JSDoc comments](https://jsdoc.app/about-getting-started.html#adding-documentation-comments-to-your-code) + The comment above would need to be removed after the issue was resolved + - This helps *all* developers understand what your code does + - **BONUS:** Atom and VSCode both use JSDoc comments for their autocomplete and inline function header +- Use double quotes (`" "`) for strings +- Always use ES6's Template Literals for string interpolation, and **never** concatenate strings. + - Example: + ```js + // Very Bad: + console.log(user + " has " + xp + " xp."); + + // Good: + console.log(`${user} has ${xp} xp.`); + ``` +- End statements and expressions with semicolons (`;`). +- Use camelCase when naming variables +- Capatalize the first letter of every custom-made component +- The name of the file should match the component name. + - Example: filename is Hello.js + ```js + const Hello = (props) => { + return ... + } + ``` +- Every component should have its styles seperated in another file that is convieniently named Styled[**Name of Component**].js + - This should be placed in the same folder as the component file + - This helps to reduce or completely avoid in-line styling +- Use theme variables located at the /src/styles/theme.js + [See how to use theme variables here](https://styled-components.com/docs/advanced#theming) + +## Commits, Branches, and Pull Requests +- Before starting anything, make sure you: + - ```bash + git checkout master + git pull + git checkout -b "branch-name" + ``` + - This ensures that you are working on the newest copy of the app. +- Make sure your commit messages are descriptive, and in the present tense (per convention) + - Example (using active voice) + ``` + // Very Bad: + I created a card component and added the rainbow as well as updated the image size + + // Good: + Create card component + - add rainbow bar + - update image size + ``` + - Your commit message should look like a list of instructions +- Create a new branch for each new feature you add. +- You can create a pull request (commonly referred to as "PR")by clicking a little notice when you visit the repository that includes "merge changes" +- When creating a PR: + - List all the new packages you've installed, and the purpose of each package + - Give a summary of all the changes you've made + - Give a summary of all the commands you've added + - Explain the purpose for any new structures you've created + - An example (my first PR!) is at [#101](https://github.com/dev-launchers-sandbox/project__discord-bot/pull/101) + - The destination branch should be **in-progress** +- During a PR: + - You may be asked questions about what certain things do + - You may be asked to refactor/change your code because: + - It doesn't comply with the standards we've set forth + - It would be wise to add a new feature + - Or, something is missing or confusing + +## Release + +We are using semantic versioning to tag release. Follow the [Format Guide](https://github.com/semantic-release/semantic-release#commit-message-format) +to format the commit messages. diff --git a/apps/user-profile/LICENSE.md b/apps/user-profile/LICENSE.md new file mode 100644 index 000000000..175443ce8 --- /dev/null +++ b/apps/user-profile/LICENSE.md @@ -0,0 +1,595 @@ +GNU General Public License +========================== + +_Version 3, 29 June 2007_ +_Copyright © 2007 Free Software Foundation, Inc. <>_ + +Everyone is permitted to copy and distribute verbatim copies of this license +document, but changing it is not allowed. + +## Preamble + +The GNU General Public License is a free, copyleft license for software and other +kinds of works. + +The licenses for most software and other practical works are designed to take away +your freedom to share and change the works. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change all versions of a +program--to make sure it remains free software for all its users. We, the Free +Software Foundation, use the GNU General Public License for most of our software; it +applies also to any other work released this way by its authors. You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our General +Public Licenses are designed to make sure that you have the freedom to distribute +copies of free software (and charge for them if you wish), that you receive source +code or can get it if you want it, that you can change the software or use pieces of +it in new free programs, and that you know you can do these things. + +To protect your rights, we need to prevent others from denying you these rights or +asking you to surrender the rights. Therefore, you have certain responsibilities if +you distribute copies of the software, or if you modify it: responsibilities to +respect the freedom of others. + +For example, if you distribute copies of such a program, whether gratis or for a fee, +you must pass on to the recipients the same freedoms that you received. You must make +sure that they, too, receive or can get the source code. And you must show them these +terms so they know their rights. + +Developers that use the GNU GPL protect your rights with two steps: **(1)** assert +copyright on the software, and **(2)** offer you this License giving you legal permission +to copy, distribute and/or modify it. + +For the developers' and authors' protection, the GPL clearly explains that there is +no warranty for this free software. For both users' and authors' sake, the GPL +requires that modified versions be marked as changed, so that their problems will not +be attributed erroneously to authors of previous versions. + +Some devices are designed to deny users access to install or run modified versions of +the software inside them, although the manufacturer can do so. This is fundamentally +incompatible with the aim of protecting users' freedom to change the software. The +systematic pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we have designed +this version of the GPL to prohibit the practice for those products. If such problems +arise substantially in other domains, we stand ready to extend this provision to +those domains in future versions of the GPL, as needed to protect the freedom of +users. + +Finally, every program is threatened constantly by software patents. States should +not allow patents to restrict development and use of software on general-purpose +computers, but in those that do, we wish to avoid the special danger that patents +applied to a free program could make it effectively proprietary. To prevent this, the +GPL assures that patents cannot be used to render the program non-free. + +The precise terms and conditions for copying, distribution and modification follow. + +## TERMS AND CONDITIONS + +### 0. Definitions + +“This License” refers to version 3 of the GNU General Public License. + +“Copyright” also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + +“The Program” refers to any copyrightable work licensed under this +License. Each licensee is addressed as “you”. “Licensees” and +“recipients” may be individuals or organizations. + +To “modify” a work means to copy from or adapt all or part of the work in +a fashion requiring copyright permission, other than the making of an exact copy. The +resulting work is called a “modified version” of the earlier work or a +work “based on” the earlier work. + +A “covered work” means either the unmodified Program or a work based on +the Program. + +To “propagate” a work means to do anything with it that, without +permission, would make you directly or secondarily liable for infringement under +applicable copyright law, except executing it on a computer or modifying a private +copy. Propagation includes copying, distribution (with or without modification), +making available to the public, and in some countries other activities as well. + +To “convey” a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through a computer +network, with no transfer of a copy, is not conveying. + +An interactive user interface displays “Appropriate Legal Notices” to the +extent that it includes a convenient and prominently visible feature that **(1)** +displays an appropriate copyright notice, and **(2)** tells the user that there is no +warranty for the work (except to the extent that warranties are provided), that +licensees may convey the work under this License, and how to view a copy of this +License. If the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + +### 1. Source Code + +The “source code” for a work means the preferred form of the work for +making modifications to it. “Object code” means any non-source form of a +work. + +A “Standard Interface” means an interface that either is an official +standard defined by a recognized standards body, or, in the case of interfaces +specified for a particular programming language, one that is widely used among +developers working in that language. + +The “System Libraries” of an executable work include anything, other than +the work as a whole, that **(a)** is included in the normal form of packaging a Major +Component, but which is not part of that Major Component, and **(b)** serves only to +enable use of the work with that Major Component, or to implement a Standard +Interface for which an implementation is available to the public in source code form. +A “Major Component”, in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system (if any) on which +the executable work runs, or a compiler used to produce the work, or an object code +interpreter used to run it. + +The “Corresponding Source” for a work in object code form means all the +source code needed to generate, install, and (for an executable work) run the object +code and to modify the work, including scripts to control those activities. However, +it does not include the work's System Libraries, or general-purpose tools or +generally available free programs which are used unmodified in performing those +activities but which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for the work, and +the source code for shared libraries and dynamically linked subprograms that the work +is specifically designed to require, such as by intimate data communication or +control flow between those subprograms and other parts of the work. + +The Corresponding Source need not include anything that users can regenerate +automatically from other parts of the Corresponding Source. + +The Corresponding Source for a work in source code form is that same work. + +### 2. Basic Permissions + +All rights granted under this License are granted for the term of copyright on the +Program, and are irrevocable provided the stated conditions are met. This License +explicitly affirms your unlimited permission to run the unmodified Program. The +output from running a covered work is covered by this License only if the output, +given its content, constitutes a covered work. This License acknowledges your rights +of fair use or other equivalent, as provided by copyright law. + +You may make, run and propagate covered works that you do not convey, without +conditions so long as your license otherwise remains in force. You may convey covered +works to others for the sole purpose of having them make modifications exclusively +for you, or provide you with facilities for running those works, provided that you +comply with the terms of this License in conveying all material for which you do not +control copyright. Those thus making or running the covered works for you must do so +exclusively on your behalf, under your direction and control, on terms that prohibit +them from making any copies of your copyrighted material outside their relationship +with you. + +Conveying under any other circumstances is permitted solely under the conditions +stated below. Sublicensing is not allowed; section 10 makes it unnecessary. + +### 3. Protecting Users' Legal Rights From Anti-Circumvention Law + +No covered work shall be deemed part of an effective technological measure under any +applicable law fulfilling obligations under article 11 of the WIPO copyright treaty +adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention +of such measures. + +When you convey a covered work, you waive any legal power to forbid circumvention of +technological measures to the extent such circumvention is effected by exercising +rights under this License with respect to the covered work, and you disclaim any +intention to limit operation or modification of the work as a means of enforcing, +against the work's users, your or third parties' legal rights to forbid circumvention +of technological measures. + +### 4. Conveying Verbatim Copies + +You may convey verbatim copies of the Program's source code as you receive it, in any +medium, provided that you conspicuously and appropriately publish on each copy an +appropriate copyright notice; keep intact all notices stating that this License and +any non-permissive terms added in accord with section 7 apply to the code; keep +intact all notices of the absence of any warranty; and give all recipients a copy of +this License along with the Program. + +You may charge any price or no price for each copy that you convey, and you may offer +support or warranty protection for a fee. + +### 5. Conveying Modified Source Versions + +You may convey a work based on the Program, or the modifications to produce it from +the Program, in the form of source code under the terms of section 4, provided that +you also meet all of these conditions: + +* **a)** The work must carry prominent notices stating that you modified it, and giving a +relevant date. +* **b)** The work must carry prominent notices stating that it is released under this +License and any conditions added under section 7. This requirement modifies the +requirement in section 4 to “keep intact all notices”. +* **c)** You must license the entire work, as a whole, under this License to anyone who +comes into possession of a copy. This License will therefore apply, along with any +applicable section 7 additional terms, to the whole of the work, and all its parts, +regardless of how they are packaged. This License gives no permission to license the +work in any other way, but it does not invalidate such permission if you have +separately received it. +* **d)** If the work has interactive user interfaces, each must display Appropriate Legal +Notices; however, if the Program has interactive interfaces that do not display +Appropriate Legal Notices, your work need not make them do so. + +A compilation of a covered work with other separate and independent works, which are +not by their nature extensions of the covered work, and which are not combined with +it such as to form a larger program, in or on a volume of a storage or distribution +medium, is called an “aggregate” if the compilation and its resulting +copyright are not used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work in an aggregate +does not cause this License to apply to the other parts of the aggregate. + +### 6. Conveying Non-Source Forms + +You may convey a covered work in object code form under the terms of sections 4 and +5, provided that you also convey the machine-readable Corresponding Source under the +terms of this License, in one of these ways: + +* **a)** Convey the object code in, or embodied in, a physical product (including a +physical distribution medium), accompanied by the Corresponding Source fixed on a +durable physical medium customarily used for software interchange. +* **b)** Convey the object code in, or embodied in, a physical product (including a +physical distribution medium), accompanied by a written offer, valid for at least +three years and valid for as long as you offer spare parts or customer support for +that product model, to give anyone who possesses the object code either **(1)** a copy of +the Corresponding Source for all the software in the product that is covered by this +License, on a durable physical medium customarily used for software interchange, for +a price no more than your reasonable cost of physically performing this conveying of +source, or **(2)** access to copy the Corresponding Source from a network server at no +charge. +* **c)** Convey individual copies of the object code with a copy of the written offer to +provide the Corresponding Source. This alternative is allowed only occasionally and +noncommercially, and only if you received the object code with such an offer, in +accord with subsection 6b. +* **d)** Convey the object code by offering access from a designated place (gratis or for +a charge), and offer equivalent access to the Corresponding Source in the same way +through the same place at no further charge. You need not require recipients to copy +the Corresponding Source along with the object code. If the place to copy the object +code is a network server, the Corresponding Source may be on a different server +(operated by you or a third party) that supports equivalent copying facilities, +provided you maintain clear directions next to the object code saying where to find +the Corresponding Source. Regardless of what server hosts the Corresponding Source, +you remain obligated to ensure that it is available for as long as needed to satisfy +these requirements. +* **e)** Convey the object code using peer-to-peer transmission, provided you inform +other peers where the object code and Corresponding Source of the work are being +offered to the general public at no charge under subsection 6d. + +A separable portion of the object code, whose source code is excluded from the +Corresponding Source as a System Library, need not be included in conveying the +object code work. + +A “User Product” is either **(1)** a “consumer product”, which +means any tangible personal property which is normally used for personal, family, or +household purposes, or **(2)** anything designed or sold for incorporation into a +dwelling. In determining whether a product is a consumer product, doubtful cases +shall be resolved in favor of coverage. For a particular product received by a +particular user, “normally used” refers to a typical or common use of +that class of product, regardless of the status of the particular user or of the way +in which the particular user actually uses, or expects or is expected to use, the +product. A product is a consumer product regardless of whether the product has +substantial commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + +“Installation Information” for a User Product means any methods, +procedures, authorization keys, or other information required to install and execute +modified versions of a covered work in that User Product from a modified version of +its Corresponding Source. The information must suffice to ensure that the continued +functioning of the modified object code is in no case prevented or interfered with +solely because modification has been made. + +If you convey an object code work under this section in, or with, or specifically for +use in, a User Product, and the conveying occurs as part of a transaction in which +the right of possession and use of the User Product is transferred to the recipient +in perpetuity or for a fixed term (regardless of how the transaction is +characterized), the Corresponding Source conveyed under this section must be +accompanied by the Installation Information. But this requirement does not apply if +neither you nor any third party retains the ability to install modified object code +on the User Product (for example, the work has been installed in ROM). + +The requirement to provide Installation Information does not include a requirement to +continue to provide support service, warranty, or updates for a work that has been +modified or installed by the recipient, or for the User Product in which it has been +modified or installed. Access to a network may be denied when the modification itself +materially and adversely affects the operation of the network or violates the rules +and protocols for communication across the network. + +Corresponding Source conveyed, and Installation Information provided, in accord with +this section must be in a format that is publicly documented (and with an +implementation available to the public in source code form), and must require no +special password or key for unpacking, reading or copying. + +### 7. Additional Terms + +“Additional permissions” are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. Additional +permissions that are applicable to the entire Program shall be treated as though they +were included in this License, to the extent that they are valid under applicable +law. If additional permissions apply only to part of the Program, that part may be +used separately under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option remove any +additional permissions from that copy, or from any part of it. (Additional +permissions may be written to require their own removal in certain cases when you +modify the work.) You may place additional permissions on material, added by you to a +covered work, for which you have or can give appropriate copyright permission. + +Notwithstanding any other provision of this License, for material you add to a +covered work, you may (if authorized by the copyright holders of that material) +supplement the terms of this License with terms: + +* **a)** Disclaiming warranty or limiting liability differently from the terms of +sections 15 and 16 of this License; or +* **b)** Requiring preservation of specified reasonable legal notices or author +attributions in that material or in the Appropriate Legal Notices displayed by works +containing it; or +* **c)** Prohibiting misrepresentation of the origin of that material, or requiring that +modified versions of such material be marked in reasonable ways as different from the +original version; or +* **d)** Limiting the use for publicity purposes of names of licensors or authors of the +material; or +* **e)** Declining to grant rights under trademark law for use of some trade names, +trademarks, or service marks; or +* **f)** Requiring indemnification of licensors and authors of that material by anyone +who conveys the material (or modified versions of it) with contractual assumptions of +liability to the recipient, for any liability that these contractual assumptions +directly impose on those licensors and authors. + +All other non-permissive additional terms are considered “further +restrictions” within the meaning of section 10. If the Program as you received +it, or any part of it, contains a notice stating that it is governed by this License +along with a term that is a further restriction, you may remove that term. If a +license document contains a further restriction but permits relicensing or conveying +under this License, you may add to a covered work material governed by the terms of +that license document, provided that the further restriction does not survive such +relicensing or conveying. + +If you add terms to a covered work in accord with this section, you must place, in +the relevant source files, a statement of the additional terms that apply to those +files, or a notice indicating where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the form of a +separately written license, or stated as exceptions; the above requirements apply +either way. + +### 8. Termination + +You may not propagate or modify a covered work except as expressly provided under +this License. Any attempt otherwise to propagate or modify it is void, and will +automatically terminate your rights under this License (including any patent licenses +granted under the third paragraph of section 11). + +However, if you cease all violation of this License, then your license from a +particular copyright holder is reinstated **(a)** provisionally, unless and until the +copyright holder explicitly and finally terminates your license, and **(b)** permanently, +if the copyright holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + +Moreover, your license from a particular copyright holder is reinstated permanently +if the copyright holder notifies you of the violation by some reasonable means, this +is the first time you have received notice of violation of this License (for any +work) from that copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the licenses of +parties who have received copies or rights from you under this License. If your +rights have been terminated and not permanently reinstated, you do not qualify to +receive new licenses for the same material under section 10. + +### 9. Acceptance Not Required for Having Copies + +You are not required to accept this License in order to receive or run a copy of the +Program. Ancillary propagation of a covered work occurring solely as a consequence of +using peer-to-peer transmission to receive a copy likewise does not require +acceptance. However, nothing other than this License grants you permission to +propagate or modify any covered work. These actions infringe copyright if you do not +accept this License. Therefore, by modifying or propagating a covered work, you +indicate your acceptance of this License to do so. + +### 10. Automatic Licensing of Downstream Recipients + +Each time you convey a covered work, the recipient automatically receives a license +from the original licensors, to run, modify and propagate that work, subject to this +License. You are not responsible for enforcing compliance by third parties with this +License. + +An “entity transaction” is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an organization, or +merging organizations. If propagation of a covered work results from an entity +transaction, each party to that transaction who receives a copy of the work also +receives whatever licenses to the work the party's predecessor in interest had or +could give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if the predecessor +has it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the rights granted or +affirmed under this License. For example, you may not impose a license fee, royalty, +or other charge for exercise of rights granted under this License, and you may not +initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging +that any patent claim is infringed by making, using, selling, offering for sale, or +importing the Program or any portion of it. + +### 11. Patents + +A “contributor” is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The work thus +licensed is called the contributor's “contributor version”. + +A contributor's “essential patent claims” are all patent claims owned or +controlled by the contributor, whether already acquired or hereafter acquired, that +would be infringed by some manner, permitted by this License, of making, using, or +selling its contributor version, but do not include claims that would be infringed +only as a consequence of further modification of the contributor version. For +purposes of this definition, “control” includes the right to grant patent +sublicenses in a manner consistent with the requirements of this License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free patent license +under the contributor's essential patent claims, to make, use, sell, offer for sale, +import and otherwise run, modify and propagate the contents of its contributor +version. + +In the following three paragraphs, a “patent license” is any express +agreement or commitment, however denominated, not to enforce a patent (such as an +express permission to practice a patent or covenant not to sue for patent +infringement). To “grant” such a patent license to a party means to make +such an agreement or commitment not to enforce a patent against the party. + +If you convey a covered work, knowingly relying on a patent license, and the +Corresponding Source of the work is not available for anyone to copy, free of charge +and under the terms of this License, through a publicly available network server or +other readily accessible means, then you must either **(1)** cause the Corresponding +Source to be so available, or **(2)** arrange to deprive yourself of the benefit of the +patent license for this particular work, or **(3)** arrange, in a manner consistent with +the requirements of this License, to extend the patent license to downstream +recipients. “Knowingly relying” means you have actual knowledge that, but +for the patent license, your conveying the covered work in a country, or your +recipient's use of the covered work in a country, would infringe one or more +identifiable patents in that country that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or arrangement, you +convey, or propagate by procuring conveyance of, a covered work, and grant a patent +license to some of the parties receiving the covered work authorizing them to use, +propagate, modify or convey a specific copy of the covered work, then the patent +license you grant is automatically extended to all recipients of the covered work and +works based on it. + +A patent license is “discriminatory” if it does not include within the +scope of its coverage, prohibits the exercise of, or is conditioned on the +non-exercise of one or more of the rights that are specifically granted under this +License. You may not convey a covered work if you are a party to an arrangement with +a third party that is in the business of distributing software, under which you make +payment to the third party based on the extent of your activity of conveying the +work, and under which the third party grants, to any of the parties who would receive +the covered work from you, a discriminatory patent license **(a)** in connection with +copies of the covered work conveyed by you (or copies made from those copies), or **(b)** +primarily for and in connection with specific products or compilations that contain +the covered work, unless you entered into that arrangement, or that patent license +was granted, prior to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting any implied +license or other defenses to infringement that may otherwise be available to you +under applicable patent law. + +### 12. No Surrender of Others' Freedom + +If conditions are imposed on you (whether by court order, agreement or otherwise) +that contradict the conditions of this License, they do not excuse you from the +conditions of this License. If you cannot convey a covered work so as to satisfy +simultaneously your obligations under this License and any other pertinent +obligations, then as a consequence you may not convey it at all. For example, if you +agree to terms that obligate you to collect a royalty for further conveying from +those to whom you convey the Program, the only way you could satisfy both those terms +and this License would be to refrain entirely from conveying the Program. + +### 13. Use with the GNU Affero General Public License + +Notwithstanding any other provision of this License, you have permission to link or +combine any covered work with a work licensed under version 3 of the GNU Affero +General Public License into a single combined work, and to convey the resulting work. +The terms of this License will continue to apply to the part which is the covered +work, but the special requirements of the GNU Affero General Public License, section +13, concerning interaction through a network will apply to the combination as such. + +### 14. Revised Versions of this License + +The Free Software Foundation may publish revised and/or new versions of the GNU +General Public License from time to time. Such new versions will be similar in spirit +to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies that +a certain numbered version of the GNU General Public License “or any later +version” applies to it, you have the option of following the terms and +conditions either of that numbered version or of any later version published by the +Free Software Foundation. If the Program does not specify a version number of the GNU +General Public License, you may choose any version ever published by the Free +Software Foundation. + +If the Program specifies that a proxy can decide which future versions of the GNU +General Public License can be used, that proxy's public statement of acceptance of a +version permanently authorizes you to choose that version for the Program. + +Later license versions may give you additional or different permissions. However, no +additional obligations are imposed on any author or copyright holder as a result of +your choosing to follow a later version. + +### 15. Disclaimer of Warranty + +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER +EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE +QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE +DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +### 16. Limitation of Liability + +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY +COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS +PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, +INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE +OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE +WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + +### 17. Interpretation of Sections 15 and 16 + +If the disclaimer of warranty and limitation of liability provided above cannot be +given local legal effect according to their terms, reviewing courts shall apply local +law that most closely approximates an absolute waiver of all civil liability in +connection with the Program, unless a warranty or assumption of liability accompanies +a copy of the Program in return for a fee. + +_END OF TERMS AND CONDITIONS_ + +## How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible use to +the public, the best way to achieve this is to make it free software which everyone +can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to attach them +to the start of each source file to most effectively state the exclusion of warranty; +and each file should have at least the “copyright” line and a pointer to +where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + +If the program does terminal interaction, make it output a short notice like this +when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type 'show c' for details. + +The hypothetical commands `show w` and `show c` should show the appropriate parts of +the General Public License. Of course, your program's commands might be different; +for a GUI interface, you would use an “about box”. + +You should also get your employer (if you work as a programmer) or school, if any, to +sign a “copyright disclaimer” for the program, if necessary. For more +information on this, and how to apply and follow the GNU GPL, see +<>. + +The GNU General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may consider it +more useful to permit linking proprietary applications with the library. If this is +what you want to do, use the GNU Lesser General Public License instead of this +License. But first, please read +<>. diff --git a/apps/user-profile/README copy.md b/apps/user-profile/README copy.md new file mode 100644 index 000000000..c08690675 --- /dev/null +++ b/apps/user-profile/README copy.md @@ -0,0 +1,61 @@ +# Dev Launchers (https://devlaunchers.org) + +## We Build People (and software) + +[![](https://dev-launchers.github.io/app/images/dev-launchers__site-screenshot.jpg)](https://devlaunchers.org/) + +The site is built with React.js/Next.js and many other wonderful libraries. We're currently using Google Sheets as our backend, but will soon be moving to a dedicated server. + +--- + +## About Dev Launchers + +Dev Launchers is a nonprofit tech company working to democratize access to technology and tech related skills. At our core, we build projects and run programs that are designed to prepare the world for a rapidly changing future. We've built an inclusive, software focused incubator giving people from diverse backgrounds the skills and resources necessary to succeed in careers touched by technology, and have an open community focused on advancing technology, one another, and ourselves. This repository holds the beginnings of the online platform we're creating in order to first impart the general skills required for members to begin their own projects, and then support their exploration as they tackle building something they're excited about. It also functions as our organization's website! + +--- + +## Contributing + +### Our Issues are organized into different Milestones + +_We're using GitHub's milestones to keep better track of our issues. These will change as we progress and move further along with our roadmap. The current milestone's we're tackling are:_ + +#### [Showing Impact - Let's Bring Life to the Site! (And Get Sponsorships)](https://github.com/dev-launchers/app/milestone/7) + +- We want to showcase all the wonderful things Dev Launchers is accomplishing, and the wonderful people making it all happen! This milestone should result in donors and sponsors alike getting a clear idea of what Dev Launchers is all about and why they should support our mission. + +#### [Member UX](https://github.com/dev-launchers/app/milestone/9) + +- Improve the general experience members have interacting with the site! +- + +#### [General Site Improvements](https://github.com/dev-launchers/app/milestone/8) + +- Improve the general presentation and functionality of the site! + +--- + +## Get Started + +1. Clone the repo + +2. Install: `npm install` + +3. Run dev version: `npm run dev` + +--- + +## Release + +We are using semantic versioning to tag release. Follow https://github.com/semantic-release/semantic-release#commit-message-format +to format the commit messages. + +Once you are ready to create a new release, create a PR to merge main branch to release branch. + +. + +--- + +## LicenseS + +The Dev Launchers platform is licensed under [GNU General Public License v3](./LICENSE.md) diff --git a/apps/user-profile/README.md b/apps/user-profile/README.md new file mode 100644 index 000000000..b12f3e33e --- /dev/null +++ b/apps/user-profile/README.md @@ -0,0 +1,34 @@ +This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). + +## Getting Started + +First, run the development server: + +```bash +npm run dev +# or +yarn dev +``` + +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. + +You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file. + +[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`. + +The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. + +## Learn More + +To learn more about Next.js, take a look at the following resources: + +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. +- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. + +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! + +## Deploy on Vercel + +The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. + +Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/apps/user-profile/next.config copy.js b/apps/user-profile/next.config copy.js new file mode 100644 index 000000000..1bb724de0 --- /dev/null +++ b/apps/user-profile/next.config copy.js @@ -0,0 +1,45 @@ +const withPlugins = require('next-compose-plugins'); +const imagesPlugin = require('next-optimized-images'); +const withTM = require('next-transpile-modules')([ + '@devlaunchers/ideaspace', + '@devlaunchers/site-projects', + '@devlaunchers/dev-recruiters', + '@devlaunchers/website', +]); // pass the modules you would like to see transpiled + +/** @type {import('next').NextConfig} */ +const nextConfig = { + async redirects() { + return [ + { + source: '/meet', + destination: '/hangout', + permanent: true, + }, + ]; + }, + images: { + /* + next-images plugin is conflicting with Next.js 11 static import feature. + see the discussion here: + https://github.com/twopluszero/next-images/issues/73 + */ + domains: [ + 'images.prismic.io', + 'devlaunchersproduction.blob.core.windows.net', + ], + disableStaticImages: true, + }, + reactStrictMode: true, // It helps you avoid legacy code, and deprecated APIs. + eslint: { + // Warning: Dangerously allow production builds to successfully complete even if + // your project has ESLint errors. + // we have too many errors if you run npm run lint ,but after bug fixes we could enforce this. + ignoreDuringBuilds: true, + }, + output: 'standalone', + experimental: { + externalDir: true, + }, +}; +module.exports = withPlugins([[imagesPlugin], [withTM]], nextConfig); diff --git a/apps/user-profile/next.config.js b/apps/user-profile/next.config.js new file mode 100644 index 000000000..b97b5a375 --- /dev/null +++ b/apps/user-profile/next.config.js @@ -0,0 +1,63 @@ +const withPlugins = require('next-compose-plugins'); +const imagesPlugin = require('next-optimized-images'); + +/** + * @type {import('next').NextConfig} + * */ +const nextConfig = { + async rewrites() { + return [ + { + source: '/:path*', + destination: `/:path*`, + }, + { + source: '/', + destination: 'https://devlaunchers.org/', + basePath: false, + }, + { + source: '/create', + destination: 'https://devlaunchers.org/create', + basePath: false, + }, + { + source: '/learn', + destination: `https://devlaunchers.org/learn`, + basePath: false, + }, + { + source: '/support-us', + destination: `https://devlaunchers.org/support-us`, + basePath: false, + }, + ]; + }, + // compiler: { + // // ssr and displayName are configured by default + // styledComponents: true, + // }, + + images: { + /* + next-images plugin is conflicting with Next.js 11 static import feature. + see the discussion here: + https://github.com/twopluszero/next-images/issues/73 + */ + domains: [ + 'images.prismic.io', + 'devlaunchersproduction.blob.core.windows.net',, + 'lh3.googleusercontent.com' + ], + disableStaticImages: true, + }, + webpack5: true, + reactStrictMode: true, // It helps you avoid legacy code, and deprecated APIs. + eslint: { + // Warning: Dangerously allow production builds to successfully complete even if + // your project has ESLint errors. + // we have too many errors if you run npm run lint ,but after bug fixes we could enforce this. + ignoreDuringBuilds: true, + }, +}; +module.exports = withPlugins([[imagesPlugin], nextConfig]); diff --git a/apps/website/package copy.json b/apps/user-profile/package.json similarity index 88% rename from apps/website/package copy.json rename to apps/user-profile/package.json index d1854dcf1..17ef5e972 100644 --- a/apps/website/package copy.json +++ b/apps/user-profile/package.json @@ -1,13 +1,11 @@ { - "name": "@devlaunchers/app", + "name": "@devlaunchers/user-profile", "version": "0.1.0", "description": "", "keywords": [], "homepage": "http://devlaunchers.org/", "dependencies": { - "@cloudflare/wrangler": "^1.19.12", "@devlaunchers/dev-recruiters": "workspace:^", - "@devlaunchers/website": "*", "@devlaunchers/ideaspace": "*", "@devlaunchers/site-projects": "*", "@ramonak/react-progress-bar": "^5.0.2", @@ -16,10 +14,11 @@ "autosave": "^1.0.3", "axios": "^0.27.2", "constate": "^3.3.2", + "framer-motion": "6.2.4", "luxon": "^3.0.1", "next": "^12.2.3", "next-compose-plugins": "^2.2.1", - "next-optimized-images": "^3.0.0-canary.10", + "next-optimized-images": "^2.6.2", "next-transpile-modules": "^9.0.0", "pluralize": "^8.0.0", "prismic-reactjs": "^1.3.4", @@ -38,10 +37,9 @@ "react-toastify": "latest", "regenerator-runtime": "^0.13.9", "semantic-release": "^19.0.3", - "styled-components": "5.3.5", "styled-normalize": "^8.0.7", "tabletop": "1.6.3", - "wrangler": "^2.0.24" + "wrangler": "^3.0.1" }, "devDependencies": { "@devlaunchers/eslint-config-bases": "workspace:^", @@ -56,7 +54,8 @@ "lint-staged": "^13.0.3", "postcss": "^8.4.14", "prettier": "^2.7.1", - "typescript": "^4.7.4" + "typescript": "^4.7.4", + "webp-loader": "0.6.0" }, "scripts": { "dev": "next dev", @@ -73,7 +72,12 @@ "test:unit": "echo \"No tests yet\"", "fix:staged-files": "lint-staged --allow-empty" }, - "browserslist": [">0.2%", "not dead", "not ie <= 11", "not op_mini all"], + "browserslist": [ + ">0.2%", + "not dead", + "not ie <= 11", + "not op_mini all" + ], "lint-staged": { "*.js": "eslint '*/**/*.{js,jsx}' --fix", "*.{js,css,md}": "prettier --write" @@ -82,7 +86,9 @@ "styled-components": "^5" }, "release": { - "branches": ["release"], + "branches": [ + "release" + ], "plugins": [ "@semantic-release/commit-analyzer", "@semantic-release/release-notes-generator", diff --git a/apps/user-profile/public/favicon.ico b/apps/user-profile/public/favicon.ico new file mode 100644 index 000000000..718d6fea4 Binary files /dev/null and b/apps/user-profile/public/favicon.ico differ diff --git a/apps/user-profile/public/vercel.svg b/apps/user-profile/public/vercel.svg new file mode 100644 index 000000000..fbf0e25a6 --- /dev/null +++ b/apps/user-profile/public/vercel.svg @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/apps/user-profile/src/components/README.md b/apps/user-profile/src/components/README.md new file mode 100644 index 000000000..b650795ab --- /dev/null +++ b/apps/user-profile/src/components/README.md @@ -0,0 +1,7 @@ +Our components should be relatively aligned with the Smart vs Dumb aka Container component pattern seen here: https://medium.com/@thejasonfile/dumb-components-and-smart-components-e7b33a698d43 + +The 'modules' directory contains specialty components grouped by feature or domain. + +The 'common' directory contains components shared across routes, used in multiple areas of the app. + +We're using folder structures and conventions very similar to those described here: https://hackernoon.com/structuring-projects-and-naming-components-in-react-1261b6e18d76 diff --git a/apps/user-profile/src/components/common/Button/Button.js b/apps/user-profile/src/components/common/Button/Button.js new file mode 100644 index 000000000..d050e6f2b --- /dev/null +++ b/apps/user-profile/src/components/common/Button/Button.js @@ -0,0 +1,106 @@ +import styled, { css } from "styled-components"; + +const shadeColor = (color, percent) => { + let R = parseInt(color.substring(1, 3), 16); + let G = parseInt(color.substring(3, 5), 16); + let B = parseInt(color.substring(5, 7), 16); + + R = parseInt((R * (100 + percent)) / 100, 10); + G = parseInt((G * (100 + percent)) / 100, 10); + B = parseInt((B * (100 + percent)) / 100, 10); + + R = R < 255 ? R : 255; + G = G < 255 ? G : 255; + B = B < 255 ? B : 255; + + const RR = + R.toString(16).length === 1 ? `0${R.toString(16)}` : R.toString(16); + const GG = + G.toString(16).length === 1 ? `0${G.toString(16)}` : G.toString(16); + const BB = + B.toString(16).length === 1 ? `0${B.toString(16)}` : B.toString(16); + + return `#${RR}${GG}${BB}`; +}; + +const colorUnderButtons = (hexColor) => { + const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hexColor); + return result + ? `rgba(${parseInt(result[1], 16) - 102},${parseInt(result[2], 16) - 55},${ + parseInt(result[3], 16) - 14 + },1)` + : null; +}; + +const onHoverBackgroundColor = (hexColor) => { + const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hexColor); + return result + ? `rgb(${parseInt(result[1], 16) + 44},${parseInt(result[2], 16) + 44},${ + parseInt(result[3], 16) + 44 + })` + : null; +}; +const Button = styled.a` + font-family: ${({ theme }) => theme.fonts.headline}, sans-serif; + background-color: ${({ theme, bgColor }) => bgColor || theme.colors.ACCENT_1}; + color: ${({ theme, textColor }) => textColor || theme.colors.NEUTRAL_2}; + transition: background-color 0.5s, color 0.5s; + + width: ${({ width }) => width || ""}; + border: 0px; + border-bottom: 3px solid + ${({ theme, bgColor }) => + colorUnderButtons(bgColor || theme.colors.ACCENT_1)}; + cursor: pointer; + font-size: ${({ fontSize }) => fontSize || "1.5rem"}; + margin-top: ${({ marginTop }) => marginTop || ""}; + padding: 0.5rem; + padding-left: 1rem; + padding-right: 1rem; + border-radius: 16px; + /* border-radius: ${({ borderRadius }) => borderRadius || "100px"}; */ + font-weight: bolder; + + ${({ hero }) => + hero && + css` + width: 80%; + margin: 0; + margin-top: 5%; + text-shadow: none; + line-height: 1.15; + display: inline-block; + text-align: center; + box-sizing: border-box; + font-stretch: normal; + font-variant-east-asian: normal; + font-variant-numeric: normal; + font-variant-caps: normal; + font-variant-ligatures: normal; + font-style: normal; + `} + ${({ modal }) => + modal && + css` + display: block; + width: 95%; + margin-top: 2%; + margin-left: auto; + margin-right: auto; + `} + ${({ intro }) => + intro && + css` + font-size: 2.5rem; + margin-top: 2%; + padding-left: 1.5rem; + padding-right: 1.5rem; + `} + &:hover { + background-color: ${({ theme, bgColor }) => + onHoverBackgroundColor(bgColor || theme.colors.ACCENT_2)}; + color: ${({ theme, bgColor }) => + (bgColor && shadeColor(bgColor, -40)) || theme.colors.ACCENT_3}; + } +`; +export default Button; diff --git a/apps/user-profile/src/components/common/Button/index.js b/apps/user-profile/src/components/common/Button/index.js new file mode 100644 index 000000000..c4719be7c --- /dev/null +++ b/apps/user-profile/src/components/common/Button/index.js @@ -0,0 +1 @@ +export { default } from "./Button"; diff --git a/apps/user-profile/src/components/common/Calendar/Calendar.js b/apps/user-profile/src/components/common/Calendar/Calendar.js new file mode 100644 index 000000000..99fb18f65 --- /dev/null +++ b/apps/user-profile/src/components/common/Calendar/Calendar.js @@ -0,0 +1,100 @@ +import React, { useState } from "react"; +import axios from "axios"; +import { DateTime } from "luxon"; +import { Wrapper, Event, Day, WeekdayTitle } from "./StyledCalendar"; + +const Calendar = ({ URL }) => { + // URL prop passed in from WeeksGlance component + const [eventList, setEventList] = useState([]); + + const current = DateTime.now(); + const max = current.plus({ days: 7 }); // max is 7 days from today + + /* sends a get request to Google Calendar API and parses the returned JSON to populate a new array with only the properties we need to display */ + + const makeRequest = () => { + axios + .get(URL) + .then((response) => { + const tempEventList = []; + response.data.items.forEach((entry) => { + // get the name, time, and weekday of each event and push them in to an array of Event objects. + const time = DateTime.fromISO(entry.start.dateTime, { + zone: entry.start.timeZone, + }).setZone(); + tempEventList.push({ + name: entry.summary, + time: time.toFormat("t"), + weekday: time.weekday, + }); + }); + + setEventList(tempEventList); + }) + .catch(() => {}); + }; + + React.useEffect(makeRequest, []); + + const weekdays = ["MON", "TUES", "WED", "THURS", "FRI", "SAT", "SUN"]; + const dates = []; + + /* first stores the dates of the previous weekdays in the Array, followed by today, followed by the remaining days in this week */ + const createDate = () => { + const todayInt = current.weekday; + for (let i = 1; i < todayInt; i++) { + dates.push(max.minus({ days: todayInt - i }).day); + } + dates.push(current.day); + + for (let i = todayInt + 1; i < 8; i++) { + dates.push(current.plus({ days: i - todayInt }).day); + } + + return dates; + }; + const dateslist = createDate(); + + return ( + + {weekdays.map((day, i) => { + // map through each day in the weekday array, and for each day, map through that day's list of events + const date = dateslist[i]; + return ( + + +
{day}
+ +
+ {date} +
+
+ {eventList.map(({ name, time, weekday }) => { + // destructuring each object in eventList to render just the name and time of the event + if (weekday === i + 1) { + return ( + + {name} +
+ {time} +
+ ); + } + return null; + })} + {eventList.filter(({ weekday }) => weekday === i + 1).length === // if there are no events on that day, display "No events" + 0 ? ( +
+ No events +
+ ) : ( + "" + )} +
+ ); + })} +
+ ); +}; + +export default Calendar; diff --git a/apps/user-profile/src/components/common/Calendar/StyledCalendar.js b/apps/user-profile/src/components/common/Calendar/StyledCalendar.js new file mode 100644 index 000000000..6eade9ebb --- /dev/null +++ b/apps/user-profile/src/components/common/Calendar/StyledCalendar.js @@ -0,0 +1,57 @@ +import Styled from "styled-components"; + +import theme from "../../../styles/theme"; + +export const Wrapper = Styled.div` + display: flex; + grid-area: WeeksGlance; + flex-direction: row; + width: 100%; +background-color: #DAD8D9; + + @media (orientation: portrait) { + flex-direction: column; + } +;`; + +export const Day = Styled.div` + display: flex; + color: #1c1c1c; + font-weight: 500; + padding-bottom: .5rem; + flex-direction: column; + font-size: 20px; + background-color: transparent; + width: 15%; + + @media (orientation: portrait) { + width:100%; + } +`; + +export const Event = Styled.div` + display: flex; + flex-wrap: wrap; + overflow: hidden; + white-space: nowrap; + background: bisque; + color: #f0edee; + width: 98%; + background-color: #ff7f0e; + margin-top: 1rem; + font-size: .9rem; + justify-content: center; + text-align: center; + padding-top: .3rem; + padding-bottom: .3rem; + font-family: roboto; +`; + +export const WeekdayTitle = Styled.div` + font-family: ${theme.fonts.headline}; + background-color: #f0edee; + color: #1c1c1c; + font-weight: 500; + padding-left: .5rem; + +`; diff --git a/apps/user-profile/src/components/common/Calendar/index.js b/apps/user-profile/src/components/common/Calendar/index.js new file mode 100644 index 000000000..6c64b5c40 --- /dev/null +++ b/apps/user-profile/src/components/common/Calendar/index.js @@ -0,0 +1 @@ +export { default } from "./Calendar"; diff --git a/apps/user-profile/src/components/common/Card/Attachments/Attachments.js b/apps/user-profile/src/components/common/Card/Attachments/Attachments.js new file mode 100644 index 000000000..a077f2383 --- /dev/null +++ b/apps/user-profile/src/components/common/Card/Attachments/Attachments.js @@ -0,0 +1,31 @@ +import React, { useState } from "react"; +import { + AttachmentLink, + AttachmentLinkContainer, + AttachmentImg, + AttachmentImgContainer, +} from "./StyledAttachments"; + +export default function Attachments(props) { + const [showAttachment, setShowAttachment] = useState(false); + + const imageClick = () => setShowAttachment(!showAttachment); + + return ( +
+ + imageClick()} /> + + + {showAttachment && ( + + {JSON.parse(props.data).map((item, i) => ( + + {item.name} + + ))} + + )} +
+ ); +} diff --git a/apps/user-profile/src/components/common/Card/Attachments/StyledAttachments.js b/apps/user-profile/src/components/common/Card/Attachments/StyledAttachments.js new file mode 100644 index 000000000..03277db73 --- /dev/null +++ b/apps/user-profile/src/components/common/Card/Attachments/StyledAttachments.js @@ -0,0 +1,40 @@ +import styled from "styled-components"; + +export const AttachmentLink = styled.a.attrs(() => ({ + target: "_blank", + rel: "noopener noreferrer", +}))` + color: lightslategray; + font-size: medium; + margin: 0.2em; +`; + +export const AttachmentLinkContainer = styled.div` + /* + margin-right: 1em; + margin-left: 1em; + */ + margin-bottom: 0.5em; + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: center; + align-items: center; +`; + +export const AttachmentImg = styled.img.attrs(() => ({ + src: "images/Attachment.png?webp", + alt: "attachment-icon", +}))` + width: 5vh; + height: 5vh; + cursor: pointer; +`; +export const AttachmentImgContainer = styled.div` + display: flex; + flex-direction: row; + justify-content: flex-start; + border-top: 1px solid lightgrey; + margin-top: 2%; + padding-top: 2%; +`; diff --git a/apps/user-profile/src/components/common/Card/Attachments/index.js b/apps/user-profile/src/components/common/Card/Attachments/index.js new file mode 100644 index 000000000..ee50388c2 --- /dev/null +++ b/apps/user-profile/src/components/common/Card/Attachments/index.js @@ -0,0 +1 @@ +export { default } from "./Attachments"; diff --git a/apps/user-profile/src/components/common/Card/Card.js b/apps/user-profile/src/components/common/Card/Card.js new file mode 100644 index 000000000..89a966bbf --- /dev/null +++ b/apps/user-profile/src/components/common/Card/Card.js @@ -0,0 +1,107 @@ +import React from "react"; +import { useRouter } from "next/router"; + +import Link from "next/link"; +import { + Container, + Content, + ImageHolder, + DataHolder, + Image, + Description, + SecondaryText, + AttachmentsContainer, + ActionsContainer, + TagsContainer, +} from "./StyledCard"; +import Tag from "../Tag"; + +import RainbowBar from "../RainbowBar"; + +import CardTitle from "./CardTitle"; +import Attachments from "./Attachments"; + +/** + * Props: + * - title: + * - description: + * - imageSrc: + * - size: + * - href: + * - onClick: + * - attachments: + * - textAlignment: changes text-alignment if passed otherwise it defaults to left text-alignment + * - imageHolderBackgroundColor: changes bgColor if passed otherwise it defaults to black bgColor + * - cardFlexDirection: changes flex-direction if existed otherwise delete flex-direction + */ +export default function Card(props) { + const router = useRouter(); + + return ( + + {props.noImage ? "" : + + {props.cardData.tags && ( + + {props.cardData.tags.map((tag, i) => ( + + ))} + + )} + {props.isLinkingInside ? ( + + + + + + ) : ( + + + + )} + + } + + {props.size === "large" ? "" : ()} + + + + + + {props.cardData.secondaryText && ( + {props.cardData.secondaryText} + )} + {props.cardData.description} + + {props.cardData.attachments && ( + + + + )} + {props.cardData.actions && ( + {props.cardData.actions} + )} + + + ); +} diff --git a/apps/user-profile/src/components/common/Card/CardTitle/CardTitle.js b/apps/user-profile/src/components/common/Card/CardTitle/CardTitle.js new file mode 100644 index 000000000..0825cfb65 --- /dev/null +++ b/apps/user-profile/src/components/common/Card/CardTitle/CardTitle.js @@ -0,0 +1,45 @@ +import Link from "next/link"; +import Image from "next/image"; +import React from "react"; + +import { Heading, Title } from "./StyledCardTitle"; + +export default function CardTitle({ + data, + attachment, + isLinkingInside, + pathname, +}) { + return ( + + {isLinkingInside ? ( + + {data.title} + + ) : ( + + {data.title} + + )} + + {attachment && ( + + github + + )} + + ); +} diff --git a/apps/user-profile/src/components/common/Card/CardTitle/StyledCardTitle.js b/apps/user-profile/src/components/common/Card/CardTitle/StyledCardTitle.js new file mode 100644 index 000000000..0ad359493 --- /dev/null +++ b/apps/user-profile/src/components/common/Card/CardTitle/StyledCardTitle.js @@ -0,0 +1,24 @@ +import styled from "styled-components"; + +export const Heading = styled.div` + display: flex; + align-items: flex-start; + width: 100%; + font-size: 1.4rem; + text-align: ${({ cardTitleAlignment }) => cardTitleAlignment || "left"}; + font-size: ${({ cardTitleSize }) => cardTitleSize || "1.4rem"}; + + ${({ cardTitleUnderline }) => { + const { color, thickness, type } = cardTitleUnderline; + return `border-bottom: ${color || "#00000000"} ${thickness || "0.15rem"} ${ + type || "solid" + };`; + }} +`; + +export const Title = styled.a` + font-family: "Abel", sans-serif; + color: black; + font-weight: bold; + flex: 1; +`; diff --git a/apps/user-profile/src/components/common/Card/CardTitle/index.js b/apps/user-profile/src/components/common/Card/CardTitle/index.js new file mode 100644 index 000000000..95e57d7d4 --- /dev/null +++ b/apps/user-profile/src/components/common/Card/CardTitle/index.js @@ -0,0 +1 @@ +export { default } from "./CardTitle"; diff --git a/apps/user-profile/src/components/common/Card/StyledCard.js b/apps/user-profile/src/components/common/Card/StyledCard.js new file mode 100644 index 000000000..78d6e5385 --- /dev/null +++ b/apps/user-profile/src/components/common/Card/StyledCard.js @@ -0,0 +1,104 @@ +import styled, { css } from "styled-components"; + +export const Container = styled.div` + margin: 0.5%; + width: ${({ size }) => (size === "large" ? "90%" : "24%")}; + background-color: white; + /* box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23); */ + display: flex; + flex-direction: ${({ size }) => (size === "large" ? "row" : "column")}; + @media (orientation: portrait) { + width: 100%; + margin-bottom: 5%; + } +`; + +export const Content = styled.div` + display: flex; + flex: 1; + /*flex-direction: ${({ flexDirection }) => flexDirection || "column"};*/ + flex-direction: ${({ size }) => (size === "large" ? "row" : "column")}; + ${({ size }) => + size === "large" && + css` + flex-direction: row; + justify-content: space-between; + `} + && { + flex-direction: ${({ flexDirection }) => flexDirection || "column"}; + } + align-items: center; + text-align: ${({ textAlignment }) => textAlignment || "left"}; +`; + +export const ImageHolder = styled.div` + position: relative; + width: ${({ size }) => (size === "large" ? "30%" : "100%")}; + height: ${({ size }) => (size === "large" ? "auto" : "25vh")}; + height: 25vh; + overflow: hidden; + + a { + display: flex; + width: 100%; + height: 100%; + } +`; +export const TagsContainer = styled.div` + text-align: center; + position: absolute; + top: 3%; + right: 1%; + display: grid; + gap: 0.5rem; +`; +export const Image = styled.div` + background-color: lightgray; + width: 100%; + height: 100%; + /* box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23); */ + cursor: pointer; + vertical-align: top; + margin-left: auto; + margin-right: auto; + + background-image: url(${(props) => props.imageSrc}); + background-size: cover; + background-position: center; + background-repeat: no-repeat; + /* outline: 2px solid black; */ +`; + +export const DataHolder = styled.div` + margin-top: 0.5em; + padding: 0.5rem; + width: 95%; + ${({ size }) => + size === "large" && + css` + width: 70%; + /*padding: 6.75%;*/ + `} +`; +export const SecondaryText = styled.div` + margin: 1% 0 2% 0; + font-size: 1rem; +`; +export const Description = styled.div` + width: 100%; + font-size: 1.2rem; + padding-top: 1%; +`; + +export const AttachmentsContainer = styled.div` + margin-top: auto; +`; +export const ActionsContainer = styled.div` + display: grid; + grid-auto-flow: column; + place-content: start; + gap: 2rem; + font-size: 1em; + font-family: ${({ theme }) => theme.fonts.headline}; + margin: 1rem 0 1rem 1rem; +`; diff --git a/apps/user-profile/src/components/common/Card/index.js b/apps/user-profile/src/components/common/Card/index.js new file mode 100644 index 000000000..c0424cdb7 --- /dev/null +++ b/apps/user-profile/src/components/common/Card/index.js @@ -0,0 +1 @@ +export { default } from "./Card"; diff --git a/apps/user-profile/src/components/common/CardGroup/CardGroup.js b/apps/user-profile/src/components/common/CardGroup/CardGroup.js new file mode 100644 index 000000000..5cf4816b2 --- /dev/null +++ b/apps/user-profile/src/components/common/CardGroup/CardGroup.js @@ -0,0 +1,28 @@ +import React from "react"; +import Card from "../Card/Card"; +import { Collection, CollectionTitle } from "./StyledCardGroup"; + +export default function CardGroup(props) { + return ( +
+ {props.title ? ( + + {props.title} + + ) : ( + + )} + + {Object.keys(props.cards || {}).length !== 0 && + props.cards.map((items, i) => ( + + ))} + +
+ ); +} diff --git a/apps/user-profile/src/components/common/CardGroup/StyledCardGroup.js b/apps/user-profile/src/components/common/CardGroup/StyledCardGroup.js new file mode 100644 index 000000000..8caf32746 --- /dev/null +++ b/apps/user-profile/src/components/common/CardGroup/StyledCardGroup.js @@ -0,0 +1,18 @@ +import styled from "styled-components"; + +export const Collection = styled.div` + width: 100%; + display: flex; + flex-direction: row; + justify-content: flex-start; + flex-wrap: wrap; + align-items: flex-start; + justify-content: ${({ cardGroupFlexDirection }) => + cardGroupFlexDirection || "flex-start"}; +`; + +export const CollectionTitle = styled.h3` + text-align: ${({ groupTitleAlignment }) => groupTitleAlignment || "left"}; + padding: 1%; + margin-bottom: 0; +`; diff --git a/apps/user-profile/src/components/common/CardGroup/index.js b/apps/user-profile/src/components/common/CardGroup/index.js new file mode 100644 index 000000000..444768871 --- /dev/null +++ b/apps/user-profile/src/components/common/CardGroup/index.js @@ -0,0 +1 @@ +export { default } from "./CardGroup"; diff --git a/apps/user-profile/src/components/common/CenteredHeadline/CenteredHeadline.js b/apps/user-profile/src/components/common/CenteredHeadline/CenteredHeadline.js new file mode 100644 index 000000000..9622e2611 --- /dev/null +++ b/apps/user-profile/src/components/common/CenteredHeadline/CenteredHeadline.js @@ -0,0 +1,9 @@ +import styled from "styled-components"; + +export const CenteredHeadline = styled.h1` + text-align: center; + margin-left: auto; + margin-right: auto; +`; + +export default CenteredHeadline; diff --git a/apps/user-profile/src/components/common/CenteredHeadline/index.js b/apps/user-profile/src/components/common/CenteredHeadline/index.js new file mode 100644 index 000000000..98ab2a3bf --- /dev/null +++ b/apps/user-profile/src/components/common/CenteredHeadline/index.js @@ -0,0 +1 @@ +export { default } from "./CenteredHeadline"; diff --git a/apps/user-profile/src/components/common/DiscordAvatar/DiscordAvatar.js b/apps/user-profile/src/components/common/DiscordAvatar/DiscordAvatar.js new file mode 100644 index 000000000..b6010fa37 --- /dev/null +++ b/apps/user-profile/src/components/common/DiscordAvatar/DiscordAvatar.js @@ -0,0 +1,13 @@ +import { Avatar } from "./StyledDiscordAvatar"; + +export default function DiscordAvatar({ discordId, avatarKey }) { + return ( + + ); +} diff --git a/apps/user-profile/src/components/common/DiscordAvatar/StyledDiscordAvatar.js b/apps/user-profile/src/components/common/DiscordAvatar/StyledDiscordAvatar.js new file mode 100644 index 000000000..454686740 --- /dev/null +++ b/apps/user-profile/src/components/common/DiscordAvatar/StyledDiscordAvatar.js @@ -0,0 +1,9 @@ +import styled from "styled-components"; + +export const Avatar = styled.img.attrs(() => ({ + alt: "Discord Profile Picture" +}))` + width: 50%; + border-radius: 50%; + align-self: end; +`; diff --git a/apps/user-profile/src/components/common/DiscordAvatar/index.js b/apps/user-profile/src/components/common/DiscordAvatar/index.js new file mode 100644 index 000000000..a9d147176 --- /dev/null +++ b/apps/user-profile/src/components/common/DiscordAvatar/index.js @@ -0,0 +1 @@ +export { default } from "./DiscordAvatar"; diff --git a/apps/user-profile/src/components/common/Dropdown/DropdownButton.js b/apps/user-profile/src/components/common/Dropdown/DropdownButton.js new file mode 100644 index 000000000..14ddc0a73 --- /dev/null +++ b/apps/user-profile/src/components/common/Dropdown/DropdownButton.js @@ -0,0 +1,42 @@ +import React, { useEffect, useState, useRef } from "react"; +import { Wrapper, Toggle, Rooms } from "./StyledDropdownButton"; + +const DropdownButton = ({ toggleBtnText, dropdownItems, className }) => { + const [menuOpen, setMenuOpen] = useState(false); + const node = useRef(); + + const handleClickOutside = (e) => { + if (node.current.contains(e.target)) return; + // outside click + setMenuOpen(false); + }; + + useEffect(() => { + if (menuOpen) { + document.addEventListener("mousedown", handleClickOutside); + } else { + document.removeEventListener("mousedown", handleClickOutside); + } + + return () => { + document.removeEventListener("mousedown", handleClickOutside); + }; + }, [menuOpen]); + + return ( + + setMenuOpen(!menuOpen)} + as="button" + fontSize="1.2rem" + > + {toggleBtnText} + + + <>{dropdownItems} + + + ); +}; + +export default DropdownButton; diff --git a/apps/user-profile/src/components/common/Dropdown/StyledDropdownButton.js b/apps/user-profile/src/components/common/Dropdown/StyledDropdownButton.js new file mode 100644 index 000000000..cc34302ff --- /dev/null +++ b/apps/user-profile/src/components/common/Dropdown/StyledDropdownButton.js @@ -0,0 +1,38 @@ +import styled from "styled-components"; +import Button from "../Button"; + +export const Wrapper = styled.div` + position: relative; + display: inline-block; +`; +export const Toggle = styled(Button)` + padding-left: 2rem; + padding-right: 2rem; +`; +export const Rooms = styled.div` + display: ${({ isOpen }) => (isOpen ? "block" : "none")}; + position: absolute; + right: 50%; + left: -50%; + background-color: #f1f1f1; + min-width: 160px; + overflow: auto; + box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2); + border: 1px solid black; + z-index: 1; + + & > * { + color: black; + border: 1px solid black; + padding: 12px 16px; + text-decoration: none; + text-align: center; + display: block; + + &:hover, + &:focus { + background-color: #ddd; + color: #000; + } + } +`; diff --git a/apps/user-profile/src/components/common/Dropdown/index.js b/apps/user-profile/src/components/common/Dropdown/index.js new file mode 100644 index 000000000..d06e95af1 --- /dev/null +++ b/apps/user-profile/src/components/common/Dropdown/index.js @@ -0,0 +1 @@ +export { default } from "./DropdownButton"; diff --git a/apps/user-profile/src/components/common/FlexPageSection/FlexPageSection.js b/apps/user-profile/src/components/common/FlexPageSection/FlexPageSection.js new file mode 100644 index 000000000..1eb915eaf --- /dev/null +++ b/apps/user-profile/src/components/common/FlexPageSection/FlexPageSection.js @@ -0,0 +1,42 @@ +import React from "react"; +import Wrapper from "./StyledFlexPageSection"; + +export default function FlexPageSection({ + children, + style = {}, + width, + height, + contentWidth = "100%", + // contentHeight = "100%", + flexDirection = "row", + justifyContent = "center", + alignItems = "center", + backgroundImage, +}) { + const styles = { + ...style, + width: width || style.width, + height: height || style.height, + display: style.display ? style.display : "flex", + flexDirection: style.flexDirection ? style.flexDirection : flexDirection, + justifyContent: style.justifyContent + ? style.justifyContent + : justifyContent, + alignItems: style.alignItems ? style.alignItems : alignItems, + backgroundImage: backgroundImage ? `url(${backgroundImage})` : "", + }; + const contentStyle = { + width: contentWidth, + // height: contentHeight, + display: style.display, + flexDirection: style.flexDirection, + justifyContent: style.justifyContent, + alignItems: style.alignItems, + }; + + return ( + +
{children}
+
+ ); +} diff --git a/apps/user-profile/src/components/common/FlexPageSection/StyledFlexPageSection.js b/apps/user-profile/src/components/common/FlexPageSection/StyledFlexPageSection.js new file mode 100644 index 000000000..2430fc03f --- /dev/null +++ b/apps/user-profile/src/components/common/FlexPageSection/StyledFlexPageSection.js @@ -0,0 +1,12 @@ +import styled from "styled-components"; + +const Wrapper = styled.div` + width: 100%; + margin: 0; + background-color: ${({ theme }) => theme.colors.NEUTRAL_2}; + + background-size: cover; + background-position: center; + background-repeat: no-repeat; +`; +export default Wrapper; diff --git a/apps/user-profile/src/components/common/FlexPageSection/index.js b/apps/user-profile/src/components/common/FlexPageSection/index.js new file mode 100644 index 000000000..5f3682f3f --- /dev/null +++ b/apps/user-profile/src/components/common/FlexPageSection/index.js @@ -0,0 +1 @@ +export { default } from "./FlexPageSection"; diff --git a/apps/user-profile/src/components/common/HamburgerMenu/HamburgerMenu.js b/apps/user-profile/src/components/common/HamburgerMenu/HamburgerMenu.js new file mode 100644 index 000000000..85d30fa8d --- /dev/null +++ b/apps/user-profile/src/components/common/HamburgerMenu/HamburgerMenu.js @@ -0,0 +1,137 @@ +import React from "react"; +import Link from "next/link"; +import Image from "next/image"; +import { slide as SlideHamburgerMenu } from "react-burger-menu"; +import style from "./HamburgerMenu.module.css"; +import logoMonogramImage from "../../../images/logo-monogram.png?webp"; +import Logout from "../../../utils/Logout"; +import { env } from "../../../utils/EnvironmentVariables"; +import { useUserDataContext } from "../../../context/UserDataContext"; + +function HamburgerMenu() { + const { userData } = useUserDataContext(); + const [menuOpen, setMenuOpen] = React.useState(false); + + // Called when the open/close state of the menu changes (onStateChange callback) + const isMenuOpen = (state) => { + setMenuOpen(state.isOpen); + }; + + // Called whenever a navigation item in the menu is clicked (closes menu) + const handleNavClick = () => { + setMenuOpen(false); + }; + + return ( + +
+
+
+ + +
+ Logo +
+
+ +
+
+
+
+ + +
CREATE
+
+ + + +
LEARN
+
+ + +
+ {userData?.id ? ( + <> + + +
VISIT ACCOUNT PAGE
+
+ + +
LOG OUT
+
+ + ) : ( + +
SIGN IN
+
+ )} +
+ + {/* } + +
PLAY
+ + { */} + + +
EARN
+
+ + + +
SUPPORT US
+
+ + + +
JOIN
+
+ +
+ {/* } +
+ {authUser ? ( + + ) : ( + + )} +
+ { */} +
+ {/* }
Dev Launchers
*/} +
+
+ ); +} + +export default HamburgerMenu; diff --git a/apps/user-profile/src/components/common/HamburgerMenu/HamburgerMenu.module.css b/apps/user-profile/src/components/common/HamburgerMenu/HamburgerMenu.module.css new file mode 100644 index 000000000..0136757f2 --- /dev/null +++ b/apps/user-profile/src/components/common/HamburgerMenu/HamburgerMenu.module.css @@ -0,0 +1,74 @@ +.burgerButton { + position: fixed; + min-height: 5vh; + min-width: 5vh; + right: 1.5vh; + top: 1.5vh; + + display: none; /* Only display on mobile */ +} + +.menuBody { + top: 0; +} +.overlay { + top: 0px; + right: 0px; +} +.burgerBar { + background: #d9d9d9; +} + +.crossClass { + background: #d9d9d9; +} + +.Logo { + margin-top: 20%; + width: 50%; +} +.Logo a { + display: inline-flex; + flex-direction: row; + flex-wrap: wrap; + align-items: center; +} +.LogoWrapper { + display: inline; + width: auto; +} +.LogoWrapper:hover { + filter: brightness(0) saturate(100%) invert(88%) sepia(10%) saturate(6102%) + hue-rotate(358deg) brightness(101%) contrast(103%); +} +.LogoImageHolder { + width: 100%; + margin: 2%; + margin-bottom: 0; +} +.LogoImage { + display: inline-block; + width: 100%; +} +.LogoWords { + position: absolute; + bottom: 5%; + text-align: center; + width: 100%; + font-family: "Abel", sans-serif; + font-size: 1.25rem; + margin-left: 0.25rem; + line-height: 140%; +} + +.navEntry { + text-align: center; + width: 100%; + margin-top: 10%; +} + +@media (orientation: portrait) { + .burgerButton { + display: block; + } +} diff --git a/apps/user-profile/src/components/common/HamburgerMenu/index.js b/apps/user-profile/src/components/common/HamburgerMenu/index.js new file mode 100644 index 000000000..47411f2f2 --- /dev/null +++ b/apps/user-profile/src/components/common/HamburgerMenu/index.js @@ -0,0 +1 @@ +export { default } from "./HamburgerMenu"; diff --git a/apps/user-profile/src/components/common/Header/AccountDropdown/AccountDropdown.js b/apps/user-profile/src/components/common/Header/AccountDropdown/AccountDropdown.js new file mode 100644 index 000000000..04cb0f8b1 --- /dev/null +++ b/apps/user-profile/src/components/common/Header/AccountDropdown/AccountDropdown.js @@ -0,0 +1,37 @@ +import React from "react"; +import Link from "next/link"; +import Logout from "../../../../utils/Logout"; +import { env } from "../../../../utils/EnvironmentVariables"; +import { + AccountMenuDropdownItem, + AccountMenuDropdownButton, + MenuButton, +} from "./StyledAccountDropdown"; + +export default function AccountDropdown(props) { + return ( +
+ {props?.userData?.id && props?.userData?.username ? ( + + + + Visit Account Page + + + + Logout + + + } + > + ) : ( + + Sign In + + )} +
+ ); +} diff --git a/apps/user-profile/src/components/common/Header/AccountDropdown/StyledAccountDropdown.js b/apps/user-profile/src/components/common/Header/AccountDropdown/StyledAccountDropdown.js new file mode 100644 index 000000000..8e08734cd --- /dev/null +++ b/apps/user-profile/src/components/common/Header/AccountDropdown/StyledAccountDropdown.js @@ -0,0 +1,31 @@ +import styled from "styled-components"; +import DropdownButton from "../../Dropdown"; +import Button from "../../Button"; + +export const AccountMenuDropdownButton = styled(DropdownButton)` + @media (orientation: portrait) { + display: none; + } +`; + +export const MenuButton = styled(Button)` + @media (orientation: portrait) { + display: none; + } +`; + +export const AccountMenuDropdownItem = styled.a` + font-family: ${({ theme }) => theme.fonts.headline}, sans-serif; + background-color: #1c1c1c; + + width: ${({ width }) => width || ""}; + border: 0px; + + cursor: pointer; + font-size: ${({ fontSize }) => fontSize || "1.1rem"}; + margin-top: ${({ marginTop }) => marginTop || ""}; + padding: 0.5rem; + padding-left: 1rem; + padding-right: 1rem; + font-weight: bolder; +`; diff --git a/apps/user-profile/src/components/common/Header/AccountDropdown/index.js b/apps/user-profile/src/components/common/Header/AccountDropdown/index.js new file mode 100644 index 000000000..ff7b7ab66 --- /dev/null +++ b/apps/user-profile/src/components/common/Header/AccountDropdown/index.js @@ -0,0 +1 @@ +export { default } from "./AccountDropdown"; diff --git a/apps/user-profile/src/components/common/Header/Header.js b/apps/user-profile/src/components/common/Header/Header.js new file mode 100644 index 000000000..541d4b327 --- /dev/null +++ b/apps/user-profile/src/components/common/Header/Header.js @@ -0,0 +1,68 @@ +import React from "react"; +import Link from "next/link"; +import AccountDropdown from "./AccountDropdown"; + +import { + HeaderBlock, + Logo, + LogoWrapper, + LogoImageHolder, + LogoImage, + LogoWords, + HeaderNav, + NavEntry, +} from "./StyledHeader"; + +import { useUserDataContext } from "../../../context/UserDataContext"; +import HamburgerMenu from "../HamburgerMenu"; + +export default function Header() { + const { userData } = useUserDataContext(); + + return ( + + + + + + + + + Dev Launchers + + + + + + + + CREATE + + + + + LEARN + + + {/* } + + PLAY + + { */} + + + SUPPORT US + + + + + JOIN + + + +
+ + + + ); +} diff --git a/apps/user-profile/src/components/common/Header/StyledHeader.js b/apps/user-profile/src/components/common/Header/StyledHeader.js new file mode 100644 index 000000000..2870feaec --- /dev/null +++ b/apps/user-profile/src/components/common/Header/StyledHeader.js @@ -0,0 +1,121 @@ +import styled from "styled-components"; +import logoMonogramImage from "../../../images/logo-monogram.png?webp"; + +export const HeaderBlock = styled.div` + background-color: #1c1c1c; + min-height: 7.5vh; + width: 100%; + position: sticky; + top: 0; + z-index: 2; + + display: flex; + justify-content: space-between; + align-items: center; + + /* box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23); */ + + a { + color: ${({ theme }) => theme.colors.NEUTRAL_2}; + } +`; +export const Logo = styled.div` + width: 30%; + + a { + display: inline-flex; + flex-direction: row; + flex-wrap: nowrap; + align-items: center; + } +`; + +export const LogoWrapper = styled.div` + display: inline; + width: auto; + transition: 1s; + + &:hover { + filter: brightness(0) saturate(100%) invert(88%) sepia(10%) saturate(6102%) + hue-rotate(358deg) brightness(101%) contrast(103%); + } +`; + +export const LogoImageHolder = styled.div` + width: 3rem; + margin: 2%; + margin-bottom: 0; + @media (orientation: portrait) { + height: auto; + width: 4rem; + margin-left: 1vw; + } +`; +export const LogoImage = styled.img.attrs(() => ({ + src: logoMonogramImage, + alt: "logo", +}))` + display: inline-block; + width: 100%; +`; +export const LogoWords = styled.div` + width: 15rem; + font-family: "Abel", sans-serif; + font-size: 1.75rem; + margin-left: 0.25rem; + line-height: 140%; + @media (orientation: portrait) { + display: none; + } +`; + +export const HeaderNav = styled.div` + display: flex; + flex-direction: row; + justify-content: space-between; + font-size: 1rem; + width: 40%; + min-width: 300px; + height: 7.5vh; + align-items: center; + transition: 0.5s; + + & > a { + display: flex; + height: 100%; + align-items: center; + } + + @media (orientation: portrait) { + display: none; + } +`; + +export const NavEntry = styled.div` + font-family: "Abel", sans-serif; + cursor: pointer; +`; + +export const SignInArea = styled.div` + width: 10%; + text-align: center; + display: flex; + justify-content: space-around; + align-items: center; + @media (orientation: portrait) { + display: none; + } +`; +export const UserProfilePic = styled.img.attrs(() => ({ + alt: "profile-pic", +}))` + max-height: 3rem; + min-height: 2rem; + height: 5vw; + cursor: pointer; +`; +export const HeaderPusher = styled.div` + position: "relative"; + width: "100%"; + min-height: "7.5vh"; +`; diff --git a/apps/user-profile/src/components/common/Header/index.js b/apps/user-profile/src/components/common/Header/index.js new file mode 100644 index 000000000..2764567d9 --- /dev/null +++ b/apps/user-profile/src/components/common/Header/index.js @@ -0,0 +1 @@ +export { default } from "./Header"; diff --git a/apps/user-profile/src/components/common/Loader/Loader.js b/apps/user-profile/src/components/common/Loader/Loader.js new file mode 100644 index 000000000..899e5f62f --- /dev/null +++ b/apps/user-profile/src/components/common/Loader/Loader.js @@ -0,0 +1,12 @@ + + + +/** + * This is a component that will show a loading page. + * @return {*} + */ +const Loader = () => { + return (Loading.....) +} + +export default Loader; \ No newline at end of file diff --git a/apps/user-profile/src/components/common/Loader/index.js b/apps/user-profile/src/components/common/Loader/index.js new file mode 100644 index 000000000..439cf3c8a --- /dev/null +++ b/apps/user-profile/src/components/common/Loader/index.js @@ -0,0 +1 @@ +export { default } from "./Loader"; \ No newline at end of file diff --git a/apps/user-profile/src/components/common/Modal/Modal.js b/apps/user-profile/src/components/common/Modal/Modal.js new file mode 100644 index 000000000..7b40d6055 --- /dev/null +++ b/apps/user-profile/src/components/common/Modal/Modal.js @@ -0,0 +1,35 @@ +import React from "react"; +import ReactModal from "react-modal"; + +import { ModalContent, customModalStyles } from "./StyledModal"; + +ReactModal.setAppElement("#__next"); + +export default function Modal(props) { + const [modalContent] = React.useState(props.modalContent); + + // Modal functions + const [modalIsOpen, setModalIsOpen] = React.useState(props.modalIsOpen); + const openModal = () => { + setModalIsOpen(true); + }; + const closeModal = () => { + setModalIsOpen(false); + }; + const afterOpenModal = () => {}; + + return ( + + + {props.modalContent ? props.modalContent : modalContent} + + + ); +} diff --git a/apps/user-profile/src/components/common/Modal/StyledModal.js b/apps/user-profile/src/components/common/Modal/StyledModal.js new file mode 100644 index 000000000..2cc89cb5f --- /dev/null +++ b/apps/user-profile/src/components/common/Modal/StyledModal.js @@ -0,0 +1,24 @@ +import styled from "styled-components"; + +export const ModalContent = styled.div` + width: 100%; + height: 100%; + font-family: "Abel", sans-serif; +`; + +// Modal set up +export const customModalStyles = { + content: { + position: "absolute", + width: "70%", + height: "80%", + top: "50%", + left: "50%", + right: "auto", + bottom: "auto", + marginRight: "-50%", + transform: "translate(-50%, -50%)", + zIndex: 1001 + }, + overlay: { zIndex: 1000, backgroundColor: "rgba(0,0,0,.75)" } +}; diff --git a/apps/user-profile/src/components/common/Modal/index.js b/apps/user-profile/src/components/common/Modal/index.js new file mode 100644 index 000000000..09b91f72b --- /dev/null +++ b/apps/user-profile/src/components/common/Modal/index.js @@ -0,0 +1 @@ +export { default } from "./Modal"; diff --git a/apps/user-profile/src/components/common/PageBody/PageBody.js b/apps/user-profile/src/components/common/PageBody/PageBody.js new file mode 100644 index 000000000..791cf0bea --- /dev/null +++ b/apps/user-profile/src/components/common/PageBody/PageBody.js @@ -0,0 +1,12 @@ +import React from "react"; +import Wrapper from "./StyledPageBody"; + +export default function PageBody({ + children, + style = {}, + width = "100%", + height = "auto", +}) { + const styles = { ...style, width, height }; + return {children}; +} diff --git a/apps/user-profile/src/components/common/PageBody/StyledPageBody.js b/apps/user-profile/src/components/common/PageBody/StyledPageBody.js new file mode 100644 index 000000000..513525609 --- /dev/null +++ b/apps/user-profile/src/components/common/PageBody/StyledPageBody.js @@ -0,0 +1,9 @@ +import styled from "styled-components"; + +const Wrapper = styled.div` + width: 100%; + margin-left: auto; + margin-right: auto; + background-color: ${({ theme }) => theme.colors.NEUTRAL_2}; +`; +export default Wrapper; diff --git a/apps/user-profile/src/components/common/PageBody/index.js b/apps/user-profile/src/components/common/PageBody/index.js new file mode 100644 index 000000000..8ad6e3e87 --- /dev/null +++ b/apps/user-profile/src/components/common/PageBody/index.js @@ -0,0 +1 @@ +export { default } from "./PageBody"; diff --git a/apps/user-profile/src/components/common/RainbowBar/RainbowBar.js b/apps/user-profile/src/components/common/RainbowBar/RainbowBar.js new file mode 100644 index 000000000..7ae4005a6 --- /dev/null +++ b/apps/user-profile/src/components/common/RainbowBar/RainbowBar.js @@ -0,0 +1,16 @@ +import React from "react"; +import { withTheme } from "styled-components"; +import { Wrapper, BarSection } from "./StyledRainbowBar"; + +function RainbowBar({ width = "100%", height = ".5rem", theme }) { + return ( + + + + + + + ); +} + +export default withTheme(RainbowBar); diff --git a/apps/user-profile/src/components/common/RainbowBar/StyledRainbowBar.js b/apps/user-profile/src/components/common/RainbowBar/StyledRainbowBar.js new file mode 100644 index 000000000..5a8219cd6 --- /dev/null +++ b/apps/user-profile/src/components/common/RainbowBar/StyledRainbowBar.js @@ -0,0 +1,15 @@ +import styled from "styled-components"; + +export const Wrapper = styled.div` + width: ${props => props.width}; + height: ${props => props.height}; + display: flex; + flex-direction: row; + flex-basis: auto; + align-items: stretch; +`; + +export const BarSection = styled.div` + width: 33.333333%; + background-color: ${props => props.color}; +`; diff --git a/apps/user-profile/src/components/common/RainbowBar/index.js b/apps/user-profile/src/components/common/RainbowBar/index.js new file mode 100644 index 000000000..da66b1d3d --- /dev/null +++ b/apps/user-profile/src/components/common/RainbowBar/index.js @@ -0,0 +1 @@ +export { default } from "./RainbowBar"; diff --git a/apps/user-profile/src/components/common/Section/Section.js b/apps/user-profile/src/components/common/Section/Section.js new file mode 100644 index 000000000..62dfd1d70 --- /dev/null +++ b/apps/user-profile/src/components/common/Section/Section.js @@ -0,0 +1,21 @@ +import React from "react"; +import CardGroup from "../CardGroup"; +import { Group, Wrapper } from "./StyledSection"; + +export default function Section(props) { + return ( + +

{props.title}

+
+ {Object.keys(props.data).map((groupTitle, i) => { + const group = props.data[groupTitle]; + return ( + + + + ); + })} +
+
+ ); +} diff --git a/apps/user-profile/src/components/common/Section/StyledSection.js b/apps/user-profile/src/components/common/Section/StyledSection.js new file mode 100644 index 000000000..9c3fca16b --- /dev/null +++ b/apps/user-profile/src/components/common/Section/StyledSection.js @@ -0,0 +1,16 @@ +import styled from "styled-components"; + +export const Wrapper = styled.div` + border-left: 1px solid black; + margin-bottom: 10%; + + h2 { + margin-left: 2%; + margin-bottom: 0; + } +`; + +export const Group = styled.div` + border-left: 1px solid black; + margin-left: 2%; +`; diff --git a/apps/user-profile/src/components/common/Section/index.js b/apps/user-profile/src/components/common/Section/index.js new file mode 100644 index 000000000..670456950 --- /dev/null +++ b/apps/user-profile/src/components/common/Section/index.js @@ -0,0 +1 @@ +export { default } from "./Section"; diff --git a/apps/user-profile/src/components/common/ShadowCard/ShadowCard.js b/apps/user-profile/src/components/common/ShadowCard/ShadowCard.js new file mode 100644 index 000000000..4927c1e89 --- /dev/null +++ b/apps/user-profile/src/components/common/ShadowCard/ShadowCard.js @@ -0,0 +1,28 @@ +import React from "react"; + +export default function ShadowCard({ + children, + width = "80%", + height = "90%", + padding = "2rem", +}) { + return ( +
+ {children} +
+ ); +} diff --git a/apps/user-profile/src/components/common/ShadowCard/index.js b/apps/user-profile/src/components/common/ShadowCard/index.js new file mode 100644 index 000000000..423a84eb7 --- /dev/null +++ b/apps/user-profile/src/components/common/ShadowCard/index.js @@ -0,0 +1 @@ +export { default } from "./ShadowCard"; diff --git a/apps/user-profile/src/components/common/SignUpForm/FormEntry/FormEntry.js b/apps/user-profile/src/components/common/SignUpForm/FormEntry/FormEntry.js new file mode 100644 index 000000000..e93f71bb4 --- /dev/null +++ b/apps/user-profile/src/components/common/SignUpForm/FormEntry/FormEntry.js @@ -0,0 +1,20 @@ +import React from "react"; + +import { FormEntryHolder, FormEntryTitle } from "./StyledFormEntry"; + +export default function FormEntry(props) { + return ( + + + + ); +} diff --git a/apps/user-profile/src/components/common/SignUpForm/FormEntry/StyledFormEntry.js b/apps/user-profile/src/components/common/SignUpForm/FormEntry/StyledFormEntry.js new file mode 100644 index 000000000..82aecad4f --- /dev/null +++ b/apps/user-profile/src/components/common/SignUpForm/FormEntry/StyledFormEntry.js @@ -0,0 +1,17 @@ +import styled from "styled-components"; + +export const FormEntryHolder = styled.div` + margin: 5%; + font-size: 1.5rem; + margin: 3%; + padding: 2%; + padding-bottom: 4%; +`; + +export const FormEntryTitle = styled.div` + width: 85%; + text-align: left; + margin-left: auto; + margin-right: auto; + font-size: 2.5rem; +`; diff --git a/apps/user-profile/src/components/common/SignUpForm/FormEntry/index.js b/apps/user-profile/src/components/common/SignUpForm/FormEntry/index.js new file mode 100644 index 000000000..4c467497c --- /dev/null +++ b/apps/user-profile/src/components/common/SignUpForm/FormEntry/index.js @@ -0,0 +1 @@ +export { default } from "./FormEntry"; diff --git a/apps/user-profile/src/components/common/SignUpForm/InputField/InputField.js b/apps/user-profile/src/components/common/SignUpForm/InputField/InputField.js new file mode 100644 index 000000000..44efe580c --- /dev/null +++ b/apps/user-profile/src/components/common/SignUpForm/InputField/InputField.js @@ -0,0 +1,47 @@ +import React from "react"; + +import { useField, splitFormProps } from "react-form"; + +import { FormInput } from "./StyledInputField"; + +const InputField = React.forwardRef((props, ref) => { + // Let's use splitFormProps to get form-specific props + const [field, fieldOptions, rest] = splitFormProps(props); + + // Use the useField hook with a field and field options + // to access field state + const { + meta: { error, isTouched, isValidating, message }, + getInputProps, + } = useField(field, fieldOptions); + + const Validate = () => { + if (isValidating) { + return Validating...; + } + if (isTouched && error) { + return {error}; + } + if (message) { + return {message}; + } + return null; + }; + // Build the field + return ( + <> + +
+ {/* + Let's inline some validation and error information + for our field + */} + + {Validate()} +
+ + ); +}); + +InputField.displayName = "InputField"; +export default InputField; diff --git a/apps/user-profile/src/components/common/SignUpForm/InputField/StyledInputField.js b/apps/user-profile/src/components/common/SignUpForm/InputField/StyledInputField.js new file mode 100644 index 000000000..34e649ccb --- /dev/null +++ b/apps/user-profile/src/components/common/SignUpForm/InputField/StyledInputField.js @@ -0,0 +1,14 @@ +import styled from "styled-components"; + +export const FormInput = styled.input` + font-size: 4rem; + color: white; + background-color: transparent; + outline: none; + border: none; + border-bottom: 2px solid white; + + @media (orientation: portrait) { + font-size: 2rem; + } +`; diff --git a/apps/user-profile/src/components/common/SignUpForm/InputField/index.js b/apps/user-profile/src/components/common/SignUpForm/InputField/index.js new file mode 100644 index 000000000..f2820d0d9 --- /dev/null +++ b/apps/user-profile/src/components/common/SignUpForm/InputField/index.js @@ -0,0 +1 @@ +export { default } from "./InputField"; diff --git a/apps/user-profile/src/components/common/SignUpForm/ProgressBar/ProgressBar.js b/apps/user-profile/src/components/common/SignUpForm/ProgressBar/ProgressBar.js new file mode 100644 index 000000000..376802968 --- /dev/null +++ b/apps/user-profile/src/components/common/SignUpForm/ProgressBar/ProgressBar.js @@ -0,0 +1,11 @@ +import React from "react"; + +import { BarBackground, BarForeground } from "./StyledProgressBar"; + +export default function ProgressBar(props) { + return ( + + + + ); +} diff --git a/apps/user-profile/src/components/common/SignUpForm/ProgressBar/StyledProgressBar.js b/apps/user-profile/src/components/common/SignUpForm/ProgressBar/StyledProgressBar.js new file mode 100644 index 000000000..a9357453c --- /dev/null +++ b/apps/user-profile/src/components/common/SignUpForm/ProgressBar/StyledProgressBar.js @@ -0,0 +1,12 @@ +import styled from "styled-components"; + +export const BarBackground = styled.div` + width: 100%; + height: 2rem; + background-color: black; +`; + +export const BarForeground = styled.div` + height: 100%; + background-color: white; +`; diff --git a/apps/user-profile/src/components/common/SignUpForm/ProgressBar/index.js b/apps/user-profile/src/components/common/SignUpForm/ProgressBar/index.js new file mode 100644 index 000000000..7b773c6e1 --- /dev/null +++ b/apps/user-profile/src/components/common/SignUpForm/ProgressBar/index.js @@ -0,0 +1 @@ +export { default } from "./ProgressBar"; diff --git a/apps/user-profile/src/components/common/SignUpForm/ScheduleOrientationButton/ScheduleOrientationButton.js b/apps/user-profile/src/components/common/SignUpForm/ScheduleOrientationButton/ScheduleOrientationButton.js new file mode 100644 index 000000000..bc9a9c9aa --- /dev/null +++ b/apps/user-profile/src/components/common/SignUpForm/ScheduleOrientationButton/ScheduleOrientationButton.js @@ -0,0 +1,21 @@ +import React from "react"; +import { openPopupWidget } from "react-calendly"; + +import Button from "../../Button"; + +export default function ScheduleOrientationButton(props) { + return ( + + ); +} diff --git a/apps/user-profile/src/components/common/SignUpForm/ScheduleOrientationButton/index.js b/apps/user-profile/src/components/common/SignUpForm/ScheduleOrientationButton/index.js new file mode 100644 index 000000000..ae41ad928 --- /dev/null +++ b/apps/user-profile/src/components/common/SignUpForm/ScheduleOrientationButton/index.js @@ -0,0 +1 @@ +export { default } from "./ScheduleOrientationButton"; diff --git a/apps/user-profile/src/components/common/SignUpForm/SelectField/SelectField.js b/apps/user-profile/src/components/common/SignUpForm/SelectField/SelectField.js new file mode 100644 index 000000000..e4d5f4254 --- /dev/null +++ b/apps/user-profile/src/components/common/SignUpForm/SelectField/SelectField.js @@ -0,0 +1,44 @@ +import React from "react"; + +import { useField, splitFormProps } from "react-form"; + +export default function SelectField(props) { + const [field, fieldOptions, { options, ...rest }] = splitFormProps(props); + + const { + setValue, + form, + meta: { error, isTouched }, + } = useField(field, fieldOptions); + + const handleSelectChange = (e) => { + setValue(e.target.value); + }; + + const currentValue = + form.values[field] === "" || form.values[field].length === 0 + ? "none" + : form.values[field]; + + return ( +
+ {" "} + {isTouched && error ? {error} : null} +
+ ); +} diff --git a/apps/user-profile/src/components/common/SignUpForm/SelectField/index.js b/apps/user-profile/src/components/common/SignUpForm/SelectField/index.js new file mode 100644 index 000000000..7ab5ade68 --- /dev/null +++ b/apps/user-profile/src/components/common/SignUpForm/SelectField/index.js @@ -0,0 +1 @@ +export { default } from "./SelectField"; diff --git a/apps/user-profile/src/components/common/SignUpForm/SignUpForm.js b/apps/user-profile/src/components/common/SignUpForm/SignUpForm.js new file mode 100644 index 000000000..9f4e9d1b9 --- /dev/null +++ b/apps/user-profile/src/components/common/SignUpForm/SignUpForm.js @@ -0,0 +1,299 @@ +/* eslint-disable no-nested-ternary */ +import React from "react"; +import { useForm } from "react-form"; +import axios from "axios"; +// eslint-disable-next-line no-unused-vars +import regeneratorRuntime from "regenerator-runtime"; + +import { FormOuter, FormContainer, StyledForm } from "./StyledSignUpForm"; + +import Button from "../Button"; + +import ProgressBar from "./ProgressBar"; +import FormEntry from "./FormEntry"; +import InputField from "./InputField"; +import SelectField from "./SelectField"; +import TextAreaField from "./TextAreaField"; + +function validateEmail(email) { + const re = + /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; + return re.test(String(email).toLowerCase()); +} + +const formEntries = [ + + (!value ? "Required" : false)} + /> + , + + + (!value ? "Required" : false)} + /> + , + + + (!value ? "Required" : false)} + /> + , + + + { + if (!value) { + return "Email is required"; + } + + if (!validateEmail(value)) { + return "Please enter a valid email addresss"; + } + + // We're going to mock that for now + await new Promise((resolve) => setTimeout(resolve, 2000)); + + return value === "tanner@gmail.com" + ? "Email is already being used" + : false; + }} + /> + , + + + + value < 13 ? "You must be at least 13 years old" : false + } + min="1" + /> + , + + + (!value ? "This is required!" : false)} + /> + , + + + + , + + + + , + + + (!value ? "This is required!" : false)} + /> + , +]; + +export default function SignUpForm(props) { + const [submittingForm, setSubmittingForm] = React.useState(false); + const [isFormValidated, setIsFormValidated] = React.useState(false); + const [formPage, setFormPage] = React.useState(0); + const incrementFormPage = () => { + setFormPage(formPage + 1); + }; + const decrementFormPage = () => { + setFormPage(formPage - 1); + }; + const [progressPercent, setProgressPercent] = React.useState(0); + const [formSubmitted, setFormSubmitted] = React.useState(false); + + const onSubmit = async (values) => { + if (!isFormValidated) { + if (formPage < formEntries.length - 1) incrementFormPage(); + return; + } + + setSubmittingForm(true); + + const axiosInstance = axios.create({ + baseURL: + "https://script.google.com/macros/s/AKfycby9cNYNtLoRg68F8KhibzBam0sonk0Q-h_qQke9qeep5vOw2zICKbBtxOcCCQSyNznHhA", + timeout: 10000, + headers: { "Content-Type": "multipart/form-data" }, + }); + axiosInstance + .get("/exec", { params: values }) + .then(() => { + // handle success + setSubmittingForm(false); + setFormSubmitted(true); + }) + .catch(() => { + // handle error + // console.log(response); + }); + }; + + const defaultValues = React.useMemo( + () => ({ + project: props.projectName, + name: "", + role: props.roleName, + email: "", + age: "", + level: "", + experience: "", + reason: "", + accepted: "", + }), + [] + ); + + const { + Form, + meta: { canSubmit }, + } = useForm({ + defaultValues, + validate: (values) => { + // Check if all fields have been filled + let isValidated = true; + Object.keys(values).forEach((key) => { + if (values[key] === "") { + isValidated = false; + } + }); + setIsFormValidated(isValidated); + return false; + }, + onSubmit, + debugForm: false, + }); + + // Update progressPercent when formPage changes + React.useEffect(() => { + setProgressPercent(((formPage * 1.0) / (formEntries.length - 1)) * 100); + }, [formPage]); + + return ( + + {formSubmitted ? ( +
+ Thanks for submitting your application! +
+
+ ) : ( + +
+ {formPage > 0 ? ( + + ) : ( + "" + )} +
Join project!
+
+ + {formEntries[formPage]} + + {submittingForm ? ( + "Submitting your information..." + ) : formPage === formEntries.length - 1 ? ( + !isFormValidated ? ( + + It appears some form elements have not been filled out! + + ) : ( +
+ +
+ ) + ) : ( + "" + )} +
+ + {formPage < formEntries.length - 1 ? ( + + ) : ( + "" + )} + {formPage > 0 ? ( + + ) : ( + "" + )} +
+ )} +
+ ); +} diff --git a/apps/user-profile/src/components/common/SignUpForm/StyledSignUpForm.js b/apps/user-profile/src/components/common/SignUpForm/StyledSignUpForm.js new file mode 100644 index 000000000..95b063c99 --- /dev/null +++ b/apps/user-profile/src/components/common/SignUpForm/StyledSignUpForm.js @@ -0,0 +1,34 @@ +import styled from "styled-components"; + +export const FormOuter = styled.div` + width: 100%; + padding-top: 2%; + padding-bottom: 2%; + background-size: cover; + background-position: center; + background-repeat: no-repeat; +`; + +export const FormContainer = styled.div` + width: 80%; + min-height: 60vh; + padding: 2%; + margin-left: auto; + margin-right: auto; + background-color: rgba(0, 0, 0, 0.75); + + display: flex; + flex-direction: column; + justify-content: space-around; + + @media (orientation: portrait) { + width: 90%; + } +`; + +export const StyledForm = styled.div` + background-color: transparent; + text-align: center; + font-size: 4rem; + color: white; +`; diff --git a/apps/user-profile/src/components/common/SignUpForm/TextAreaField/StyledTextAreaField.js b/apps/user-profile/src/components/common/SignUpForm/TextAreaField/StyledTextAreaField.js new file mode 100644 index 000000000..45fc42e5a --- /dev/null +++ b/apps/user-profile/src/components/common/SignUpForm/TextAreaField/StyledTextAreaField.js @@ -0,0 +1,11 @@ +import styled from "styled-components"; + +export const FormTextArea = styled.textarea` + width: 85%; + font-size: 2rem; + color: white; + background-color: transparent; + outline: none; + border: none; + border-bottom: 2px solid white; +`; diff --git a/apps/user-profile/src/components/common/SignUpForm/TextAreaField/TextAreaField.js b/apps/user-profile/src/components/common/SignUpForm/TextAreaField/TextAreaField.js new file mode 100644 index 000000000..4275cb2f7 --- /dev/null +++ b/apps/user-profile/src/components/common/SignUpForm/TextAreaField/TextAreaField.js @@ -0,0 +1,47 @@ +import React from "react"; + +import { useField, splitFormProps } from "react-form"; + +import { FormTextArea } from "./StyledTextAreaField"; + +const TextAreaField = React.forwardRef((props, ref) => { + // Let's use splitFormProps to get form-specific props + const [field, fieldOptions, rest] = splitFormProps(props); + + // Use the useField hook with a field and field options + // to access field state + const { + meta: { error, isTouched, isValidating, message }, + getInputProps, + } = useField(field, fieldOptions); + + const validate = () => { + if (isValidating) { + return Validating...; + } + if (isTouched && error) { + return {error}; + } + if (message) { + return {message}; + } + return null; + }; + // Build the field + return ( + <> + +
+ {/* + Let's inline some validation and error information + for our field + */} + + {validate()} +
+ + ); +}); + +TextAreaField.displayName = "TextAreaField"; +export default TextAreaField; diff --git a/apps/user-profile/src/components/common/SignUpForm/TextAreaField/index.js b/apps/user-profile/src/components/common/SignUpForm/TextAreaField/index.js new file mode 100644 index 000000000..b2bda6bb3 --- /dev/null +++ b/apps/user-profile/src/components/common/SignUpForm/TextAreaField/index.js @@ -0,0 +1 @@ +export { default } from "./TextAreaField"; diff --git a/apps/user-profile/src/components/common/SignUpForm/index.js b/apps/user-profile/src/components/common/SignUpForm/index.js new file mode 100644 index 000000000..603a95423 --- /dev/null +++ b/apps/user-profile/src/components/common/SignUpForm/index.js @@ -0,0 +1 @@ +export { default } from "./SignUpForm"; diff --git a/apps/user-profile/src/components/common/Stepper/Stepper.js b/apps/user-profile/src/components/common/Stepper/Stepper.js new file mode 100644 index 000000000..0edacabe0 --- /dev/null +++ b/apps/user-profile/src/components/common/Stepper/Stepper.js @@ -0,0 +1,162 @@ +import { useEffect, useState } from 'react'; +import { + StepperHeader, + StepperBody, + StepperFooter, + ProgressBarContainer, + Bar, + EmptyBar, +} from './StyledStepper'; +import { Button } from '@devlaunchers/components/components/atoms'; + +const stepsMockData = [ + { + component:

Step 1

, + config: { + buttons: { + next: { + label: 'Next', + useDefaultOnClick: true, + onClick: () => { + console.log('..some function '); + }, + }, + back: { + label: 'Back', + useDefaultOnClick: true, + // useDefaultHide: true, + onClick: () => { + console.log('..some function '); + }, + }, + }, + }, + }, + { + component:

Step 2

, + config: { + buttons: { + next: { + label: 'Next', + useDefaultOnClick: true, + onClick: () => { + console.log('..some function '); + }, + }, + back: { + label: 'Back', + useDefaultOnClick: true, + onClick: () => { + console.log('..some function '); + }, + }, + }, + }, + }, + { + component:

Step 3

, + config: { + buttons: { + next: { + label: 'Finish', + useDefaultOnClick: false, + onClick: () => { + Router.push('./users-me'); + }, + }, + back: { + label: 'Back', + useDefaultOnClick: true, + onClick: () => { + console.log('..some function '); + }, + }, + }, + }, + }, +]; + +/** + * @description This is a stepper component that is used for the user onboarding + */ +export default function Stepper({ steps = stepsMockData }) { + const [stepsData, setStepsData] = useState(steps); + const [index, setIndex] = useState(0); + + const [activeComponent, setActiveComponent] = useState( + stepsData[index].component + ); + const [activeConfig, setActiveConfig] = useState(stepsData[index].config); + const [buttonConfig, setButtonConfig] = useState( + stepsData[index].config.buttons + ); + + const backOnClickHandler = () => { + if (buttonConfig?.back?.useDefaultOnClick) { + if (index >= 1) { + setIndex(index - 1); + } + } else { + buttonConfig.back.onClick(); + } + }; + + const nextOnClickHandler = () => { + if (buttonConfig?.next?.useDefaultOnClick) { + if (index < steps.length - 1) { + setIndex(index + 1); + } + } else { + buttonConfig.next.onClick(); + } + }; + + /** + * Everytime users navigates update the activeComponent & config + */ + useEffect(() => { + setActiveComponent(stepsData[index].component); + setActiveConfig(stepsData[index].config); + setButtonConfig(stepsData[index].config.buttons); + }, [index]); + + const bars = steps.map((step, i) => { + const width = `${100 / steps.length}%`; + + return index >= i ? ( + + ) : ( + + ); + }); + + const backButton = + // This hides the button if index == 0 + index === 0 ? ( +
+ ) : ( + + ); + + return ( + <> + + {bars} + + + + {/* activeComponent holds the component e.g */} + {activeComponent} + + + + {backButton} + + + + ); +} diff --git a/apps/user-profile/src/components/common/Stepper/StyledStepper.js b/apps/user-profile/src/components/common/Stepper/StyledStepper.js new file mode 100644 index 000000000..8d91725b1 --- /dev/null +++ b/apps/user-profile/src/components/common/Stepper/StyledStepper.js @@ -0,0 +1,43 @@ +import styled from "styled-components"; + +export const StepperHeader = styled.div` + width: 71.6%; + display: flex; + flex-direction: column; + align-items: center; +`; + + +export const StepperBody = styled.div` + +`; + +export const ProgressBarContainer = styled.div` + width: 100%; + height: 1rem; + display: flex; + flex-direction: row; + flex-basis: auto; + align-items: stretch; + gap: 8px; +`; + +export const Bar = styled.div` + width: ${props => props.width}; + background-color: #234C73; +`; + +export const EmptyBar = styled.div` + width: ${props => props.width}; + background-color: #BDBDBD; +`; + +export const StepperFooter = styled.div` + width: 100%; + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: flex-start; + padding: 8px 14px; + gap: 22px; +`; \ No newline at end of file diff --git a/apps/user-profile/src/components/common/Stepper/index.js b/apps/user-profile/src/components/common/Stepper/index.js new file mode 100644 index 000000000..2fb2a1bd8 --- /dev/null +++ b/apps/user-profile/src/components/common/Stepper/index.js @@ -0,0 +1 @@ +export { default } from './Stepper'; diff --git a/apps/user-profile/src/components/common/Tag/StyledTag.js b/apps/user-profile/src/components/common/Tag/StyledTag.js new file mode 100644 index 000000000..dd15c570b --- /dev/null +++ b/apps/user-profile/src/components/common/Tag/StyledTag.js @@ -0,0 +1,18 @@ +import styled, { css } from "styled-components"; + +export const Container = styled.span` + padding: 0.5rem 1rem; + border: 2px solid ${({ theme }) => theme.colors.NEUTRAL_2}; + color: ${({ theme }) => theme.colors.NEUTRAL_2}; + font-family: ${({ theme }) => theme.fonts.headline}; + font-weight: bold; + ${({ filled }) => + filled && + css` + padding: 0.3rem 0.5rem; + margin-left: 1rem; + background-color: rgba(0, 0, 0, 0.6); + /* border: 0; */ + font-size: 1rem; + `} +`; diff --git a/apps/user-profile/src/components/common/Tag/Tag.js b/apps/user-profile/src/components/common/Tag/Tag.js new file mode 100644 index 000000000..8927b7241 --- /dev/null +++ b/apps/user-profile/src/components/common/Tag/Tag.js @@ -0,0 +1,6 @@ +import React from "react"; +import { Container } from "./StyledTag"; + +const Tag = ({ text, filled }) => {text}; + +export default Tag; diff --git a/apps/user-profile/src/components/common/Tag/index.js b/apps/user-profile/src/components/common/Tag/index.js new file mode 100644 index 000000000..21bb058ad --- /dev/null +++ b/apps/user-profile/src/components/common/Tag/index.js @@ -0,0 +1 @@ +export { default } from "./Tag"; diff --git a/apps/user-profile/src/components/modules/UserOnboarding/OnboardingForm/OnboardingForm.js b/apps/user-profile/src/components/modules/UserOnboarding/OnboardingForm/OnboardingForm.js new file mode 100644 index 000000000..faddb8bbc --- /dev/null +++ b/apps/user-profile/src/components/modules/UserOnboarding/OnboardingForm/OnboardingForm.js @@ -0,0 +1,24 @@ +import React from 'react' +import PageBody from '../../../common/PageBody' +import OnboardingFormSection, { StepperContainer } from './StyledOnboardingForm' +import { Typography } from '@devlaunchers/components/components/atoms' + +const OnboardingForm = ({ children }) => { + return ( + <> + +
+ + +
+ First Let's Set Up Your Profile + A complete profile will help to match you with the perfect opportunity +
+ {children} +
+
+ + ) +} + +export default OnboardingForm \ No newline at end of file diff --git a/apps/user-profile/src/components/modules/UserOnboarding/OnboardingForm/StyledOnboardingForm.js b/apps/user-profile/src/components/modules/UserOnboarding/OnboardingForm/StyledOnboardingForm.js new file mode 100644 index 000000000..6dee4a3b6 --- /dev/null +++ b/apps/user-profile/src/components/modules/UserOnboarding/OnboardingForm/StyledOnboardingForm.js @@ -0,0 +1,22 @@ +import styled from "styled-components"; + +const OnboardingFormSection = styled.section` + position: relative; + padding: 2rem; + margin-bottom: 2rem; + background-color: ${({ theme }) => theme.colors.White}; + .separator { + height: 2rem; + } + .continue-btn { + float: right; + } + .form-title-mb { + margin-bottom: 2.5rem; + } +`; + +export const StepperContainer = styled.div` + height: 152px; +`; +export default OnboardingFormSection; \ No newline at end of file diff --git a/apps/user-profile/src/components/modules/UserOnboarding/OnboardingForm/index.js b/apps/user-profile/src/components/modules/UserOnboarding/OnboardingForm/index.js new file mode 100644 index 000000000..36f918840 --- /dev/null +++ b/apps/user-profile/src/components/modules/UserOnboarding/OnboardingForm/index.js @@ -0,0 +1 @@ +export { default } from './OnboardingForm' \ No newline at end of file diff --git a/apps/user-profile/src/components/modules/UserOnboarding/StyledUserOnboarding.js b/apps/user-profile/src/components/modules/UserOnboarding/StyledUserOnboarding.js new file mode 100644 index 000000000..4ea7527a4 --- /dev/null +++ b/apps/user-profile/src/components/modules/UserOnboarding/StyledUserOnboarding.js @@ -0,0 +1,23 @@ +import styled from "styled-components"; + +const FormFieldMargin = styled.div` +margin-bottom: ${props => props.mb ? "0.7rem" : "1.2rem"}; +`; + +export const ConfirmationSection = styled.div` +display: flex; +align-items: center; + +div { + font-size: large; +} + +.red { + color: red; +} +` +export const CheckboxSpacing = styled.div` +margin-right: 0.7rem; +` + +export default FormFieldMargin; \ No newline at end of file diff --git a/apps/user-profile/src/components/modules/UserOnboarding/UserOnboarding.js b/apps/user-profile/src/components/modules/UserOnboarding/UserOnboarding.js new file mode 100644 index 000000000..1e9300ae2 --- /dev/null +++ b/apps/user-profile/src/components/modules/UserOnboarding/UserOnboarding.js @@ -0,0 +1,127 @@ +import React, { useState } from 'react' +import { useRouter } from 'next/router' +import { Checkbox, Link } from '@devlaunchers/components/components/atoms' +import Button from '@devlaunchers/components/components/atoms/Button' +import OpenResponse from '@devlaunchers/components/components/organisms/OpenResponse' +import FormField from '@devlaunchers/components/src/components/organisms/FormField' +import OnboardingForm from './OnboardingForm' +import FormFieldMargin, { CheckboxSpacing, ConfirmationSection } from './StyledUserOnboarding' + +const initialValue = { + firstName: '', + lastName: '', + bio: '' +} + +export default function UserOnboarding() { + const [person, setPerson] = useState(initialValue) + const router = useRouter() + + const handleFirstNameChange = (e) => { + setPerson({ + ...person, + firstName: e.target.value + }) + } + + const handleLastNameChange = (e) => { + setPerson({ + ...person, + lastName: e.target.value + }) + } + + const handleBioChange = (e) => { + setPerson({ + ...person, + bio: e.target.value + }) + } + + const handleContinueClick = (e) => { + router.push({ + pathname:'/users/me', + query: { onboarding: true } + }, '/users/me'); + e.preventDefault() + } + + return ( + +
+ + + + + + + + + + + + + + + + + + + +
+ <>I have read and agree to the +
+ +  &  + + . * +
+
+
+ +
+ + + +
+
+
+ ) +} diff --git a/apps/user-profile/src/components/modules/UserOnboarding/index.js b/apps/user-profile/src/components/modules/UserOnboarding/index.js new file mode 100644 index 000000000..4ce4e5bd2 --- /dev/null +++ b/apps/user-profile/src/components/modules/UserOnboarding/index.js @@ -0,0 +1 @@ +export { default } from "./UserOnboarding"; diff --git a/apps/user-profile/src/components/modules/UserOnboardingModal/DiscordOnboarding/DiscordOnboarding.js b/apps/user-profile/src/components/modules/UserOnboardingModal/DiscordOnboarding/DiscordOnboarding.js new file mode 100644 index 000000000..4882d483b --- /dev/null +++ b/apps/user-profile/src/components/modules/UserOnboardingModal/DiscordOnboarding/DiscordOnboarding.js @@ -0,0 +1,14 @@ + + + + + + + + + + + +export default function DiscordOnboarding() { + return(<>); +} \ No newline at end of file diff --git a/apps/user-profile/src/components/modules/UserOnboardingModal/DiscordOnboarding/index.js b/apps/user-profile/src/components/modules/UserOnboardingModal/DiscordOnboarding/index.js new file mode 100644 index 000000000..62d4bec6d --- /dev/null +++ b/apps/user-profile/src/components/modules/UserOnboardingModal/DiscordOnboarding/index.js @@ -0,0 +1 @@ +export { default } from "./DiscordOnboarding"; diff --git a/apps/user-profile/src/components/modules/UserOnboardingModal/OnboardingCard/OnboardingCard.js b/apps/user-profile/src/components/modules/UserOnboardingModal/OnboardingCard/OnboardingCard.js new file mode 100644 index 000000000..0ad518fb2 --- /dev/null +++ b/apps/user-profile/src/components/modules/UserOnboardingModal/OnboardingCard/OnboardingCard.js @@ -0,0 +1,33 @@ +import React, {useState} from 'react' +import { Typography } from '@devlaunchers/components/components/atoms' +import { OnboardingCardContainer, PicWrapper, TextWrapper, CheckedWrapper, CheckedSVG, IconImg } from './StyledOnboardingCard' + +/* +* @description This component renders the Onboarding Card Component. +/* passing a prop to decide show checked or unchecked +*/ +export default function OnboardingCard({ + iconImg, + title, + subtitle, + completed, +}) { + + return ( + + + + + + + {title} + {subtitle} + + + + + + + + ) +} \ No newline at end of file diff --git a/apps/user-profile/src/components/modules/UserOnboardingModal/OnboardingCard/StyledOnboardingCard.js b/apps/user-profile/src/components/modules/UserOnboardingModal/OnboardingCard/StyledOnboardingCard.js new file mode 100644 index 000000000..dfd7caf98 --- /dev/null +++ b/apps/user-profile/src/components/modules/UserOnboardingModal/OnboardingCard/StyledOnboardingCard.js @@ -0,0 +1,105 @@ +import Layer from "@devlaunchers/components/components/atoms/Layer/Layer"; +import styled from "styled-components"; +import React from 'react'; +import { Typography } from '@devlaunchers/components/components/atoms' + +export const CheckedSVG = ({ completed }) => ( + completed ? ( + + + + ) : ( + + + + ) +) + +export const IconImg = ({iconImg}) => { + switch (iconImg) { + case 'Login': + return ( + + + ) + + case 'Onboarding': + return ( + + + ) + + case 'Zenhub': + return ( + + + ) + + case 'Discord': + return ( + + + ) + default: + return ( + + + ) + } +} +// justify-content: space-between; + +export const OnboardingCardContainer = styled.div` + display: flex; + flex-direction: row; + flex-wrap: unwrap; + justify-content: space-between; + width: 100%; + height: auto; + align-items: center; + align-content: center; + border-radius: 10px; + background: ${props => props.completed ? '#E2E2E2' : 'white'}; + box-shadow: ${props => props.completed ? '' : '0px 10px 18px 10px rgba(127, 126, 127, 0.25)'}; + margin-bottom: 15px; + + &:hover { + border: 1px solid #3A7CA5; + } +`; + +export const Wrapper = styled.div` + display: grid; + gap: 20px; + justify-content: center; + justify-items: center; + grid-template-areas: + "UserSection" + "LabCampus" + "WeeksGlance" + "Misc"; +`; + + +export const PicWrapper = styled.div` + ${'' /* display: flex; */} + padding-left: 18px; + ${'' /* justify-content: center; */} + ${'' /* justify-items: center; */} + column-gap: 40px; +`; + + +export const TextWrapper = styled.div` + ${'' /* margin-left: 20px; */} + padding: 10px 20px; + width: 100%; +`; + +export const CheckedWrapper = styled.div` + padding-right: 30px; +`; + + + + diff --git a/apps/user-profile/src/components/modules/UserOnboardingModal/OnboardingCard/index.js b/apps/user-profile/src/components/modules/UserOnboardingModal/OnboardingCard/index.js new file mode 100644 index 000000000..36452fb82 --- /dev/null +++ b/apps/user-profile/src/components/modules/UserOnboardingModal/OnboardingCard/index.js @@ -0,0 +1,2 @@ +export { default } from "./OnboardingCard"; + diff --git a/apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding/PageOne/PageOne.js b/apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding/PageOne/PageOne.js new file mode 100644 index 000000000..2fa2e2581 --- /dev/null +++ b/apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding/PageOne/PageOne.js @@ -0,0 +1,25 @@ +import { Typography } from "@devlaunchers/components/components/atoms"; +import LogoMonogram from '../../../../../images/logo-monogram.png' +import {m} from "framer-motion"; +import { PageOneContainer } from "./StyledPageOne"; + +const bounceTransition = { + y: { + yoyo: Infinity, + } +}; + +export default function PageOne({name}){ + return (<> + + + Welcome {name} + + + We’re so glad you’re here. Let’s get started on your journey. + + + + + ); +} \ No newline at end of file diff --git a/apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding/PageOne/StyledPageOne.js b/apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding/PageOne/StyledPageOne.js new file mode 100644 index 000000000..b46ae2d50 --- /dev/null +++ b/apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding/PageOne/StyledPageOne.js @@ -0,0 +1,20 @@ +import styled from "styled-components"; + + +export const PageOneContainer = styled.div` + text-align: center; + + img { + height: 330px; + width: 280px; + filter: brightness(0.1); + } + + div { + width: 120px; + height: 14px; + background-color: grey; + border-radius: 50%; + margin: auto; + } +`; \ No newline at end of file diff --git a/apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding/PageOne/index.js b/apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding/PageOne/index.js new file mode 100644 index 000000000..6b2ad16d6 --- /dev/null +++ b/apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding/PageOne/index.js @@ -0,0 +1 @@ +export { default } from "./PageOne"; \ No newline at end of file diff --git a/apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding/PageThree/PageThree.js b/apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding/PageThree/PageThree.js new file mode 100644 index 000000000..fbcf8b16e --- /dev/null +++ b/apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding/PageThree/PageThree.js @@ -0,0 +1,32 @@ +import { Typography } from "@devlaunchers/components/components/atoms"; +import RoleCard from "../../RoleCard/RoleCard.js"; +import { PageThereeContainer, ThreeRoleCards } from "./StyledPageThree.js"; + +export default function PageThree(){ + return ( + + First off, What Role Best Describes You? + We'll use this to recommend open source projects for you to work on. + + + + + + + ); +} \ No newline at end of file diff --git a/apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding/PageThree/StyledPageThree.js b/apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding/PageThree/StyledPageThree.js new file mode 100644 index 000000000..74a9a5fd4 --- /dev/null +++ b/apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding/PageThree/StyledPageThree.js @@ -0,0 +1,14 @@ +import styled from "styled-components"; + +export const PageThereeContainer = styled.div` + padding: 10%; + text-align: center; +` + +export const ThreeRoleCards = styled.div` + padding-left: 5%; + padding-right: 5%; + display: flex; + flex-direction: row; +` + diff --git a/apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding/PageThree/index.js b/apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding/PageThree/index.js new file mode 100644 index 000000000..7c17069b7 --- /dev/null +++ b/apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding/PageThree/index.js @@ -0,0 +1 @@ +export {default} from "./PageThree"; \ No newline at end of file diff --git a/apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding/PageTwo/PageTwo.js b/apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding/PageTwo/PageTwo.js new file mode 100644 index 000000000..aff5b201c --- /dev/null +++ b/apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding/PageTwo/PageTwo.js @@ -0,0 +1,49 @@ +import React from 'react'; +import { + PageTwoContainer, + ProjectImage, + ImageContainer, + NetworkImage, + LevelUpImage, +} from './StyledPageTwo'; +import { Typography } from '@devlaunchers/components/components/atoms'; + +export default function PageTwo() { + return ( + <> + + Here are some of the things you can do at Devlaunchers + + + + +
+ Find Open Source Projects + + We have have upcoming projects that need your help + +
+
+ + +
+ Connect with Experienced People + + Work on agile teams to improve aspects of our software + +
+
+ + +
+ Gain Industry Experience + + We’ll support your learning and leadership experience along the + way + +
+
+
+ + ); +} diff --git a/apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding/PageTwo/StyledPageTwo.js b/apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding/PageTwo/StyledPageTwo.js new file mode 100644 index 000000000..3bd587ff6 --- /dev/null +++ b/apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding/PageTwo/StyledPageTwo.js @@ -0,0 +1,38 @@ +import styled from "styled-components"; +import projectImage from "../../../../../images/onboarding-project.png"; +import networkImage from "../../../../../images/onboarding-network.png"; +import levelUpImage from "../../../../../images/onboarding-level-up.png"; + +export const PageTwoContainer = styled.div` + display: flex; + align-items: flex-start; + flex-direction: column; +`; + +export const ImageContainer = styled.div` + display: flex; + align-items: flex-start; + flex-direction: row; + gap: 4.7% +`; + +export const ProjectImage = styled.img.attrs(() => ({ + src: projectImage, + alt: "project image", + }))` + width: 5rem; + `; + +export const NetworkImage = styled.img.attrs(() => ({ + src: networkImage, + alt: "network image", + }))` + width: 5rem; + `; + +export const LevelUpImage = styled.img.attrs(() => ({ + src: levelUpImage, + alt: "level up image", + }))` + width: 5rem; + `; \ No newline at end of file diff --git a/apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding/PlatformOnboarding.js b/apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding/PlatformOnboarding.js new file mode 100644 index 000000000..cd405f708 --- /dev/null +++ b/apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding/PlatformOnboarding.js @@ -0,0 +1,73 @@ +import { useEffect } from 'react'; +import Stepper from '../../../../components/common/Stepper'; +import PageTwo from './PageTwo/PageTwo'; + +export default function PlatformOnboarding() { + const stepperConfig = [ + { + component:

Step 1

, + config: { + buttons: { + next: { + label: 'Next', + useDefaultOnClick: true, + onClick: () => { + console.log('..some function '); + }, + }, + back: { + label: 'Back', + useDefaultOnClick: true, + onClick: () => { + console.log('..some function '); + }, + }, + }, + }, + }, + { + component: , + config: { + buttons: { + next: { + label: 'Next', + useDefaultOnClick: true, + }, + back: { + label: 'Back', + useDefaultOnClick: true, + }, + }, + }, + }, + { + component:

Step 3

, + config: { + buttons: { + next: { + label: 'Finish', + useDefaultOnClick: true, + onClick: () => { + console.log('..some function '); + }, + }, + back: { + label: 'Back', + useDefaultOnClick: true, + onClick: () => { + console.log('..some function '); + }, + }, + }, + }, + }, + ]; + + // useEffect(()=>{console.log(stepperConfig, "PLATFORM")}); + return ( + <> + + + ); + // return(<> ); +} diff --git a/apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding/index.js b/apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding/index.js new file mode 100644 index 000000000..188578d97 --- /dev/null +++ b/apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding/index.js @@ -0,0 +1 @@ +export { default } from "./PlatformOnboarding"; diff --git a/apps/user-profile/src/components/modules/UserOnboardingModal/RoleCard/RoleCard.js b/apps/user-profile/src/components/modules/UserOnboardingModal/RoleCard/RoleCard.js new file mode 100644 index 000000000..9dd68c979 --- /dev/null +++ b/apps/user-profile/src/components/modules/UserOnboardingModal/RoleCard/RoleCard.js @@ -0,0 +1,35 @@ +import React, {useState} from 'react' +import { RoleCardContainer, IconWrapper, TextWrapper, IconImg} from './StyledRoleCard' +import { Typography } from '@devlaunchers/components/components/atoms' + +// @description +// - This component renders the RoleCard Component. +// - You can change the color of title by passing an theme name from "theme1", "theme2" and "theme3". +// - "theme1" is navy, "theme2" is light blue and "theme3" is orange. + +export default function RoleCard({ + iconImg, + title, + subtitle, + theme, +}) { + const [isSelected, setIsSelected] = useState(false); + const handleClick = event => { + setIsSelected(current => !current); + }; + + + return ( + + + + + + + {title} + {subtitle} + + + + ) +} \ No newline at end of file diff --git a/apps/user-profile/src/components/modules/UserOnboardingModal/RoleCard/StyledRoleCard.js b/apps/user-profile/src/components/modules/UserOnboardingModal/RoleCard/StyledRoleCard.js new file mode 100644 index 000000000..74d2dea0f --- /dev/null +++ b/apps/user-profile/src/components/modules/UserOnboardingModal/RoleCard/StyledRoleCard.js @@ -0,0 +1,79 @@ +import styled from "styled-components"; +import React from "react"; +import Developer from "../../../.././images/RoleCard/developer.svg"; +import UX from "../../../.././images/RoleCard/ux-ui.svg"; +import Other from "../../../.././images/RoleCard/other.svg"; + + +export const IconImg = ({iconImg}) => { + switch (iconImg) { + case 'Developer': + return ( + + ) + + case 'UX': + return ( + + ) + + case 'Other': + return ( + + ) + } +} ; + +export const RoleCardContainer = styled.div` + margin: 50px 10px 0px; + /* Components */ + box-sizing: border-box; + /* Auto layout */ + display: flex; + flex-direction: column; + align-items: center; + padding: 5%; + gap: 10px; + width: 220px; + height: 250px; + border: 1px solid #7F7E7F; + border-radius: 10px; + + &.selected { + border: 5px solid #3A7CA5; + } +`; + +export const IconWrapper = styled.div` + width: 100%; + + img { + width: 50px; + height: 50px; + }; +`; + + +export const TextWrapper = styled.div` + text-align: center; + width: 100%; + + .title { + font-weight: 900; + + &.theme1 { + color: #295774; + } + + &.theme2 { + color: #3A7CA5; + } + + &.theme3 { + color: #FF7F0E; + } + }; +`; + + + diff --git a/apps/user-profile/src/components/modules/UserOnboardingModal/RoleCard/index.js b/apps/user-profile/src/components/modules/UserOnboardingModal/RoleCard/index.js new file mode 100644 index 000000000..d7fd09e72 --- /dev/null +++ b/apps/user-profile/src/components/modules/UserOnboardingModal/RoleCard/index.js @@ -0,0 +1 @@ +export { default } from "./RoleCard"; \ No newline at end of file diff --git a/apps/user-profile/src/components/modules/UserOnboardingModal/StyledUserOnboardingModal.js b/apps/user-profile/src/components/modules/UserOnboardingModal/StyledUserOnboardingModal.js new file mode 100644 index 000000000..78e42e24e --- /dev/null +++ b/apps/user-profile/src/components/modules/UserOnboardingModal/StyledUserOnboardingModal.js @@ -0,0 +1,57 @@ +import styled from "styled-components"; + +export const ModalContainer = styled.div` + width: 100%; + height: 100%; +`; + +export const ModalHeader = styled.div` + width: 100%; + display: flex; + align-items: center; + background-color: #000000; + color: #F0EDEE; + font-weight: 400; + + img { + margin-right: 1rem; + margin-left: 1rem; + } + ${'' /* Enter styling */} +`; + +export const ModalBody = styled.div` + padding: 0 115px; + display: flex; + flex-direction: column; + align-items: center; + +h2 { + color: #212429; + +} + + p { + color: #7B7B7B; + } + ${'' /* Enter styling */} +`; + +// Modal set up +export const userUnboardingModalStyle = { + content: { + position: "absolute", + width: "50%", + padding: "0px", + height: "80%", + top: "50%", + left: "50%", + overflow: "hidden", + right: "auto", + bottom: "auto", + marginRight: "-50%", + transform: "translate(-50%, -50%)", + zIndex: 1001 + }, + overlay: { zIndex: 1000, backgroundColor: "rgba(0,0,0,.75)" } +}; diff --git a/apps/user-profile/src/components/modules/UserOnboardingModal/ThirdPartyOnboarding/StyledThirdPartyOnboarding.js b/apps/user-profile/src/components/modules/UserOnboardingModal/ThirdPartyOnboarding/StyledThirdPartyOnboarding.js new file mode 100644 index 000000000..ae507c603 --- /dev/null +++ b/apps/user-profile/src/components/modules/UserOnboardingModal/ThirdPartyOnboarding/StyledThirdPartyOnboarding.js @@ -0,0 +1,9 @@ +import styled from 'styled-components'; + +export const ThirdPartyContainer + = styled.div` + display: flex; + align-items: center; + flex-direction: column; + gap: 0px; +`; \ No newline at end of file diff --git a/apps/user-profile/src/components/modules/UserOnboardingModal/ThirdPartyOnboarding/ThirdPartyOnboarding.js b/apps/user-profile/src/components/modules/UserOnboardingModal/ThirdPartyOnboarding/ThirdPartyOnboarding.js new file mode 100644 index 000000000..a9f5d8ead --- /dev/null +++ b/apps/user-profile/src/components/modules/UserOnboardingModal/ThirdPartyOnboarding/ThirdPartyOnboarding.js @@ -0,0 +1,13 @@ +import Typography from '@devlaunchers/components/components/atoms/Typography'; +import { ThirdPartyContainer } from './StyledThirdPartyOnboarding'; + +export default function ThirdPartyOnboarding() { + return ( + + Sign Up with Third Party Sites + + These are the platforms we’ll use to collaborate on projects + + + ); +} \ No newline at end of file diff --git a/apps/user-profile/src/components/modules/UserOnboardingModal/ThirdPartyOnboarding/index.js b/apps/user-profile/src/components/modules/UserOnboardingModal/ThirdPartyOnboarding/index.js new file mode 100644 index 000000000..57013fe91 --- /dev/null +++ b/apps/user-profile/src/components/modules/UserOnboardingModal/ThirdPartyOnboarding/index.js @@ -0,0 +1 @@ +export { default } from "./ThirdPartyOnboarding"; diff --git a/apps/user-profile/src/components/modules/UserOnboardingModal/UserOnboardingModal.js b/apps/user-profile/src/components/modules/UserOnboardingModal/UserOnboardingModal.js new file mode 100644 index 000000000..4f5161902 --- /dev/null +++ b/apps/user-profile/src/components/modules/UserOnboardingModal/UserOnboardingModal.js @@ -0,0 +1,60 @@ +import { useState, useEffect } from "react"; +import Modal from "react-modal"; +import OnboardingCard from "./OnboardingCard/OnboardingCard.js"; +import PlatformOnboarding from "./PlatformOnboarding/PlatformOnboarding"; +import PageOne from "./PlatformOnboarding/PageOne"; +import PageThree from "./PlatformOnboarding/PageThree"; +import Typography from "@devlaunchers/components/components/atoms/Typography"; +import LogoMonogram from "../../../images/logo-monogram.png" +import { ModalContainer, userUnboardingModalStyle, ModalHeader, ModalBody } from "./StyledUserOnboardingModal"; + +Modal.setAppElement("#__next"); + +/** + * @description This is custom modal for the user onboarding. + */ +export default function UserOnboardingModal({ isOpen }) { + const [modalIsOpen, setModalIsOpen] = useState(true); + + const openModal = () => { + setModalIsOpen(true); + } + // const afterOpenModal = () => { + // // references are now sync'd and can be accessed. + // } + const closeModal = () => { + setModalIsOpen(false); + } + return ( + <> + {/* "modalIsOpen ? true : false" set this way until we start adding typescript for + boolean type */} + + + + dev-launchers + Dev Launchers + + + {/* Get Started with Devlaunchers + Please complete the following onboarding tasks */} + {/* Onboarding Card Component */} + + {/* (stepper) */} + + {/* */} + + {/* */} + + + + + + ); +} diff --git a/apps/user-profile/src/components/modules/UserOnboardingModal/index.js b/apps/user-profile/src/components/modules/UserOnboardingModal/index.js new file mode 100644 index 000000000..44971bc36 --- /dev/null +++ b/apps/user-profile/src/components/modules/UserOnboardingModal/index.js @@ -0,0 +1 @@ +export { default } from "./UserOnboardingModal"; diff --git a/apps/website/src/components/modules/UserProfile/BioBox/BioBox.js b/apps/user-profile/src/components/modules/UserProfile/BioBox/BioBox.js similarity index 75% rename from apps/website/src/components/modules/UserProfile/BioBox/BioBox.js rename to apps/user-profile/src/components/modules/UserProfile/BioBox/BioBox.js index acab56493..6bdd41551 100644 --- a/apps/website/src/components/modules/UserProfile/BioBox/BioBox.js +++ b/apps/user-profile/src/components/modules/UserProfile/BioBox/BioBox.js @@ -5,11 +5,14 @@ import { Wrapper, Bio } from "./StyledBioBox"; import { env } from "../../../../utils/EnvironmentVariables"; -export default function BioBox({ data, canEdit }) { +import { Name } from "../ProfileCard/StyledProfileCard"; +import { Typography } from "@devlaunchers/components/components/atoms"; +import Button from '@devlaunchers/components/components/atoms/Button/Button'; + +export default function BioBox({ data, canEdit, name }) { const [bioText, setBioText] = useState(data.bio); const [isReadOnly, setIsReadOnly] = useState(true); const bioRef = useRef(null); - const handleTextChange = (e) => { setBioText(e.target.value); }; @@ -31,6 +34,8 @@ export default function BioBox({ data, canEdit }) { }; return ( +
+ {name}

- {canEdit && + { canEdit && (isReadOnly ? ( - + ) : ( - + ))}
); diff --git a/apps/website/src/components/modules/UserProfile/BioBox/StyledBioBox.js b/apps/user-profile/src/components/modules/UserProfile/BioBox/StyledBioBox.js similarity index 91% rename from apps/website/src/components/modules/UserProfile/BioBox/StyledBioBox.js rename to apps/user-profile/src/components/modules/UserProfile/BioBox/StyledBioBox.js index 0604f89ef..f8e52cb6e 100644 --- a/apps/website/src/components/modules/UserProfile/BioBox/StyledBioBox.js +++ b/apps/user-profile/src/components/modules/UserProfile/BioBox/StyledBioBox.js @@ -8,4 +8,5 @@ border: none; resize: none; width: 99%; background: #f0f0f0; +outline: none; `; diff --git a/apps/website/src/components/modules/UserProfile/BioBox/index.js b/apps/user-profile/src/components/modules/UserProfile/BioBox/index.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/BioBox/index.js rename to apps/user-profile/src/components/modules/UserProfile/BioBox/index.js diff --git a/apps/website/src/components/modules/UserProfile/DiscordSection/ConnectDiscord/ConnectDiscord.js b/apps/user-profile/src/components/modules/UserProfile/DiscordSection/ConnectDiscord/ConnectDiscord.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/DiscordSection/ConnectDiscord/ConnectDiscord.js rename to apps/user-profile/src/components/modules/UserProfile/DiscordSection/ConnectDiscord/ConnectDiscord.js diff --git a/apps/website/src/components/modules/UserProfile/DiscordSection/ConnectDiscord/StyledConnectDiscord.js b/apps/user-profile/src/components/modules/UserProfile/DiscordSection/ConnectDiscord/StyledConnectDiscord.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/DiscordSection/ConnectDiscord/StyledConnectDiscord.js rename to apps/user-profile/src/components/modules/UserProfile/DiscordSection/ConnectDiscord/StyledConnectDiscord.js diff --git a/apps/website/src/components/modules/UserProfile/DiscordSection/ConnectDiscord/index.js b/apps/user-profile/src/components/modules/UserProfile/DiscordSection/ConnectDiscord/index.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/DiscordSection/ConnectDiscord/index.js rename to apps/user-profile/src/components/modules/UserProfile/DiscordSection/ConnectDiscord/index.js diff --git a/apps/website/src/components/modules/UserProfile/DiscordSection/DiscordProfile/Beans/Beans.js b/apps/user-profile/src/components/modules/UserProfile/DiscordSection/DiscordProfile/Beans/Beans.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/DiscordSection/DiscordProfile/Beans/Beans.js rename to apps/user-profile/src/components/modules/UserProfile/DiscordSection/DiscordProfile/Beans/Beans.js diff --git a/apps/website/src/components/modules/UserProfile/DiscordSection/DiscordProfile/Beans/index.js b/apps/user-profile/src/components/modules/UserProfile/DiscordSection/DiscordProfile/Beans/index.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/DiscordSection/DiscordProfile/Beans/index.js rename to apps/user-profile/src/components/modules/UserProfile/DiscordSection/DiscordProfile/Beans/index.js diff --git a/apps/website/src/components/modules/UserProfile/DiscordSection/DiscordProfile/DiscordProfile.js b/apps/user-profile/src/components/modules/UserProfile/DiscordSection/DiscordProfile/DiscordProfile.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/DiscordSection/DiscordProfile/DiscordProfile.js rename to apps/user-profile/src/components/modules/UserProfile/DiscordSection/DiscordProfile/DiscordProfile.js diff --git a/apps/website/src/components/modules/UserProfile/DiscordSection/DiscordProfile/StyledDiscordProfile.js b/apps/user-profile/src/components/modules/UserProfile/DiscordSection/DiscordProfile/StyledDiscordProfile.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/DiscordSection/DiscordProfile/StyledDiscordProfile.js rename to apps/user-profile/src/components/modules/UserProfile/DiscordSection/DiscordProfile/StyledDiscordProfile.js diff --git a/apps/website/src/components/modules/UserProfile/DiscordSection/DiscordProfile/index.js b/apps/user-profile/src/components/modules/UserProfile/DiscordSection/DiscordProfile/index.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/DiscordSection/DiscordProfile/index.js rename to apps/user-profile/src/components/modules/UserProfile/DiscordSection/DiscordProfile/index.js diff --git a/apps/website/src/components/modules/UserProfile/DiscordSection/DiscordSection.js b/apps/user-profile/src/components/modules/UserProfile/DiscordSection/DiscordSection.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/DiscordSection/DiscordSection.js rename to apps/user-profile/src/components/modules/UserProfile/DiscordSection/DiscordSection.js diff --git a/apps/website/src/components/modules/UserProfile/DiscordSection/index.js b/apps/user-profile/src/components/modules/UserProfile/DiscordSection/index.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/DiscordSection/index.js rename to apps/user-profile/src/components/modules/UserProfile/DiscordSection/index.js diff --git a/apps/website/src/components/modules/UserProfile/LabCampus/LabCampus.js b/apps/user-profile/src/components/modules/UserProfile/LabCampus/LabCampus.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/LabCampus/LabCampus.js rename to apps/user-profile/src/components/modules/UserProfile/LabCampus/LabCampus.js diff --git a/apps/website/src/components/modules/UserProfile/LabCampus/Labs.js b/apps/user-profile/src/components/modules/UserProfile/LabCampus/Labs.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/LabCampus/Labs.js rename to apps/user-profile/src/components/modules/UserProfile/LabCampus/Labs.js diff --git a/apps/website/src/components/modules/UserProfile/LabCampus/StyledLabCampus.js b/apps/user-profile/src/components/modules/UserProfile/LabCampus/StyledLabCampus.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/LabCampus/StyledLabCampus.js rename to apps/user-profile/src/components/modules/UserProfile/LabCampus/StyledLabCampus.js diff --git a/apps/website/src/components/modules/UserProfile/LabCampus/TimeLine.js b/apps/user-profile/src/components/modules/UserProfile/LabCampus/TimeLine.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/LabCampus/TimeLine.js rename to apps/user-profile/src/components/modules/UserProfile/LabCampus/TimeLine.js diff --git a/apps/website/src/components/modules/UserProfile/LabCampus/index.js b/apps/user-profile/src/components/modules/UserProfile/LabCampus/index.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/LabCampus/index.js rename to apps/user-profile/src/components/modules/UserProfile/LabCampus/index.js diff --git a/apps/website/src/components/modules/UserProfile/LabMember/LabMember.js b/apps/user-profile/src/components/modules/UserProfile/LabMember/LabMember.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/LabMember/LabMember.js rename to apps/user-profile/src/components/modules/UserProfile/LabMember/LabMember.js diff --git a/apps/website/src/components/modules/UserProfile/LabMember/StyledLabMember.js b/apps/user-profile/src/components/modules/UserProfile/LabMember/StyledLabMember.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/LabMember/StyledLabMember.js rename to apps/user-profile/src/components/modules/UserProfile/LabMember/StyledLabMember.js diff --git a/apps/website/src/components/modules/UserProfile/LabMember/index.js b/apps/user-profile/src/components/modules/UserProfile/LabMember/index.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/LabMember/index.js rename to apps/user-profile/src/components/modules/UserProfile/LabMember/index.js diff --git a/apps/website/src/components/modules/UserProfile/Opportunities/Opportunities.js b/apps/user-profile/src/components/modules/UserProfile/Opportunities/Opportunities.js similarity index 50% rename from apps/website/src/components/modules/UserProfile/Opportunities/Opportunities.js rename to apps/user-profile/src/components/modules/UserProfile/Opportunities/Opportunities.js index be07c1682..750d31e38 100644 --- a/apps/website/src/components/modules/UserProfile/Opportunities/Opportunities.js +++ b/apps/user-profile/src/components/modules/UserProfile/Opportunities/Opportunities.js @@ -10,6 +10,8 @@ import { env } from "../../../../utils/EnvironmentVariables"; import { useUserDataContext } from "../../../../context/UserDataContext"; +import PositionCard from '@devlaunchers/components/components/organisms/cards/PositionCard'; + import { OpportunitiesContainer } from "./StyledOpportunities"; const Opportunities = ({ opportunities }) => { @@ -32,36 +34,37 @@ const Opportunities = ({ opportunities }) => { justifyContent: "space-around", }} > - {opportunities.map((opportunity) => ( -
-

- {opportunity.title}{" "} - - ({opportunity.level} Opportunity) - -

-
- Remote -
-
{opportunity.project.title} Project
-
- - {opportunity.description.substring(0, 200) + - (opportunity.description.length > 200 ? "..." : "")} - + {opportunities.slice(0, 4).map((opportunity) => { + const { level, description, title, skills, commitmentHoursPerWeek, project } = opportunity; + + return ( +
+ 200 ? "..." : ""), + tags: skills.map(skill => skill.interest), + timeCommittment: `${commitmentHoursPerWeek} hrs per week`, + title: title + }} + interaction="save-only" + />
-
- ))} + ) + })}
) : ( diff --git a/apps/website/src/components/modules/UserProfile/Opportunities/StyledOpportunities.js b/apps/user-profile/src/components/modules/UserProfile/Opportunities/StyledOpportunities.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/Opportunities/StyledOpportunities.js rename to apps/user-profile/src/components/modules/UserProfile/Opportunities/StyledOpportunities.js diff --git a/apps/website/src/components/modules/UserProfile/Opportunities/index.js b/apps/user-profile/src/components/modules/UserProfile/Opportunities/index.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/Opportunities/index.js rename to apps/user-profile/src/components/modules/UserProfile/Opportunities/index.js diff --git a/apps/user-profile/src/components/modules/UserProfile/People/People.js b/apps/user-profile/src/components/modules/UserProfile/People/People.js new file mode 100644 index 000000000..f2e59dcfc --- /dev/null +++ b/apps/user-profile/src/components/modules/UserProfile/People/People.js @@ -0,0 +1,71 @@ +import React from "react"; +import Image from "next/image"; +import axios from "axios"; +import Link from "next/link"; +import { useRouter } from "next/router"; +import UserCard from '@devlaunchers/components/components/organisms/cards/UserCard'; + +import Button from "../../../common/Button"; +import Card from "../../../common/Card"; + +import { env } from "../../../../utils/EnvironmentVariables"; + +import { useUserDataContext } from "../../../../context/UserDataContext"; + +import { PeopleContainer } from "./StyledPeople"; + +const People = ({ people }) => { + const router = useRouter(); + return ( + +
+

Interesting People

+
+ {people.map((person) => { + const { email, profile, discordUsername, id } = person + return ( +
{router.push(`/users/${id}`)}} + > + +
+ ) + })} +
+
+
+ ); +}; + +export default People; \ No newline at end of file diff --git a/apps/website/src/components/modules/UserProfile/People/StyledPeople.js b/apps/user-profile/src/components/modules/UserProfile/People/StyledPeople.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/People/StyledPeople.js rename to apps/user-profile/src/components/modules/UserProfile/People/StyledPeople.js diff --git a/apps/website/src/components/modules/UserProfile/People/index.js b/apps/user-profile/src/components/modules/UserProfile/People/index.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/People/index.js rename to apps/user-profile/src/components/modules/UserProfile/People/index.js diff --git a/apps/website/src/components/modules/UserProfile/Points/Points.js b/apps/user-profile/src/components/modules/UserProfile/Points/Points.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/Points/Points.js rename to apps/user-profile/src/components/modules/UserProfile/Points/Points.js diff --git a/apps/website/src/components/modules/UserProfile/Points/StyledPoints.js b/apps/user-profile/src/components/modules/UserProfile/Points/StyledPoints.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/Points/StyledPoints.js rename to apps/user-profile/src/components/modules/UserProfile/Points/StyledPoints.js diff --git a/apps/website/src/components/modules/UserProfile/Points/index.js b/apps/user-profile/src/components/modules/UserProfile/Points/index.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/Points/index.js rename to apps/user-profile/src/components/modules/UserProfile/Points/index.js diff --git a/apps/user-profile/src/components/modules/UserProfile/ProfileCard/ProfileCard.js b/apps/user-profile/src/components/modules/UserProfile/ProfileCard/ProfileCard.js new file mode 100644 index 000000000..a0cb43d8b --- /dev/null +++ b/apps/user-profile/src/components/modules/UserProfile/ProfileCard/ProfileCard.js @@ -0,0 +1,22 @@ +import React from "react"; +import { Wrapper, ProfilePicture, Name, UserName } from "./StyledProfileCard"; + +const UserProfileImage = ({ img, created_at }) => { + const date = new Date(created_at); + + const options = { + year: "numeric", + month: "long", + } + + const year = date.toLocaleString("en-US", options); + + return ( + + +

{`Member Since ${year}`}

+
+ ) +}; + +export default UserProfileImage; diff --git a/apps/website/src/components/modules/UserProfile/ProfileCard/StyledProfileCard.js b/apps/user-profile/src/components/modules/UserProfile/ProfileCard/StyledProfileCard.js similarity index 86% rename from apps/website/src/components/modules/UserProfile/ProfileCard/StyledProfileCard.js rename to apps/user-profile/src/components/modules/UserProfile/ProfileCard/StyledProfileCard.js index efadc4bca..2859c7ed1 100644 --- a/apps/website/src/components/modules/UserProfile/ProfileCard/StyledProfileCard.js +++ b/apps/user-profile/src/components/modules/UserProfile/ProfileCard/StyledProfileCard.js @@ -16,15 +16,18 @@ export const Wrapper = styled.div` & > div { margin-top: 10px; } + p { + font-size: 1.4rem; + } @media (orientation: portrait) { width: 90%; } `; export const ProfilePicture = styled.img` - height: auto; - + border-radius: 50%; @media (orientation: portrait) { - width: 50%; + width: 128px; + height: 128px; } `; export const Name = styled.div``; diff --git a/apps/website/src/components/modules/UserProfile/ProfileCard/index.js b/apps/user-profile/src/components/modules/UserProfile/ProfileCard/index.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/ProfileCard/index.js rename to apps/user-profile/src/components/modules/UserProfile/ProfileCard/index.js diff --git a/apps/website/src/components/modules/UserProfile/RecommendedIdeas/RecommendedIdeas.js b/apps/user-profile/src/components/modules/UserProfile/RecommendedIdeas/RecommendedIdeas.js similarity index 52% rename from apps/website/src/components/modules/UserProfile/RecommendedIdeas/RecommendedIdeas.js rename to apps/user-profile/src/components/modules/UserProfile/RecommendedIdeas/RecommendedIdeas.js index ef1363c91..0e6620535 100644 --- a/apps/website/src/components/modules/UserProfile/RecommendedIdeas/RecommendedIdeas.js +++ b/apps/user-profile/src/components/modules/UserProfile/RecommendedIdeas/RecommendedIdeas.js @@ -39,25 +39,46 @@ const RecommendedIdeas = ({ ideas }) => { flexWrap: 'wrap', }} > - {ideas.map((idea) => ( - - skill), - description: - idea.description.substring(0, 200) + - (idea.description.length > 200 ? '...' : ''), - href: `/ideaspace/workshopping/${idea.id}`, + + {ideas.slice(0, 4).map((idea) => { + + + return ( +
- - ))} + > + + skill), + description: + idea.description.substring(0, 200) + + (idea.description.length > 200 ? '...' : ''), + href: `/ideaspace/workshopping/${idea.id}`, + }} + /> + +
+ ) + })} + + + +
) : ( diff --git a/apps/website/src/components/modules/UserProfile/RecommendedIdeas/StyledRecommendedIdeas.js b/apps/user-profile/src/components/modules/UserProfile/RecommendedIdeas/StyledRecommendedIdeas.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/RecommendedIdeas/StyledRecommendedIdeas.js rename to apps/user-profile/src/components/modules/UserProfile/RecommendedIdeas/StyledRecommendedIdeas.js diff --git a/apps/website/src/components/modules/UserProfile/RecommendedIdeas/index.js b/apps/user-profile/src/components/modules/UserProfile/RecommendedIdeas/index.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/RecommendedIdeas/index.js rename to apps/user-profile/src/components/modules/UserProfile/RecommendedIdeas/index.js diff --git a/apps/user-profile/src/components/modules/UserProfile/SignIn/SignIn.js b/apps/user-profile/src/components/modules/UserProfile/SignIn/SignIn.js new file mode 100644 index 000000000..f5d097f3a --- /dev/null +++ b/apps/user-profile/src/components/modules/UserProfile/SignIn/SignIn.js @@ -0,0 +1,26 @@ +import React from "react"; +import Button from '../../../../components/common/Button'; + +const SignIn = () => { + return ( +
+

+ Please sign in to access this page! +

+ +
+
); +} + +export default SignIn; \ No newline at end of file diff --git a/apps/user-profile/src/components/modules/UserProfile/SignIn/StyledSignIn.js b/apps/user-profile/src/components/modules/UserProfile/SignIn/StyledSignIn.js new file mode 100644 index 000000000..b22c2af92 --- /dev/null +++ b/apps/user-profile/src/components/modules/UserProfile/SignIn/StyledSignIn.js @@ -0,0 +1,12 @@ +import styled from "styled-components"; + + +export const SignInContainer = styled.div` + width: 100%, + display: flex, + flexDirection: column, + minHeight: 60vh, + justifyContent: center, + alignItems: center, + color: red, +`; diff --git a/apps/user-profile/src/components/modules/UserProfile/SignIn/index.js b/apps/user-profile/src/components/modules/UserProfile/SignIn/index.js new file mode 100644 index 000000000..0375a93f4 --- /dev/null +++ b/apps/user-profile/src/components/modules/UserProfile/SignIn/index.js @@ -0,0 +1 @@ +export { default } from "./SignIn"; diff --git a/apps/website/src/components/modules/UserProfile/StyledUserProfile.js b/apps/user-profile/src/components/modules/UserProfile/StyledUserProfile.js similarity index 61% rename from apps/website/src/components/modules/UserProfile/StyledUserProfile.js rename to apps/user-profile/src/components/modules/UserProfile/StyledUserProfile.js index c36b37b70..6f034988e 100644 --- a/apps/website/src/components/modules/UserProfile/StyledUserProfile.js +++ b/apps/user-profile/src/components/modules/UserProfile/StyledUserProfile.js @@ -40,15 +40,40 @@ export const DiscordPlaceHolder = styled.div` background: grey; `; export const Misc = styled.div` - // width:80%; grid-area: Misc; /*display: grid;*/ gap: 15px; grid-template-columns: auto auto; margin-bottom: 50px; + .react-tabs__tab-list { + border-bottom: none; + } + + .react-tabs__tab { + font-family: ${({ theme }) => theme.fonts.headline}; + border-radius:0; + font-size:3rem; + border:.3rem solid ${({ theme }) => theme.colors.NEUTRAL_1}; + background-color: ${({ theme }) => theme.colors.NEUTRAL_1}; + color: ${({ theme }) => theme.colors.NEUTRAL_2}; + margin-right:.5rem; + } + + .react-tabs__tab--selected { + border-color:${({ theme }) => theme.colors.NEUTRAL_1}; + color:${({ theme }) => theme.colors.NEUTRAL_1}; + background-color:transparent; + border-bottom:none; + } + @media (orientation: portrait) { grid-template-columns: auto; grid-template-rows: auto auto; + + .react-tabs__tab { + font-size:2rem; + } } -`; + +`; \ No newline at end of file diff --git a/apps/website/src/components/modules/UserProfile/UserInterests/StyledUserInterests.js b/apps/user-profile/src/components/modules/UserProfile/UserInterests/StyledUserInterests.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/UserInterests/StyledUserInterests.js rename to apps/user-profile/src/components/modules/UserProfile/UserInterests/StyledUserInterests.js diff --git a/apps/website/src/components/modules/UserProfile/UserInterests/UserInterests.js b/apps/user-profile/src/components/modules/UserProfile/UserInterests/UserInterests.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/UserInterests/UserInterests.js rename to apps/user-profile/src/components/modules/UserProfile/UserInterests/UserInterests.js diff --git a/apps/website/src/components/modules/UserProfile/UserInterests/index.js b/apps/user-profile/src/components/modules/UserProfile/UserInterests/index.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/UserInterests/index.js rename to apps/user-profile/src/components/modules/UserProfile/UserInterests/index.js diff --git a/apps/website/src/components/modules/UserProfile/UserProfile.js b/apps/user-profile/src/components/modules/UserProfile/UserProfile.js similarity index 59% rename from apps/website/src/components/modules/UserProfile/UserProfile.js rename to apps/user-profile/src/components/modules/UserProfile/UserProfile.js index 5841ed867..71aba17c9 100644 --- a/apps/website/src/components/modules/UserProfile/UserProfile.js +++ b/apps/user-profile/src/components/modules/UserProfile/UserProfile.js @@ -1,29 +1,33 @@ import React from "react"; import { useEffect, useState } from 'react'; -import "react-tabs/style/react-tabs.css"; // import react-tabs styles +import "react-tabs/style/react-tabs.css"; import { Tabs, Tab, TabList, TabPanel } from "react-tabs"; import axios from "axios"; +import { useRouter } from "next/router"; -import Button from '../../common/Button'; -import PageBody from '../../common/PageBody'; - -import { useUserDataContext } from '../../../context/UserDataContext'; import BioBox from './BioBox'; import Opportunities from './Opportunities'; import ProfileCard from './ProfileCard'; import RecommendedIdeas from './RecommendedIdeas'; import UserProjects from './UserProjects'; import People from './People'; +import UserInterests from './UserInterests'; -import { env } from '../../../utils/EnvironmentVariables'; - +import Loader from './../../common/Loader'; import { Misc, UserInfo, UserSection, Wrapper } from './StyledUserProfile'; -import UserInterests from './UserInterests'; -import { useRouter } from "next/router"; -// import DiscordSection from "./DiscordSection/DiscordSection"; +import { env } from '../../../utils/EnvironmentVariables'; +import { useUserDataContext } from '../../../context/UserDataContext'; // State management component -export default function UserProfile({ otherUser }) { +/** + * This component has been broken down into two, + * 1. State management component (UserProfile) – initialising states, getting data from backeend. + * 2. The view component (UserProfileView) – rendering the UI elements. + * @export + * @param {*} { publicUserData, isPublic } + * @return {*} + */ +export default function UserProfile({ publicUserData, isPublic }) { const { userData, isAuthenticated } = useUserDataContext(); const [loading, setLoading] = useState(true); @@ -33,7 +37,7 @@ export default function UserProfile({ otherUser }) { const [ideas, setIdeas] = React.useState([]); const [people, setPeople] = React.useState([]); const [interests, setInterests] = React.useState([]); - + // If user hasn't set a username, redirect them to the signup form const router = useRouter(); React.useEffect(() => { @@ -45,12 +49,12 @@ export default function UserProfile({ otherUser }) { React.useEffect(() => { getProjectData(); }, []); + const getProjectData = async () => { await axios(`${process.env.NEXT_PUBLIC_STRAPI_URL}/projects`) .then(({ data }) => { if (data) { setProjects(data); - const tempOpportunities = []; data.map((project) => { project.opportunities.map((opportunity) => { @@ -65,6 +69,7 @@ export default function UserProfile({ otherUser }) { console.error("Could not fetch project data"); }); }; + React.useEffect(() => { const myProjects = []; projects.map((project) => { @@ -97,24 +102,22 @@ export default function UserProfile({ otherUser }) { // Start People React.useEffect(() => { - getPeopleData(); + getPeopleData().catch(() => { console.error(`Could not fetch People's data`) }); }, []); const getPeopleData = async () => { const userCount = (await axios(`${process.env.NEXT_PUBLIC_STRAPI_URL}/users/count`)).data; let randomUserIds = [ - parseInt(Math.random()*userCount), - parseInt(Math.random()*userCount), - parseInt(Math.random()*userCount), - parseInt(Math.random()*userCount), - parseInt(Math.random()*userCount), - parseInt(Math.random()*userCount), + parseInt(Math.random() * userCount), + parseInt(Math.random() * userCount), + parseInt(Math.random() * userCount), + parseInt(Math.random() * userCount), + parseInt(Math.random() * userCount), + parseInt(Math.random() * userCount), ]; - console.log(randomUserIds); - let usersData = await Promise.all(randomUserIds.map(async (userId) => + let usersData = await Promise.all(randomUserIds.map(async (userId) => (await axios(`${process.env.NEXT_PUBLIC_STRAPI_URL}/users/${userId}`)).data )); - console.log(usersData); setPeople(usersData); } // End People @@ -138,16 +141,16 @@ export default function UserProfile({ otherUser }) { useEffect(() => { - setLoading(userData?.id === -1 || otherUser?.id === -1); - }, [otherUser, userData]); + setLoading(userData?.id === -1 || publicUserData?.id === -1); + }, [publicUserData, userData]); - return : + Loading.....; - } - return ( - - {userData?.id || (otherUser?.id && !loading) ? ( - {/* } - - { */} - {/* - - */} - - - + + { // Have to do this hack for some reason (create empty tab if page not loaded)... // otherwise tabs break @@ -221,69 +198,35 @@ export function UserProfileView({ } { // Render tabs from our dynamically built learnPageData object - ["Projects", "People", "Interests", "Ideas", "Opportunities"].map((key) => ( + ["Projects", "People", "Interests", "Ideas", "Opportunities"].map((key) => ( {key} )) } - - + + - - + + - - + + - - - + + + - - + + - - {/* }{ */} - {/* - - */} - {/* - */} - ) : ( -
-

- Please sign in to access this page! -

- -
-
- )} -
-
); } diff --git a/apps/website/src/components/modules/UserProfile/UserProjects/StyledUserProjects.js b/apps/user-profile/src/components/modules/UserProfile/UserProjects/StyledUserProjects.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/UserProjects/StyledUserProjects.js rename to apps/user-profile/src/components/modules/UserProfile/UserProjects/StyledUserProjects.js diff --git a/apps/website/src/components/modules/UserProfile/UserProjects/UserProjects.js b/apps/user-profile/src/components/modules/UserProfile/UserProjects/UserProjects.js similarity index 51% rename from apps/website/src/components/modules/UserProfile/UserProjects/UserProjects.js rename to apps/user-profile/src/components/modules/UserProfile/UserProjects/UserProjects.js index d2dbb53b2..dd3467094 100644 --- a/apps/website/src/components/modules/UserProfile/UserProjects/UserProjects.js +++ b/apps/user-profile/src/components/modules/UserProfile/UserProjects/UserProjects.js @@ -12,7 +12,7 @@ import { useUserDataContext } from "../../../../context/UserDataContext"; import { UserProjectsContainer } from "./StyledUserProjects"; -const UserProjects = ({ myProjects }) => { +const UserProjects = ({ myProjects }) => { const noProjectsDisplay = (
{
); + const unique = [...new Map(myProjects.map((m) => [m.catchPhrase, m])).values()]; + + const unDuplicatedProject = unique.map(project => ( + keyword), + description: project.catchPhrase, + href: `https://devlaunchers.org/projects/${project.slug}`, + imageSrc: project.heroImage?.url, + /* + actions: ( + <> + + LEARN MORE + + + DONATE + + + ), + */ + }} + /> + )) + + return ( {myProjects?.length > 0 ? ( @@ -47,35 +80,7 @@ const UserProjects = ({ myProjects }) => { justifyContent: "space-around", }} > - {myProjects.map((project) => ( - keyword), - description: project.catchPhrase, - href: `https://devlaunchers.org/projects/${project.slug}`, - imageSrc: project.heroImage?.url, - /* - actions: ( - <> - - LEARN MORE - - - DONATE - - - ), - */ - }} - /> - ))} + {unDuplicatedProject} ) : ( diff --git a/apps/website/src/components/modules/UserProfile/UserProjects/index.js b/apps/user-profile/src/components/modules/UserProfile/UserProjects/index.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/UserProjects/index.js rename to apps/user-profile/src/components/modules/UserProfile/UserProjects/index.js diff --git a/apps/website/src/components/modules/UserProfile/WeeksGlance/StyledWeeksGlance.js b/apps/user-profile/src/components/modules/UserProfile/WeeksGlance/StyledWeeksGlance.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/WeeksGlance/StyledWeeksGlance.js rename to apps/user-profile/src/components/modules/UserProfile/WeeksGlance/StyledWeeksGlance.js diff --git a/apps/website/src/components/modules/UserProfile/WeeksGlance/WeeksGlance.js b/apps/user-profile/src/components/modules/UserProfile/WeeksGlance/WeeksGlance.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/WeeksGlance/WeeksGlance.js rename to apps/user-profile/src/components/modules/UserProfile/WeeksGlance/WeeksGlance.js diff --git a/apps/website/src/components/modules/UserProfile/WeeksGlance/index.js b/apps/user-profile/src/components/modules/UserProfile/WeeksGlance/index.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/WeeksGlance/index.js rename to apps/user-profile/src/components/modules/UserProfile/WeeksGlance/index.js diff --git a/apps/website/src/components/modules/UserProfile/index.js b/apps/user-profile/src/components/modules/UserProfile/index.js similarity index 100% rename from apps/website/src/components/modules/UserProfile/index.js rename to apps/user-profile/src/components/modules/UserProfile/index.js diff --git a/apps/user-profile/src/content/README.md b/apps/user-profile/src/content/README.md new file mode 100644 index 000000000..ddc58a2f3 --- /dev/null +++ b/apps/user-profile/src/content/README.md @@ -0,0 +1,24 @@ +# This folder contains data fed into our content layer + +This layer has been created with the intent of moving towards a CMS tool like 'Contentful' in the future, or serving up that data from our backend (Firebase?). It allows us to manage all of the content displayed on the site in one location. + +[Currently, we're using some hacky Google Sheets fun to act as a backend] + +## File Naming Conventions + +You can think of each file in the 'collections' folder as a MongoDB collection. Filenames should therefore follow the MongoDB conventions here: https://arkusnexus.com/2016/09/12/coding-guidelines-mongodb/ + +- Key takeaways + - The name should be a plural of the types of documents to be saved. + - Use camelCase. Normally you shouldn’t have to because the collection name will be one word (plural of the types of documents saved). + +## JSON Conventions + +Google's JSON Style Guide: +https://google.github.io/styleguide/jsoncstyleguide.xml + +- Key takeaways + - Property names are camel cased + - Use double quotes + - Array types should have plural property names, all other property names should be singular + - Data should not be arbitrarily grouped for convenience diff --git a/apps/user-profile/src/content/collections/template.json b/apps/user-profile/src/content/collections/template.json new file mode 100644 index 000000000..9ff3d97b6 --- /dev/null +++ b/apps/user-profile/src/content/collections/template.json @@ -0,0 +1,11 @@ +{ + "_comment": "", + "_model": {}, + "data": { + "apps": [ + { + "title": "Title" + } + ] + } +} diff --git a/apps/user-profile/src/content/collections/userOnboardingModal.json b/apps/user-profile/src/content/collections/userOnboardingModal.json new file mode 100644 index 000000000..9ff3d97b6 --- /dev/null +++ b/apps/user-profile/src/content/collections/userOnboardingModal.json @@ -0,0 +1,11 @@ +{ + "_comment": "", + "_model": {}, + "data": { + "apps": [ + { + "title": "Title" + } + ] + } +} diff --git a/apps/user-profile/src/content/collections/userProfile.json b/apps/user-profile/src/content/collections/userProfile.json new file mode 100644 index 000000000..9ff3d97b6 --- /dev/null +++ b/apps/user-profile/src/content/collections/userProfile.json @@ -0,0 +1,11 @@ +{ + "_comment": "", + "_model": {}, + "data": { + "apps": [ + { + "title": "Title" + } + ] + } +} diff --git a/apps/user-profile/src/context/OnboardingContext.js b/apps/user-profile/src/context/OnboardingContext.js new file mode 100644 index 000000000..d30de2403 --- /dev/null +++ b/apps/user-profile/src/context/OnboardingContext.js @@ -0,0 +1,14 @@ +import { createContext, useContext, useState } from "react"; + +const OnboardingContext = createContext() + +export const OnboardingProvider = ({ children }) => { + + return ( + + {children} + + ) +} + +export const useOnboarding = () => useContext(OnboardingContext) \ No newline at end of file diff --git a/apps/user-profile/src/context/UserDataContext.js b/apps/user-profile/src/context/UserDataContext.js new file mode 100644 index 000000000..1d01f8bbf --- /dev/null +++ b/apps/user-profile/src/context/UserDataContext.js @@ -0,0 +1,72 @@ +import axios from 'axios'; +import constate from 'constate'; // State Context Object Creator +import React from 'react'; + +import { env } from '../utils/EnvironmentVariables'; + +const DEFAULT_USER = { + id: 1, + name: 'Ethan Levin', + username: 'Ethan', + email: '', + bio: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque orci quam, gravida id erat ac, vulputate posuere mi. In elementum pulvinar elit. Nam diam felis, bibendum nec luctus id, ornare sit amet dui. ", + profilePictureUrl: 'https://cdn.pixabay.com/photo/2016/08/08/09/17/avatar-1577909_1280.png', + socialMediaLinks: [], + totalPoints: 0, + totalSeasonPoints: 0, + availablePoints: 0, + volunteerHours: 0, + discord: { + id: 0, + avatar: '', + username: '', + discriminator: '', + }, + interests: [], +}; + +// Built from this article: https://www.sitepoint.com/replace-redux-react-hooks-context-api/ + +// Step 1: Create a custom hook that contains your state and actions +function useUserData() { + const [userData, setUserData] = React.useState(DEFAULT_USER); + const [isAuthenticated, setIsAuthenticated] = React.useState(); + console.log("DEBUGGING in user-profile: ",`${process.env.NEXT_PUBLIC_API_URL}/users/me`, ) + + React.useEffect(() => { + axios(`${process.env.NEXT_PUBLIC_API_URL}/users/me`, { + withCredentials: true, + }) + .then(({ data: currentUser }) => { + setUserData({ + ...currentUser, + id: currentUser.id, + name: currentUser.profile.displayName, + username: currentUser.username, + email: currentUser.email, + bio: currentUser.profile.bio, + profilePictureUrl: currentUser.profile.profilePictureUrl, + socialMediaLinks: currentUser.profile.socialMediaLinks, + totalPoints: currentUser.point.totalPoints, + totalSeasonPoints: currentUser.point.totalSeasonPoints, + availablePoints: currentUser.point.availablePoints, + volunteerHours: currentUser.point.volunteerHours, + interests: currentUser.interests, + }); + setIsAuthenticated(true); + }) + .catch(() => { + setIsAuthenticated(false); + }); + + setTimeout(() => { + console.log("User Data", userData); + }, 5000); + }, []); + + return { userData, setUserData, isAuthenticated }; +} + +// Step 2: Declare your context state object to share the state with other components +const [UserDataProvider, useUserDataContext] = constate(useUserData); +export { UserDataProvider, useUserDataContext }; diff --git a/apps/user-profile/src/images/RoleCard/developer.svg b/apps/user-profile/src/images/RoleCard/developer.svg new file mode 100644 index 000000000..57e161416 --- /dev/null +++ b/apps/user-profile/src/images/RoleCard/developer.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/apps/user-profile/src/images/RoleCard/other.svg b/apps/user-profile/src/images/RoleCard/other.svg new file mode 100644 index 000000000..196fbcd52 --- /dev/null +++ b/apps/user-profile/src/images/RoleCard/other.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/apps/user-profile/src/images/RoleCard/ux-ui.svg b/apps/user-profile/src/images/RoleCard/ux-ui.svg new file mode 100644 index 000000000..84f1fe10d --- /dev/null +++ b/apps/user-profile/src/images/RoleCard/ux-ui.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/apps/user-profile/src/images/ignition-symbol.png b/apps/user-profile/src/images/ignition-symbol.png new file mode 100644 index 000000000..ec18196ed Binary files /dev/null and b/apps/user-profile/src/images/ignition-symbol.png differ diff --git a/apps/user-profile/src/images/logo-monogram.png b/apps/user-profile/src/images/logo-monogram.png new file mode 100644 index 000000000..1120f2581 Binary files /dev/null and b/apps/user-profile/src/images/logo-monogram.png differ diff --git a/apps/user-profile/src/images/onboarding-level-up.png b/apps/user-profile/src/images/onboarding-level-up.png new file mode 100644 index 000000000..0d053b268 Binary files /dev/null and b/apps/user-profile/src/images/onboarding-level-up.png differ diff --git a/apps/user-profile/src/images/onboarding-network.png b/apps/user-profile/src/images/onboarding-network.png new file mode 100644 index 000000000..f72b5110b Binary files /dev/null and b/apps/user-profile/src/images/onboarding-network.png differ diff --git a/apps/user-profile/src/images/onboarding-project.png b/apps/user-profile/src/images/onboarding-project.png new file mode 100644 index 000000000..a1e6fc50d Binary files /dev/null and b/apps/user-profile/src/images/onboarding-project.png differ diff --git a/apps/user-profile/src/images/spark-symbol.png b/apps/user-profile/src/images/spark-symbol.png new file mode 100644 index 000000000..1d2102647 Binary files /dev/null and b/apps/user-profile/src/images/spark-symbol.png differ diff --git a/apps/user-profile/src/pages/_app.js b/apps/user-profile/src/pages/_app.js new file mode 100644 index 000000000..f84e335d5 --- /dev/null +++ b/apps/user-profile/src/pages/_app.js @@ -0,0 +1,80 @@ +import Head from 'next/head'; +import { Router, useRouter } from 'next/router'; +import React from 'react'; +import { ToastContainer } from 'react-toastify'; +import { ThemeProvider } from 'styled-components'; + +import GlobalStyle from '../styles/globals'; + +import 'react-toastify/dist/ReactToastify.css'; +import theme from '../styles/theme'; +import { initGA, logPageView } from '../utils/GoogleAnalytics'; + +import { UserDataProvider } from '../context/UserDataContext'; + +import { LazyMotion, domAnimation } from "framer-motion" + +const hashRedirect = (router) => { + // Strip out hash from url (if any) so we can transition from HashRouter to BrowserRouter + if (router.asPath.startsWith('/#')) { + router.push(router.asPath.replace('/#', '')); + } +}; + +function MyApp(props) { + const router = useRouter(); + hashRedirect(router); + + // Google analytics/Google adwords + React.useEffect(() => { + // Google Analytics + initGA(); + logPageView(); + Router.events.on('routeChangeComplete', () => { + logPageView(); + }); + + // Google AdSense + window.dataLayer = window.dataLayer || []; + function gtag() { + // eslint-disable-next-line prefer-rest-params + window.dataLayer.push(arguments); + } + gtag('js', new Date()); + gtag('config', 'AW-599284852'); + }, []); + + return ( + <> + + + +
+ + + + +
+ +
+ {/* */} + + {props.children} + + {/* {props.children} */} +
+
+
+ + ); +} + +export default MyApp; diff --git a/apps/user-profile/src/pages/_document.js b/apps/user-profile/src/pages/_document.js new file mode 100644 index 000000000..ce4aa84f0 --- /dev/null +++ b/apps/user-profile/src/pages/_document.js @@ -0,0 +1,53 @@ +import Document, { Html, Head, Main, NextScript } from "next/document"; + +import { ServerStyleSheet } from "styled-components"; + +export default class MyDocument extends Document { + render() { + return ( + + + + + + + +
+ + + + ); + } + + static async getInitialProps(ctx) { + const sheet = new ServerStyleSheet(); + const originalRenderPage = ctx.renderPage; + + try { + ctx.renderPage = () => + originalRenderPage({ + enhanceApp: (App) => (props) => + sheet.collectStyles(), + }); + + const initialProps = await Document.getInitialProps(ctx); + return { + ...initialProps, + styles: ( + <> + {initialProps.styles} + {sheet.getStyleElement()} + + ), + }; + } finally { + sheet.seal(); + } + } +} diff --git a/apps/user-profile/src/pages/onboarding.js b/apps/user-profile/src/pages/onboarding.js new file mode 100644 index 000000000..e1481bc4d --- /dev/null +++ b/apps/user-profile/src/pages/onboarding.js @@ -0,0 +1,15 @@ +import Head from 'next/head'; +import UserOnboarding from '../components/modules/UserOnboarding'; + +export default function UserOnboardingPage() { + return ( + <> + + Onboarding + +
+ +
+ + ); +} diff --git a/apps/user-profile/src/pages/users/[userId].js b/apps/user-profile/src/pages/users/[userId].js new file mode 100644 index 000000000..d41014050 --- /dev/null +++ b/apps/user-profile/src/pages/users/[userId].js @@ -0,0 +1,37 @@ +import React from "react"; +import axios from "axios"; + +import UserProfile from "../../components/modules/UserProfile"; + +export const getStaticPaths = async () => { + return { + paths: [], + fallback: "blocking", + }; +}; + +export const getStaticProps = async (context) => { + const {userId} = context.params; + + // only numbers + const numberRegex = /^\d+$/; + + let {data: user} = userId.match(numberRegex) ? + await axios(`${process.env.NEXT_PUBLIC_STRAPI_URL}/users/${userId}`) : + {data: null}; + + return !user ? + { notFound: true, } : + { + props: { user: user}, + revalidate: 20, + }; +}; + +export default function UserProfilePage({user}) { + return ( +
+ +
+ ); +} \ No newline at end of file diff --git a/apps/user-profile/src/pages/users/me.js b/apps/user-profile/src/pages/users/me.js new file mode 100644 index 000000000..f5de8c76f --- /dev/null +++ b/apps/user-profile/src/pages/users/me.js @@ -0,0 +1,48 @@ +import React from "react"; +import { useRouter } from 'next/router' + +import { useUserDataContext } from '../../context/UserDataContext'; + +import Head from 'next/head'; +import UserProfile from "../../components/modules/UserProfile"; +import UserOnboardingModal from "../../components/modules/UserOnboardingModal" +import SignIn from "../../components/modules/UserProfile/SignIn"; +import PageBody from "../../components/common/PageBody"; + + + +/** + * @drescription This component renders the User Profile Component. + * A Modal is opened when user has not fully completed their onboarding. + */ +export default function UserProfilePage(props) { + const { isAuthenticated, userData } = useUserDataContext(); + const router = useRouter(); + + + /** + * @description Open modal when user is coming from the onbaording page. + * More conditions will be applied when modal should be opened in the future. + */ + const openUserOnboardingModal = () => { + return (router.query?.onboarding) + } + + return ( + <> + + User Profile + + + + {isAuthenticated ? + <> + {openUserOnboardingModal() && } + + : + + } + + + ); +} \ No newline at end of file diff --git a/apps/user-profile/src/styles/globals.js b/apps/user-profile/src/styles/globals.js new file mode 100644 index 000000000..b01663bf8 --- /dev/null +++ b/apps/user-profile/src/styles/globals.js @@ -0,0 +1,269 @@ +import { createGlobalStyle } from "styled-components"; +import { normalize } from "styled-normalize"; + +const GlobalStyle = createGlobalStyle` + ${normalize} + +html, +body { + padding: 0; + margin: 0; + /*font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, + Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;*/ + font-family: sans-serif; + font-family: "Nunito", sans-serif; + font-weight: lighter; + color: ${({ theme }) => theme.colors.NEUTRAL_1}; + background-color: #f0edee; +} + +html { + display: flex; + width: 100%; + min-height: 100%; + scroll-behavior: smooth; + /*overflow: auto;*/ +} + +body { + min-height: 100%; + margin: 0px; + width: 100%; + height: 100%; + font-size: 1.5rem; +} + +::-webkit-scrollbar { + width: 20px; +} + +::-webkit-scrollbar-thumb { + background: gray; + border-radius: 10px; + border-top: 5px solid transparent; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-bottom: 5px solid transparent; + background-clip: content-box; +} + +#root { + overflow-x: hidden; +} + +.App { + font-family: sans-serif; + font-family: "Nunito Sans", sans-serif; + text-align: left; +} + +a { + width: auto; + display: inline; + color: ${({ theme }) => theme.colors.ACCENT_3}; + text-decoration: none; + &:hover { + color: ${({ theme }) => theme.colors.ACCENT_4}; + } +} +h1, +h2, +h3, +h4, +h5, +h6 { + margin-top: 1rem; + margin-bottom: 1rem; +} + +h1 { + font-family: ${({ theme }) => theme.fonts.headline}, sans-serif; + line-height: 1em; + margin-top: 4%; + margin-bottom: 4%; + + width: fit-content; + padding: 1rem; + // background-color:${({ theme }) => theme.colors.NEUTRAL_1}; + // color:${({ theme }) => theme.colors.NEUTRAL_2}; + + border-bottom: .3rem solid ${({ theme }) => theme.colors.NEUTRAL_1}; +} + +h2 { + font-family: "Abel", sans-serif; +} + +h3 { + font-family: "Abel", sans-serif; + font-size: 1.9rem; + font-weight: bold; +} + +h4 { + font-family: "Abel", sans-serif; +} + +/* +* { + box-sizing: border-box; +} +* +.toast-container { + width: 40vw; +} +.toast { + background-color: white; + color: #1c1c1c; +} +.toast-progress { + background: black !important; +} + +/* collections default to small-cards for entry elements */ +.collection { + width: 100%; + display: flex; + flex-direction: row; + justify-content: flex-start; + flex-wrap: wrap; +} +.entry { + margin: 1.5%; + /*border: 2px solid #1c1c1c;*/ + width: 30%; + + border-radius: 2px; + box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23); +} +.collection--small-cards > .entry { + /* Allows us to control card size with just the collection element's class */ + width: 30%; +} +.collection--large-cards > .entry { + /* Allows us to control card size with just the collection element's class */ + width: 90%; +} + +.entry-heading { + width: 100%; + font-size: 2rem; + background-color: #1c1c1c; +} +.entry-title { + margin-left: 4%; +} +.entry-content { + width: 100%; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: center; +} +.entry-image-holder { + width: 100%; + display: flex; + justify-content: center; + align-items: center; +} + +.entry-image { + background-color: red; + height: 10vw; + box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23); + /* padding-bottom: 42.5%; */ + cursor: pointer; +} +.entry-description { + width: 90%; +} + +/* Special collection--large-cards overrides */ +.collection--large-cards > .entry > .entry-content { + flex-direction: row; + justify-content: space-between; +} +.collection--large-cards > .entry > .entry-content > .entry-image-holder { + width: 30%; + height: 100%; +} +.collection--large-cards > .entry > .entry-content > .entry-description { + width: 70%; +} + +.entry-image-holder a div { + /* temp to push image placeholders down */ + padding-right: 15vw; + background-color: lightgray; +} + + +li { + margin-bottom: 5px; +} + +/* React tabs */ +// css +.react-tabs__tab-list { + border-bottom: none; +} + +.react-tabs__tab { + // your custom style goes here + font-family: ${({ theme }) => theme.fonts.headline}; + border-radius:0; + font-size:3rem; + border:.3rem solid ${({ theme }) => theme.colors.NEUTRAL_1}; + background-color: ${({ theme }) => theme.colors.NEUTRAL_1}; + color: ${({ theme }) => theme.colors.NEUTRAL_2}; + margin-right:.5rem; +} + +.react-tabs__tab--selected { + // your custom style goes here + border-color:${({ theme }) => theme.colors.NEUTRAL_1}; + color:${({ theme }) => theme.colors.NEUTRAL_1}; + background-color:transparent; + border-bottom:none; +} + +.react-tabs__tab:focus { + // your custom style goes here +} + +.react-tabs__tab:focus:after { + // your custom style goes here +} + + +@media (orientation: portrait) { + html { + /* Scale all font down */ + font-size: 75%; + } + + .App { + } + + h1 { + font-size: 1.7rem; + } + + h2 { + font-size: 1.2rem; + } + + .collection--small-cards > .entry { + width: 100%; + } + .entry-image { + height: 20vw; + } + + .react-tabs__tab { + font-size:2rem; + } +} + +`; +export default GlobalStyle; diff --git a/apps/user-profile/src/styles/theme.ts b/apps/user-profile/src/styles/theme.ts new file mode 100644 index 000000000..f40e9bec7 --- /dev/null +++ b/apps/user-profile/src/styles/theme.ts @@ -0,0 +1,63 @@ +const theme = { + colors: { + NEUTRAL_1: "#1c1c1c", // dark + ACCENT_1: "#ff7f0e", // orange + ACCENT_2: "#ffab00", // yellow + ACCENT_3: "#3a7ca5", // dark-blue + ACCENT_4: "#81c3d7", // loght-blue + ACCENT_5: "#ffc30f", // orange-yellow + ACCENT_6: "#C5B1A0", // beige + NEUTRAL_2: "#f0edee", // light + + NEUTRAL_3:"#59687B", + NEUTRAL_4:"#C4C4C4", + NEUTRAL_5:"#89969F", + NEUTRAL_6:"#C3C0C0", + // Dev Recruiters theme colors + White: '#FFFFFF', + Black: '#000000', + BlackT60: 'rgba(0,0,0,0.6)', + BlackT38: 'rgba(0,0,0,0.38)', + + AntiFlashWhite: '#F1F4F5', + AntiFlashWhiteT40: 'rgba(241,244,245,0.4)', + + SilverSand: '#C4C4C4', + SilverSandT20: 'rgba(196,196,196,0.2)', + + LightGray: '#D3D4D6', + LightGrayT90: 'rgba(211, 212, 214, 0.9)', + + Cultured: '#F8F8F8', + CulturedT87: 'rgba(248, 248, 248, 0.87)', + + Red: '#FF0000', + RedT31: 'rgba(255,0,0,0.31)', + + AppleT48: 'rgba(102, 176, 75, 0.48)', + + OuterSpace: '#454D58', + DarkElectricBlue: '#59687B', + Crayola: '#30363E', + Gray: '#7E8288', + CoolGrey: '#89969F', + Argent: '#C3C0C0', + BlackCoral: '#5B6068', + Platinum: '#E5E5E5', + SonicSilver: '#6F747C', + BrightGray: '#EDEDED', + DavysGrey: '#4F5154', + }, + fonts: { + headline: 'Abel', + normal: 'Nunito Sans', + }, + fontSizes: { + small: '1em', + medium: '2em', + large: '3em', + }, +} as const; +type Theme = typeof theme; +export type { Theme }; +export default theme; diff --git a/apps/user-profile/src/utils/EnvironmentVariables.js b/apps/user-profile/src/utils/EnvironmentVariables.js new file mode 100644 index 000000000..62759d47e --- /dev/null +++ b/apps/user-profile/src/utils/EnvironmentVariables.js @@ -0,0 +1,30 @@ +const PROD = { + envType: "PROD", + API_URL: "https://api.devlaunchers.org", + STRAPI_URL: "https://api.devlaunchers.org", + GOOGLE_AUTH_URL: "https://api.devlaunchers.org/connect/google", + DISCORD_AUTH_URL: + "https://discord.com/api/oauth2/authorize?client_id=709889509864636496&redirect_uri=https%3A%2F%2Fapi.devlaunchers.org%2Fusers%2Fauth%2Fdiscord%2Fcallback&response_type=code&scope=identify", +}; + +const STAGING = { + envType: "STAGING", + API_URL: "https://api-staging.devlaunchers.org", + STRAPI_URL: "https://api-staging.devlaunchers.org", + GOOGLE_AUTH_URL: "https://api-staging.devlaunchers.org/connect/google", + DISCORD_AUTH_URL: + "https://discord.com/api/oauth2/authorize?client_id=815294711983112194&redirect_uri=https%3A%2F%2Fapi-staging.devlaunchers.org%2Fusers%2Fauth%2Fdiscord%2Fcallback&response_type=code&scope=identify", +}; + +export const env = () => { + if (typeof window !== "undefined") { + const currentUrl = window.location.href; + if ( + currentUrl.indexOf("staging") !== -1 || + currentUrl.indexOf("localhost") !== -1 + ) { + return STAGING; + } + } + return PROD; +}; diff --git a/apps/user-profile/src/utils/GoogleAnalytics.js b/apps/user-profile/src/utils/GoogleAnalytics.js new file mode 100644 index 000000000..438d7bf53 --- /dev/null +++ b/apps/user-profile/src/utils/GoogleAnalytics.js @@ -0,0 +1,10 @@ +import ReactGA from "react-ga"; + +export const initGA = () => { + ReactGA.initialize("UA-180113136-1"); +}; + +export const logPageView = () => { + ReactGA.set({ page: window.location.pathname }); + ReactGA.pageview(window.location.pathname); +}; diff --git a/apps/user-profile/src/utils/Logout.js b/apps/user-profile/src/utils/Logout.js new file mode 100644 index 000000000..9a33f05c7 --- /dev/null +++ b/apps/user-profile/src/utils/Logout.js @@ -0,0 +1,13 @@ +import Router from "next/router"; +import axios from "axios"; +import { env } from "./EnvironmentVariables"; + +const Logout = () => { + axios + .get(`${process.env.NEXT_PUBLIC_STRAPI_URL}/auth/logout`, { withCredentials: true }) + .then(() => { + Router.reload(window.location.pathname); + }); +}; + +export default Logout; diff --git a/apps/user-profile/src/utils/ScrollToTop.js b/apps/user-profile/src/utils/ScrollToTop.js new file mode 100644 index 000000000..bbf080b01 --- /dev/null +++ b/apps/user-profile/src/utils/ScrollToTop.js @@ -0,0 +1,16 @@ +import { useEffect } from "react"; + +function ScrollToTop({ history }) { + useEffect(() => { + const unlisten = history.listen(() => { + window.scrollTo(0, 0); + }); + return () => { + unlisten(); + }; + }, [history]); + + return null; +} + +export default ScrollToTop; diff --git a/apps/user-profile/src/utils/TimeZoneConverter.js b/apps/user-profile/src/utils/TimeZoneConverter.js new file mode 100644 index 000000000..a270b1ffd --- /dev/null +++ b/apps/user-profile/src/utils/TimeZoneConverter.js @@ -0,0 +1,31 @@ +import { DateTime } from "luxon"; + +export const ConvertCentralTime = (weekday = 6, hour, minute = 0) => + DateTime.fromObject( + { + weekday, + hour, + minute, + }, + { zone: "UTC-5" } + ).setZone("local"); + +export const ConvertCentralTimeString = ( + weekday = 0, + hour = 0, + minute = 0, + repeat = { weeks: 1 } +) => { + let centralDate = ConvertCentralTime(weekday, hour, minute); + if (DateTime.now() > centralDate) { + centralDate = centralDate.plus(repeat); + } + const localDate = centralDate.toLocaleString({ + weekday: "long", + month: "long", + day: "numeric", + hour: "numeric", + }); + const localTz = centralDate.toFormat("ZZZZ"); + return `${localDate} ${localTz}`; +}; diff --git a/apps/user-profile/src/utils/ValidateEmail.js b/apps/user-profile/src/utils/ValidateEmail.js new file mode 100644 index 000000000..507c75f65 --- /dev/null +++ b/apps/user-profile/src/utils/ValidateEmail.js @@ -0,0 +1,5 @@ +export default function validateEmail(email) { + const re = + /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; + return re.test(String(email).toLowerCase()); +} diff --git a/apps/user-profile/src/utils/featureflags.js b/apps/user-profile/src/utils/featureflags.js new file mode 100644 index 000000000..d13720d16 --- /dev/null +++ b/apps/user-profile/src/utils/featureflags.js @@ -0,0 +1,8 @@ + + +const env = process.node.env; + +export const flags = { + +} + diff --git a/apps/user-profile/tsconfig.json b/apps/user-profile/tsconfig.json new file mode 100644 index 000000000..acf5f49c8 --- /dev/null +++ b/apps/user-profile/tsconfig.json @@ -0,0 +1,34 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "baseUrl": "./src", + "target": "esnext", + "lib": ["dom", "dom.iterable", "esnext"], + "module": "esnext", + "jsx": "preserve", + "incremental": true, + "paths": { + "@/lib/*": ["./lib/*"], + "@/components/*": ["./components/*"], + "@/pages/*": ["./pages/*"], + "@/public/*": ["../public/*"], + "@/themes/*": ["./themes/*"], + "@devlaunchers/site-projects/*": ["../../../apps/site-projects/src/pages/*"], + "@devlaunchers/dev-recruiters/*": ["../../../apps/dev-recruiters/src/pages/*"], + "@devlaunchers/components/*": ["../../../packages/UI/src/*"], + "@devlaunchers/components": ["../../../packages/UI/src/index"], + "@devlaunchers/core-lib/*": ["../../../packages/core-lib/src/*"], + "@devlaunchers/core-lib": ["../../../packages/core-lib/src/index"] + } + }, + "exclude": ["**/node_modules", "**/.*/", ".next"], + "include": [ + "next-env.d.ts", + "**/*.ts", + "**/*.tsx", + "**/*.js", + "**/*.jsx", + "**/*.mjs", + "**/*.json" +, ".eslintrc-example.js" ] +} \ No newline at end of file diff --git a/apps/user-profile/wrangler.toml b/apps/user-profile/wrangler.toml new file mode 100644 index 000000000..bb0dc2b7f --- /dev/null +++ b/apps/user-profile/wrangler.toml @@ -0,0 +1,15 @@ +type = "webpack" +account_id = "b0eb1f5510cb71344976cb9cac51e2af" +zone_id = "976b2978bfb8a506026238d437fe0555" + +[env.staging] +name = "website-staging" +route = "staging.devlaunchers.org/*" + +[env.production] +name = "website" +route = "devlaunchers.org/*" + +[site] +bucket = "./build" +entry-point = "workers-site" \ No newline at end of file diff --git a/apps/website/src/components/modules/UserProfile/People/People.js b/apps/website/src/components/modules/UserProfile/People/People.js deleted file mode 100644 index 89e7d97b6..000000000 --- a/apps/website/src/components/modules/UserProfile/People/People.js +++ /dev/null @@ -1,64 +0,0 @@ -import React from "react"; -import Image from "next/image"; -import axios from "axios"; -import Link from "next/link"; -import { useRouter } from "next/router"; - -import Button from "../../../common/Button"; -import Card from "../../../common/Card"; - -import { env } from "../../../../utils/EnvironmentVariables"; - -import { useUserDataContext } from "../../../../context/UserDataContext"; - -import { PeopleContainer } from "./StyledPeople"; - -const People = ({ people }) => { - return ( - -
-

Interesting People

-
- {people.map((person) => ( -
- -
- {person?.profile?.displayName} -
-
- ))} -
-
-
- ); -}; - -export default People; diff --git a/apps/website/src/components/modules/UserProfile/ProfileCard/ProfileCard.js b/apps/website/src/components/modules/UserProfile/ProfileCard/ProfileCard.js deleted file mode 100644 index fabf1b570..000000000 --- a/apps/website/src/components/modules/UserProfile/ProfileCard/ProfileCard.js +++ /dev/null @@ -1,12 +0,0 @@ -import React from "react"; -import { Wrapper, ProfilePicture, Name, UserName } from "./StyledProfileCard"; - -const UserProfileImage = ({ img, name, username }) => ( - - - {name} - {username} - -); - -export default UserProfileImage; diff --git a/apps/website/src/context/UserDataContext.js b/apps/website/src/context/UserDataContext.js index ee71862d8..ee2c2df8e 100644 --- a/apps/website/src/context/UserDataContext.js +++ b/apps/website/src/context/UserDataContext.js @@ -6,11 +6,11 @@ import { env } from '../utils/EnvironmentVariables'; const DEFAULT_USER = { id: 0, - name: '', + name: 'Ethan Levin', username: '', email: '', bio: '', - profilePictureUrl: '', + profilePictureUrl: 'https://cdn.pixabay.com/photo/2016/08/08/09/17/avatar-1577909_1280.png', socialMediaLinks: [], totalPoints: 0, totalSeasonPoints: 0, @@ -33,11 +33,12 @@ function useUserData() { const [isAuthenticated, setIsAuthenticated] = React.useState(); React.useEffect(() => { - axios(`${env().STRAPI_URL}/users/me`, { + axios(`https://api.devlaunchers.org/users/me`, { withCredentials: true, }) .then(({ data: currentUser }) => { setUserData({ + ...currentUser, id: currentUser.id, name: currentUser.profile.displayName, username: currentUser.username, @@ -57,6 +58,10 @@ function useUserData() { // setUserData({ id: "invalid" }); setIsAuthenticated(false); }); + + setTimeout(() => { + console.log("User Data", userData); + }, 5000); }, []); return { userData, setUserData, isAuthenticated }; diff --git a/apps/website/src/pages/users/[username].js b/apps/website/src/pages/users/[username].js deleted file mode 100644 index a8a652fb9..000000000 --- a/apps/website/src/pages/users/[username].js +++ /dev/null @@ -1,54 +0,0 @@ -import React from "react"; - -import axios from "axios"; -import Header from "../../components/common/Header"; -import UserProfile from "../../components/modules/UserProfile"; -import Footer from "../../components/common/Footer"; -import { env } from "../../utils/EnvironmentVariables"; - -export const getStaticPaths = async () => { - const { data } = await axios(`${process.env.NEXT_PUBLIC_STRAPI_URL}/users`, { - headers: { - Accept: "application/json, text/plain, */*", - "User-Agent": - "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36", - }, - }); - - const paths = data - .filter(({ username }) => username) - .map(({ username }) => ({ - params: { username }, - })); - - return { - paths, - fallback: "blocking", - }; -}; - -export const getStaticProps = async (context) => { - const { username } = context.params; - const { data: user } = await axios( - `${process.env.NEXT_PUBLIC_STRAPI_URL}/users?username_eq=${encodeURI(username)}` - ); - - if (!user) { - return { - notFound: true, - }; - } - - return { - props: { user: user[0] }, - revalidate: 20, - }; -}; - -export default function UserProfilePage({ user }) { - return ( -
- -
- ); -} diff --git a/apps/website/src/pages/users/me.js b/apps/website/src/pages/users/me.js deleted file mode 100644 index 9cc28982c..000000000 --- a/apps/website/src/pages/users/me.js +++ /dev/null @@ -1,13 +0,0 @@ -import React from "react"; - -import Header from "../../components/common/Header"; -import UserProfile from "../../components/modules/UserProfile"; -import Footer from "../../components/common/Footer"; - -export default function UserProfilePage() { - return ( -
- -
- ); -} diff --git a/monorepo.code-workspace b/monorepo.code-workspace index a34d5e4d9..c13fd5e66 100644 --- a/monorepo.code-workspace +++ b/monorepo.code-workspace @@ -12,6 +12,10 @@ "name": "ideaspace", "path": "apps/ideaspace" }, + { + "name": "user-profile", + "path": "apps/user-profile" + }, { "name": "site-projects", "path": "apps/site-projects" @@ -65,6 +69,7 @@ "./apps/app", "./apps/website", "./apps/ideaspace", + "./apps/user-profile", "./apps/site-projects", "./apps/dev-recruiters", "./packages/UI", diff --git a/packages/UI/package.json b/packages/UI/package.json index 74ffe6780..ca7fcdaba 100644 --- a/packages/UI/package.json +++ b/packages/UI/package.json @@ -10,7 +10,7 @@ "babel-loader": "8.2.5", "constate": "^3.3.2", "formik": "2.2.9", - "framer-motion": "6.5.1", + "framer-motion": "6.2.4", "next": "^12.2.3", "polished": "^4.2.2", "react": "^17.0.2", diff --git a/packages/UI/src/components/organisms/Navigation/Navigation.tsx b/packages/UI/src/components/organisms/Navigation/Navigation.tsx index e1bdd6532..36e8f5986 100644 --- a/packages/UI/src/components/organisms/Navigation/Navigation.tsx +++ b/packages/UI/src/components/organisms/Navigation/Navigation.tsx @@ -80,7 +80,9 @@ export default function Navigation({ user }: NavigationProps) { as="a" href={ process.env.NEXT_PUBLIC_GOOGLE_AUTH_URL + - '?redirectURL=https://devlaunchers.org/users/me' + '?redirectURL=' + + process.env.NEXT_PUBLIC_BASE_SITE_URL + + '/users/me' } buttonType="primary" buttonSize="standard" @@ -91,7 +93,9 @@ export default function Navigation({ user }: NavigationProps) { as="a" href={ process.env.NEXT_PUBLIC_GOOGLE_AUTH_URL + - '?redirectURL=https://devlaunchers.org/users/me' + '?redirectURL=' + + process.env.NEXT_PUBLIC_BASE_SITE_URL + + '/users/me' } buttonType="secondary" buttonSize="standard" @@ -101,14 +105,22 @@ export default function Navigation({ user }: NavigationProps) { ) : ( - Profile avatar - Hi {userInfo.name} + + + + Profile avatar + Hi {userInfo.name} + + + - + {content.expectations?.length && content.benefits?.length ? ( + + ) : ( + `` + )} + {handleApply ? ( + + ) : ( + `` + )} @@ -164,22 +172,30 @@ const PositionCard = ({ - - + {content.expectations?.length && content.benefits?.length ? ( + + ) : ( + `` + )} + {handleApply ? ( + + ) : ( + `` + )} diff --git a/packages/UI/src/components/organisms/cards/PositionCard/index.ts b/packages/UI/src/components/organisms/cards/PositionCard/index.ts index a105491f8..2829e1ef2 100644 --- a/packages/UI/src/components/organisms/cards/PositionCard/index.ts +++ b/packages/UI/src/components/organisms/cards/PositionCard/index.ts @@ -11,7 +11,7 @@ export interface PositionCardProps { timeCommittment: string; role: string; tags: string[]; - benifits: string[]; + benefits: string[]; level: string; title: string; }; diff --git a/packages/UI/src/components/organisms/cards/UserCard/UserCard.tsx b/packages/UI/src/components/organisms/cards/UserCard/UserCard.tsx index f64c247df..aa1a69f8a 100644 --- a/packages/UI/src/components/organisms/cards/UserCard/UserCard.tsx +++ b/packages/UI/src/components/organisms/cards/UserCard/UserCard.tsx @@ -9,14 +9,21 @@ import Mail from '../../../../assets/icons/Mail'; import { useUserDataContext } from '../../../../context/UserDataContext'; import type { UserCardProps } from '.'; -export default function UserCard({ user, isVertical }: UserCardProps) { +export default function UserCard({ + user, + isVertical, + style = {}, +}: UserCardProps) { let userInfo = user; if (!user) { // eslint-disable-next-line react-hooks/rules-of-hooks userInfo = useUserDataContext().userData; } return ( - + )} - - - - DISCORD - - {userInfo.discord.username}#{userInfo.discord.discriminator} - + {userInfo.discord ? ( + + + + DISCORD + + {userInfo?.discord?.username}# + {userInfo?.discord?.discriminator} + + - - - - - Email - - {userInfo.email} - + ) : ( + `` + )} + {userInfo.email ? ( + + + + Email + + {userInfo.email} + + - + ) : ( + `` + )} diff --git a/packages/UI/src/components/organisms/cards/UserCard/index.tsx b/packages/UI/src/components/organisms/cards/UserCard/index.tsx index 7be440115..528ba9434 100644 --- a/packages/UI/src/components/organisms/cards/UserCard/index.tsx +++ b/packages/UI/src/components/organisms/cards/UserCard/index.tsx @@ -6,4 +6,5 @@ export interface UserCardProps { discord: Pick; }; isVertical: boolean; + style: object; } diff --git a/packages/UI/src/context/UserDataContext.js b/packages/UI/src/context/UserDataContext.js index 3e29a112b..1350e3126 100644 --- a/packages/UI/src/context/UserDataContext.js +++ b/packages/UI/src/context/UserDataContext.js @@ -5,12 +5,13 @@ import React from 'react'; import { env } from '../utils/EnvironmentVariables'; export const DEFAULT_USER = { - id: 0, - name: '', - username: '', - email: '', - bio: '', - profilePictureUrl: '', + id: 6, + name: 'Kris Gano', + username: 'Kris_Gano', + email: 'krisgano@devlaunchers.com', + bio: 'A kris bio', + profilePictureUrl: + 'https://lh3.googleusercontent.com/a/AATXAJxZ3nb3nA60iLAv1-RqQizgB871aHjJp4LTwi55=s96-c', socialMediaLinks: [], totalPoints: 0, totalSeasonPoints: 0, @@ -22,7 +23,40 @@ export const DEFAULT_USER = { username: '', discriminator: '', }, - interests: [], + interests: [ + { + id: 17, + published_at: '2021-08-11T05:41:33.064Z', + created_at: '2021-08-11T05:41:28.424Z', + updated_at: '2021-08-11T05:41:33.478Z', + interest: 'Node.js', + categories: [], + }, + { + id: 7, + published_at: '2021-08-11T05:37:11.747Z', + created_at: '2021-08-11T05:37:07.908Z', + updated_at: '2021-08-11T05:37:11.973Z', + interest: 'Web Dev', + categories: [], + }, + { + id: 1, + published_at: '2021-08-11T05:35:35.681Z', + created_at: '2021-08-11T05:35:29.489Z', + updated_at: '2021-08-11T05:35:35.960Z', + interest: 'Blockchain', + categories: [], + }, + { + id: 4, + published_at: '2021-08-11T05:36:30.868Z', + created_at: '2021-08-11T05:36:25.579Z', + updated_at: '2021-08-11T05:36:31.097Z', + interest: 'UI/UX', + categories: [], + }, + ], }; // Built from this article: https://www.sitepoint.com/replace-redux-react-hooks-context-api/ diff --git a/yarn.lock b/yarn.lock index 8aa024650..383605eb2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2468,6 +2468,7 @@ __metadata: "@devlaunchers/eslint-config-bases": "workspace:^" "@devlaunchers/ideaspace": "*" "@devlaunchers/site-projects": "*" + "@devlaunchers/user-profile": "*" "@devlaunchers/website": "*" "@next/env": ^12.2.3 "@ramonak/react-progress-bar": ^5.0.2 @@ -2562,7 +2563,7 @@ __metadata: eslint-plugin-react-hooks: 4.6.0 eslint-plugin-testing-library: 5.6.0 formik: 2.2.9 - framer-motion: 6.5.1 + framer-motion: 6.2.4 jest: ^27.0.6 next: ^12.2.3 npm-run-all: 4.1.5 @@ -2819,6 +2820,62 @@ __metadata: languageName: unknown linkType: soft +"@devlaunchers/user-profile@*, @devlaunchers/user-profile@workspace:apps/user-profile": + version: 0.0.0-use.local + resolution: "@devlaunchers/user-profile@workspace:apps/user-profile" + dependencies: + "@devlaunchers/dev-recruiters": "workspace:^" + "@devlaunchers/eslint-config-bases": "workspace:^" + "@devlaunchers/ideaspace": "*" + "@devlaunchers/site-projects": "*" + "@ramonak/react-progress-bar": ^5.0.2 + "@types/luxon": 3.0.0 + "@types/react": ^17.0.0 + "@types/styled-components": 5.1.25 + articles: ^0.2.2 + autosave: ^1.0.3 + axios: ^0.27.2 + babel-plugin-styled-components: ^2.0.7 + constate: ^3.3.2 + eslint: ^8.21.0 + eslint-config-airbnb-base: ^15.0.0 + eslint-config-next: ^12.2.3 + eslint-config-prettier: ^8.5.0 + framer-motion: 6.2.4 + husky: ^8.0.1 + lint-staged: ^13.0.3 + luxon: ^3.0.1 + next: ^12.2.3 + next-compose-plugins: ^2.2.1 + next-optimized-images: ^2.6.2 + next-transpile-modules: ^9.0.0 + pluralize: ^8.0.0 + postcss: ^8.4.14 + prettier: ^2.7.1 + prismic-reactjs: ^1.3.4 + query-string: 7.1.1 + react: ^17.0.2 + react-accessible-accordion: ^5.0.0 + react-burger-menu: ^3.0.8 + react-calendly: ^4.0.1 + react-dom: ^17.0.2 + react-form: 4.0.1 + react-ga: 3.3.1 + react-modal: ^3.15.1 + react-share: latest + react-social-icons: latest + react-tabs: ^3.1.0 + react-toastify: latest + regenerator-runtime: ^0.13.9 + semantic-release: ^19.0.3 + styled-normalize: ^8.0.7 + tabletop: 1.6.3 + typescript: ^4.7.4 + webp-loader: 0.6.0 + wrangler: ^3.0.1 + languageName: unknown + linkType: soft + "@devlaunchers/utility@workspace:*, @devlaunchers/utility@workspace:^, @devlaunchers/utility@workspace:packages/utility": version: 0.0.0-use.local resolution: "@devlaunchers/utility@workspace:packages/utility" @@ -3320,10 +3377,10 @@ __metadata: languageName: node linkType: hard -"@eslint/js@npm:8.37.0": - version: 8.37.0 - resolution: "@eslint/js@npm:8.37.0" - checksum: 7a07fb085c94ce1538949012c292fd3a6cd734f149bc03af6157dfbd8a7477678899ef57b4a27e15b36470a997389ad79a0533d5880c71e67720ae1a7de7c62d +"@eslint/js@npm:8.38.0": + version: 8.38.0 + resolution: "@eslint/js@npm:8.38.0" + checksum: 1f28987aa8c9cd93e23384e16c7220863b39b5dc4b66e46d7cdbccce868040f455a98d24cd8b567a884f26545a0555b761f7328d4a00c051e7ef689cbea5fce1 languageName: node linkType: hard @@ -4230,71 +4287,6 @@ __metadata: languageName: node linkType: hard -"@motionone/animation@npm:^10.12.0": - version: 10.15.1 - resolution: "@motionone/animation@npm:10.15.1" - dependencies: - "@motionone/easing": ^10.15.1 - "@motionone/types": ^10.15.1 - "@motionone/utils": ^10.15.1 - tslib: ^2.3.1 - checksum: 75b7a1e6c47c27073a578eb5559ea0a6e7075862c72e1eb1598403c8c2725f596a95b0369514c9e72f3c7439a9845c468b85a14d4e500df48e09d01b0739d4a7 - languageName: node - linkType: hard - -"@motionone/dom@npm:10.12.0": - version: 10.12.0 - resolution: "@motionone/dom@npm:10.12.0" - dependencies: - "@motionone/animation": ^10.12.0 - "@motionone/generators": ^10.12.0 - "@motionone/types": ^10.12.0 - "@motionone/utils": ^10.12.0 - hey-listen: ^1.0.8 - tslib: ^2.3.1 - checksum: 123356f28e44362c4f081aae3df22e576f46bfcb07e01257b2ac64a115668448f29b8de67e4b6e692c5407cffb78ffe7cf9fa1bc064007482bab5dd23a69d380 - languageName: node - linkType: hard - -"@motionone/easing@npm:^10.15.1": - version: 10.15.1 - resolution: "@motionone/easing@npm:10.15.1" - dependencies: - "@motionone/utils": ^10.15.1 - tslib: ^2.3.1 - checksum: cf7cfcf9917525d892334c58282425aafc69d9ab9004c190bfa7cf91317a680e8143f227adc79557424e7f26cdf8478dcbb2ae467e744cebc58195d6f0b8153a - languageName: node - linkType: hard - -"@motionone/generators@npm:^10.12.0": - version: 10.15.1 - resolution: "@motionone/generators@npm:10.15.1" - dependencies: - "@motionone/types": ^10.15.1 - "@motionone/utils": ^10.15.1 - tslib: ^2.3.1 - checksum: 0eb6797a64d536bb5c26628343d6594a2ebc45c3c447b8ce442b4ac3a41be847b860ac009bda7968fc7d339d2ee49b18bfe36306c5dd99cf17c7d84c82de93f3 - languageName: node - linkType: hard - -"@motionone/types@npm:^10.12.0, @motionone/types@npm:^10.15.1": - version: 10.15.1 - resolution: "@motionone/types@npm:10.15.1" - checksum: 98091f7dca257508d94d1080678c433da39a814e8e58aaa742212bf6c2a5b5e2120a6251a06e3ea522219ce6d1b6eb6aa2cab224b803fe52789033d8398ef0aa - languageName: node - linkType: hard - -"@motionone/utils@npm:^10.12.0, @motionone/utils@npm:^10.15.1": - version: 10.15.1 - resolution: "@motionone/utils@npm:10.15.1" - dependencies: - "@motionone/types": ^10.15.1 - hey-listen: ^1.0.8 - tslib: ^2.3.1 - checksum: 6ef13cd6637ec87c340e5536f849f8c40d30cc90139a3856d11cd70d78e3740f8815b0e63564fefd23c05a060da7a0ea5395390549606ed8801a7b832b74e04e - languageName: node - linkType: hard - "@mrmlnc/readdir-enhanced@npm:^2.2.1": version: 2.2.1 resolution: "@mrmlnc/readdir-enhanced@npm:2.2.1" @@ -11608,9 +11600,9 @@ __metadata: linkType: hard "caniuse-lite@npm:^1.0.0, caniuse-lite@npm:^1.0.30000981, caniuse-lite@npm:^1.0.30001109, caniuse-lite@npm:^1.0.30001125, caniuse-lite@npm:^1.0.30001332, caniuse-lite@npm:^1.0.30001406, caniuse-lite@npm:^1.0.30001449, caniuse-lite@npm:^1.0.30001464": - version: 1.0.30001474 - resolution: "caniuse-lite@npm:1.0.30001474" - checksum: c05faab958fae1bbf3c595203c96d3a2f6b4c7a0d122069addc6c386f208b4db66eed3f5e3d606b80e3b384603d353b27a306f6dcb6145642b5b97a330dba86a + version: 1.0.30001477 + resolution: "caniuse-lite@npm:1.0.30001477" + checksum: 22db0feccf43b0c16a46bb59b4e26ae05011f41c6947f1dd176d5056e0db58c3415a5ff7ee5a60903a6bda7311b71705d1d29fc4c43a8b8a1bdeef8c1d93f6a8 languageName: node linkType: hard @@ -14654,9 +14646,9 @@ __metadata: linkType: hard "electron-to-chromium@npm:^1.3.564, electron-to-chromium@npm:^1.4.284": - version: 1.4.355 - resolution: "electron-to-chromium@npm:1.4.355" - checksum: b3fb9df3364d6e677df0a9ae9f470fae494131d85cbba57c3d58e0619208a8b4954aea834a0c6163d63248bc86f36bb0dc7b93508b8c1ae1f2d4eb9fe6fe2c00 + version: 1.4.356 + resolution: "electron-to-chromium@npm:1.4.356" + checksum: 5a61003c574f5fb6d32dcfc0ae2220a45a6a395ccadd9495c8227e9c33f36ea97cb34aa925c2b039d17dfea5a8040825026db2df01a352d2d1c0037f53dbeebb languageName: node linkType: hard @@ -15964,13 +15956,13 @@ __metadata: linkType: hard "eslint@npm:^8.21.0, eslint@npm:^8.3.0": - version: 8.37.0 - resolution: "eslint@npm:8.37.0" + version: 8.38.0 + resolution: "eslint@npm:8.38.0" dependencies: "@eslint-community/eslint-utils": ^4.2.0 "@eslint-community/regexpp": ^4.4.0 "@eslint/eslintrc": ^2.0.2 - "@eslint/js": 8.37.0 + "@eslint/js": 8.38.0 "@humanwhocodes/config-array": ^0.11.8 "@humanwhocodes/module-importer": ^1.0.1 "@nodelib/fs.walk": ^1.2.8 @@ -16009,7 +16001,7 @@ __metadata: text-table: ^0.2.0 bin: eslint: bin/eslint.js - checksum: 80f3d5cdce2d671f4794e392d234a78d039c347673defb0596268bd481e8f30a53d93c01ff4f66a546c87d97ab4122c0e9cafe1371f87cb03cee6b7d5aa97595 + checksum: 73b6d9b650d0434aa7c07d0a1802f099b086ee70a8d8ba7be730439a26572a5eb71def12125c82942be2ec8ee5be38a6f1b42a13e40d4b67f11a148ec9e263eb languageName: node linkType: hard @@ -17237,24 +17229,23 @@ __metadata: languageName: node linkType: hard -"framer-motion@npm:6.5.1": - version: 6.5.1 - resolution: "framer-motion@npm:6.5.1" +"framer-motion@npm:6.2.4": + version: 6.2.4 + resolution: "framer-motion@npm:6.2.4" dependencies: "@emotion/is-prop-valid": ^0.8.2 - "@motionone/dom": 10.12.0 framesync: 6.0.1 hey-listen: ^1.0.8 popmotion: 11.0.3 style-value-types: 5.0.0 tslib: ^2.1.0 peerDependencies: - react: ">=16.8 || ^17.0.0 || ^18.0.0" - react-dom: ">=16.8 || ^17.0.0 || ^18.0.0" + react: ">=16.8 || ^17.0.0" + react-dom: ">=16.8 || ^17.0.0" dependenciesMeta: "@emotion/is-prop-valid": optional: true - checksum: 737959063137b4ccafe01e0ac0c9e5a9531bf3f729f62c34ca7a5d7955e6664f70affd22b044f7db51df41acb21d120a4f71a860e17a80c4db766ad66f2153a1 + checksum: 71b2fefba015812bfbb9041a5a7aebabb0181a58f33467a45c91746d25db50dd2dcb79e5d90c7d329acb45cab259e8cb503d8a0b5406f4615dfca739c91edd25 languageName: node linkType: hard @@ -22558,8 +22549,8 @@ __metadata: linkType: hard "lint-staged@npm:^13.0.3": - version: 13.2.0 - resolution: "lint-staged@npm:13.2.0" + version: 13.2.1 + resolution: "lint-staged@npm:13.2.1" dependencies: chalk: 5.2.0 cli-truncate: ^3.1.0 @@ -22576,7 +22567,7 @@ __metadata: yaml: ^2.2.1 bin: lint-staged: bin/lint-staged.js - checksum: dcaa8fbbde567eb8ac27230a18b3a22f30c278c524c0e27cf7d4110d662d5d33ed68a585a2e1b05075ef1c262e853f557a5ae046188b723603246d63e6b9f07b + checksum: 5788d3fe38e69b7f7b7f700284d4e10738978a0916bc77d3f6253c43a030fc4f01f89c09da349fb658f929f3393d8b1e3eaabaac5b604416ebc33476640b51ce languageName: node linkType: hard @@ -25588,9 +25579,9 @@ __metadata: linkType: hard "nwsapi@npm:^2.2.0": - version: 2.2.2 - resolution: "nwsapi@npm:2.2.2" - checksum: 43769106292bc95f776756ca2f3513dab7b4d506a97c67baec32406447841a35f65f29c1f95ab5d42785210fd41668beed33ca16fa058780be43b101ad73e205 + version: 2.2.3 + resolution: "nwsapi@npm:2.2.3" + checksum: d5fcbb36a3a87770285c1e7b8213e033b4bbbc1050391dc28eed94f86ccab10539afadf8ce85de80c790535737915fb0ab53e2944166caad5b6f5e3a51ad24ff languageName: node linkType: hard @@ -31632,9 +31623,9 @@ __metadata: linkType: hard "shell-quote@npm:^1.6.1, shell-quote@npm:^1.7.3": - version: 1.8.0 - resolution: "shell-quote@npm:1.8.0" - checksum: 6ef7c5e308b9c77eedded882653a132214fa98b4a1512bb507588cf6cd2fc78bfee73e945d0c3211af028a1eabe09c6a19b96edd8977dc149810797e93809749 + version: 1.8.1 + resolution: "shell-quote@npm:1.8.1" + checksum: 5f01201f4ef504d4c6a9d0d283fa17075f6770bfbe4c5850b074974c68062f37929ca61700d95ad2ac8822e14e8c4b990ca0e6e9272e64befd74ce5e19f0736b languageName: node linkType: hard @@ -33032,9 +33023,10 @@ __metadata: linkType: hard "sucrase@npm:^3.29.0": - version: 3.31.0 - resolution: "sucrase@npm:3.31.0" + version: 3.32.0 + resolution: "sucrase@npm:3.32.0" dependencies: + "@jridgewell/gen-mapping": ^0.3.2 commander: ^4.0.0 glob: 7.1.6 lines-and-columns: ^1.1.6 @@ -33044,7 +33036,7 @@ __metadata: bin: sucrase: bin/sucrase sucrase-node: bin/sucrase-node - checksum: 333990b1bca57acc010ae07c763dddfd34f01fd38afe9e53cf43f4a5096bd7a66f924fed65770288fba475f914f3aa5277cc4490ed9e74c50b4cea7f147e9e63 + checksum: 79f760aef513adcf22b882d43100296a8afa7f307acef3e8803304b763484cf138a3e2cebc498a6791110ab20c7b8deba097f6ce82f812ca8f1723e3440e5c95 languageName: node linkType: hard @@ -33994,7 +33986,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^2, tslib@npm:^2.0.0, tslib@npm:^2.0.1, tslib@npm:^2.0.3, tslib@npm:^2.1.0, tslib@npm:^2.3.1, tslib@npm:^2.4.0, tslib@npm:^2.5.0": +"tslib@npm:^2, tslib@npm:^2.0.0, tslib@npm:^2.0.1, tslib@npm:^2.0.3, tslib@npm:^2.1.0, tslib@npm:^2.4.0, tslib@npm:^2.5.0": version: 2.5.0 resolution: "tslib@npm:2.5.0" checksum: ae3ed5f9ce29932d049908ebfdf21b3a003a85653a9a140d614da6b767a93ef94f460e52c3d787f0e4f383546981713f165037dc2274df212ea9f8a4541004e1 @@ -34216,12 +34208,12 @@ __metadata: linkType: hard "typescript@npm:^4.6.4 || ^5.0.0": - version: 5.0.3 - resolution: "typescript@npm:5.0.3" + version: 5.0.4 + resolution: "typescript@npm:5.0.4" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 3cce0576d218cb4277ff8b6adfef1a706e9114a98b4261a38ad658a7642f1b274a8396394f6cbff8c0ba852996d7ed2e233e9b8431d5d55ac7c2f6fea645af02 + checksum: 82b94da3f4604a8946da585f7d6c3025fff8410779e5bde2855ab130d05e4fd08938b9e593b6ebed165bda6ad9292b230984f10952cf82f0a0ca07bbeaa08172 languageName: node linkType: hard @@ -34246,12 +34238,12 @@ __metadata: linkType: hard "typescript@patch:typescript@^4.6.4 || ^5.0.0#~builtin": - version: 5.0.3 - resolution: "typescript@patch:typescript@npm%3A5.0.3#~builtin::version=5.0.3&hash=bda367" + version: 5.0.4 + resolution: "typescript@patch:typescript@npm%3A5.0.4#~builtin::version=5.0.4&hash=bda367" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 9ec0a8eed38d46cc2c8794555b7674e413604c56c159f71b8ff21ce7f17334a44127a68724cb2ef8221ff3b19369f8f05654e8a5266621d7d962aeed889bd630 + checksum: 6a1fe9a77bb9c5176ead919cc4a1499ee63e46b4e05bf667079f11bf3a8f7887f135aa72460a4c3b016e6e6bb65a822cb8689a6d86cbfe92d22cc9f501f09213 languageName: node linkType: hard