diff --git a/__tests__/app/components/__snapshots__/EditPassword.test.tsx.snap b/__tests__/app/components/__snapshots__/EditPassword.test.tsx.snap index 46f96c97..c6cfc5c5 100644 --- a/__tests__/app/components/__snapshots__/EditPassword.test.tsx.snap +++ b/__tests__/app/components/__snapshots__/EditPassword.test.tsx.snap @@ -168,163 +168,165 @@ exports[`EditPassword Component Should render 1`] = ` } } > -
-
+
+ User Credentials +
+
- User Credentials -
-
+
- +
- -
- Password should have minimum 5 characters. -
+ Password should have minimum 5 characters.
+
+
+
- +
- -
- Password should have minimum 5 characters. -
+ Password should have minimum 5 characters.
+
+
+
- +
- -
- Passwords should match. -
+ Passwords should match.
+
+
-
- -
+ Save Changes +
- -
+
+
- - +
+
+ `; diff --git a/server/app.js b/server/app.js new file mode 100644 index 00000000..491b7669 --- /dev/null +++ b/server/app.js @@ -0,0 +1,12 @@ +const express = require('express'); +const path = require('path'); +const app = express(); + +app.use(express.static(path.join(__dirname, '..', 'build'))); + +app.get('/*', (req, res) => { + res.sendFile(path.join(__dirname, '..', 'build', 'index.html')); +}); + +app.listen(5000); +console.log('Server is listening on http://localhost:5000'); \ No newline at end of file diff --git a/server/package.json b/server/package.json new file mode 100644 index 00000000..a027524d --- /dev/null +++ b/server/package.json @@ -0,0 +1,14 @@ +{ + "name": "codecharacter-web", + "version": "1.0.0", + "description": "Simple webserver to run prod version of Codecharacter", + "main": "app.js", + "scripts": { + "start": "node app.js" + }, + "author": "Delta", + "license": "ISC", + "dependencies": { + "express": "^4.17.1" + } +} diff --git a/src/app/components/Authentication/Login.tsx b/src/app/components/Authentication/Login.tsx index 9873af1b..818807c0 100644 --- a/src/app/components/Authentication/Login.tsx +++ b/src/app/components/Authentication/Login.tsx @@ -90,7 +90,8 @@ export class Login extends React.Component -
+
+
+
diff --git a/src/app/components/Authentication/Register.tsx b/src/app/components/Authentication/Register.tsx index 342ab405..7a3e2cb0 100644 --- a/src/app/components/Authentication/Register.tsx +++ b/src/app/components/Authentication/Register.tsx @@ -125,94 +125,319 @@ export class Register extends React.Component Register to CodeCharacter!

Register now and code your way through!!

-
-
- {currentStep === RegisterInterfaces.Steps.USER_DETAILS && ( -
- -
-
Full Name
+
+
+
+ + {currentStep === RegisterInterfaces.Steps.USER_DETAILS && ( +
+ +
+
Full Name
+
+ + this.setState({ + fullName: e.target.value, + }) + } + required + /> +
+ Name must have minimum 5 characters. +
+
+
Username
+
+ { + checkUsernameExists(e.target.value); + this.setState({ + username: e.target.value, + }); + }} + required + /> +
+ Enter a valid username. It should have a minimum of 5 characters and must + be alphanumeric +
+
+
Email
+
+ { + const registerForm = this.registerFormRef.current; + if (registerForm && registerForm.checkValidity()) { + checkEmailExists(e.target.value); + } + this.setState({ + email: e.target.value, + }); + }} + required + /> +
+ Please enter a valid Email ID. +
+
+ +
+ {errorMessage} +
+
+ +
+ )} + {currentStep === RegisterInterfaces.Steps.CREDENTIALS && ( +
+
+
Password
this.setState({ - fullName: e.target.value, + password: e.target.value, }) } required />
- Name must have minimum 5 characters. + Password should have minimum 5 characters.
-
Username
+
Confirm Password
{ - checkUsernameExists(e.target.value); + pattern=".{5,}" + value={repeatPassword} + onChange={(e) => this.setState({ - username: e.target.value, - }); - }} + repeatPassword: e.target.value, + }) + } required /> -
- Enter a valid username. It should have a minimum of 5 characters and must be - alphanumeric +
+ +
+
+ Password and confirm passwords have different values
-
Email
-
- { - const registerForm = this.registerFormRef.current; - if (registerForm && registerForm.checkValidity()) { - checkEmailExists(e.target.value); + +
+ )} + {currentStep === RegisterInterfaces.Steps.OTHERS && ( +
+
+
+ Are you a student ?{' '} + + + this.setState({ + isStudent: !isStudent, + userType: + userType === UserType.STUDENT + ? UserType.PROFESSIONAL + : UserType.STUDENT, + }) } - this.setState({ - email: e.target.value, - }); - }} - required + /> + + +
+ {isStudent && ( +
+
College Name
+
+ + this.setState({ + collegeName: e.target.value, + }) + } + required + /> +
+ College Name should have minimum 5 characters. +
+
+
+ )} +
Your country
+
+ +
- Please enter a valid Email ID. + Please Select a country +
+
+
+
+ Choose your spirit animal +
+
+
+ {avatars.map((avatar: string, index: number) => ( +
{ + this.setState({ + avatar, + }); + }} + title={avatar} + > + { + + } +
+ ))} +
+
+
+
+
+
+ +
+
+
+ Please fill recaptcha.
-
{errorMessage}
-
- -
- )} - {currentStep === RegisterInterfaces.Steps.CREDENTIALS && ( -
-
-
Password
-
- - this.setState({ - password: e.target.value, - }) - } - required - /> -
- Password should have minimum 5 characters. -
-
-
Confirm Password
-
- - this.setState({ - repeatPassword: e.target.value, - }) - } - required - /> -
- -
-
- Password and confirm passwords have different values -
-
-
-
- )} - {currentStep === RegisterInterfaces.Steps.OTHERS && ( -
-
-
- Are you a student ?{' '} - - - this.setState({ - isStudent: !isStudent, - userType: - userType === UserType.STUDENT - ? UserType.PROFESSIONAL - : UserType.STUDENT, - }) - } - /> - - -
- {isStudent && ( -
-
College Name
-
- - this.setState({ - collegeName: e.target.value, - }) - } - required - /> -
- College Name should have minimum 5 characters. -
-
-
- )} -
Your country
-
- - -
- Please Select a country -
-
-
-
- Choose your spirit animal -
-
-
- {avatars.map((avatar: string, index: number) => ( -
{ - this.setState({ - avatar, - }); - }} - title={avatar} - > - { - - } -
- ))} -
-
-
-
-
-
- -
-
- Please fill recaptcha. +
-
-
- {errorMessage} -
-
- -
-
-
- )} - + +
+ )} + +
+
-
{ - if (currentStep !== RegisterInterfaces.Steps.USER_DETAILS) { - this.handleStepChange(currentStep, currentStep - 1); - } - }} - > - -
-
    -
+
+
- this.handleStepChange(currentStep, RegisterInterfaces.Steps.USER_DETAILS) - } - > - {' '} -

User Details

- -
  • - this.handleStepChange(currentStep, RegisterInterfaces.Steps.CREDENTIALS) + ? classnames(authStyles['left-arrow-disable']) + : classnames(authStyles['left-arrow']) } + onClick={() => { + if (currentStep !== RegisterInterfaces.Steps.USER_DETAILS) { + this.handleStepChange(currentStep, currentStep - 1); + } + }} > -

    Credentials

    -
  • -
  • +
  • +
      +
    • + this.handleStepChange(currentStep, RegisterInterfaces.Steps.USER_DETAILS) + } + > + {' '} +

      User Details

      +
    • +
    • + this.handleStepChange(currentStep, RegisterInterfaces.Steps.CREDENTIALS) + } + > +

      Credentials

      +
    • +
    • this.handleStepChange(currentStep, RegisterInterfaces.Steps.OTHERS)} + > +

      Other Details

      +
    • +
    +
    this.handleStepChange(currentStep, RegisterInterfaces.Steps.OTHERS)} + onClick={() => { + if (currentStep !== RegisterInterfaces.Steps.OTHERS) { + this.handleStepChange(currentStep, currentStep + 1); + } + }} > -

    Other Details

    - - -
    { - if (currentStep !== RegisterInterfaces.Steps.OTHERS) { - this.handleStepChange(currentStep, currentStep + 1); - } - }} - > - + +
    +
    diff --git a/src/app/components/Renderer.tsx b/src/app/components/Renderer.tsx index 63e03bad..c77bfc66 100644 --- a/src/app/components/Renderer.tsx +++ b/src/app/components/Renderer.tsx @@ -50,7 +50,7 @@ export default class Renderer extends React.Component
    - -
    -
    - User Credentials -
    -
    -
    -
    -
    - -
    - onInputChange(InputName.oldPassword, e.target.value)} - required - /> -
    - Password should have minimum 5 characters. -
    + +
    +
    +
    + User Credentials +
    + +
    +
    +
    + +
    + onInputChange(InputName.oldPassword, e.target.value)} + required + /> +
    + Password should have minimum 5 characters.
    -
    -
    -
    - -
    - onInputChange(InputName.password, e.target.value)} - required - /> -
    - Password should have minimum 5 characters. -
    +
    +
    +
    +
    + +
    + onInputChange(InputName.password, e.target.value)} + required + /> +
    + Password should have minimum 5 characters.
    -
    -
    -
    - -
    - onInputChange(InputName.repeatPassword, e.target.value)} - required - /> -
    - Passwords should match. -
    +
    +
    +
    +
    + +
    + onInputChange(InputName.repeatPassword, e.target.value)} + required + /> +
    + Passwords should match.
    -
    -
    - -
    +
    +
    +
    +
    - -
    - -
    +
    + +
    +
    + ); } } diff --git a/src/app/components/UserProfileModal/EditProfile.tsx b/src/app/components/UserProfileModal/EditProfile.tsx index 74585495..1d0a1b99 100755 --- a/src/app/components/UserProfileModal/EditProfile.tsx +++ b/src/app/components/UserProfileModal/EditProfile.tsx @@ -23,8 +23,9 @@ export class EditProfile extends React.Component -
    +
    +
    +
    User Details
    @@ -166,6 +167,7 @@ export class EditProfile extends React.Component
    +
    ); } diff --git a/src/app/components/UserProfileModal/index.tsx b/src/app/components/UserProfileModal/index.tsx index 102d7257..8e5914c3 100755 --- a/src/app/components/UserProfileModal/index.tsx +++ b/src/app/components/UserProfileModal/index.tsx @@ -53,51 +53,47 @@ export class UserProfileModal extends React.Component< return ( - - {this.state.isPasswordPage ? ( - - ) : ( - - )} - + {this.state.isPasswordPage ? ( + + ) : ( + + )} - { - this.setState((prevState) => ({ - isPasswordPage: !prevState.isPasswordPage, - })); - }} - > - {this.state.isPasswordPage ? 'Want to change Credentials?' : 'Want to change Info?'} - +
    + +
    {this.state.isPasswordPage ? ( diff --git a/src/app/components/home/Navbar.tsx b/src/app/components/home/Navbar.tsx index 49aa520e..71e1f937 100644 --- a/src/app/components/home/Navbar.tsx +++ b/src/app/components/home/Navbar.tsx @@ -36,7 +36,10 @@ export const NavBar = (props: { isLoggedIn: boolean; page: NavPage }) => { Dashboard{' '} {props.page !== NavPage.PROFILE ? ( - Profile + + {' '} + Profile{' '} + ) : null} ) : ( diff --git a/src/app/styles/Authentication.module.css b/src/app/styles/Authentication.module.css index 37c00f98..d73a2a0e 100755 --- a/src/app/styles/Authentication.module.css +++ b/src/app/styles/Authentication.module.css @@ -1,6 +1,6 @@ .Authentication { - width: 100vw; - height: 100vh; + width: 100%; + height: 100%; position: fixed; display: flex; align-items: center; @@ -16,6 +16,10 @@ text-align: center; } +.registerRoot > * { + margin: 0; +} + .Authentication .customBtn:focus, .buttonPanel:focus { outline: none; @@ -125,7 +129,7 @@ } .stage-form { - width: 390px; + width: 100%; } .avatar-img { @@ -157,11 +161,6 @@ background-color: darkgrey; } -.loginForm { - margin: auto !important; - width: 390px !important; -} - .login-error { background-color: #fee5d4; padding: 9px; @@ -253,7 +252,6 @@ } .left-arrow { position: relative; - left: 35%; border-radius: 50%; color: #4630eb; font-size: 30px; @@ -262,7 +260,6 @@ } .left-arrow-disable { position: relative; - left: 35%; border-radius: 50%; color: grey; font-size: 30px; @@ -271,7 +268,6 @@ .right-arrow { position: relative; - right: 35%; bottom: 5px; border-radius: 50%; color: #4630eb; @@ -280,7 +276,6 @@ } .right-arrow-disable { position: relative; - right: 35%; bottom: 5px; border-radius: 50%; color: grey; @@ -331,6 +326,7 @@ } .stage-div { + width: 100%; margin: auto; display: block; } @@ -411,9 +407,6 @@ } .multi-steps { - display: table; - table-layout: fixed; - width: 25%; margin: auto; cursor: pointer; font-family: 'Karla', sans-serif; @@ -421,6 +414,7 @@ } .multi-steps > li { counter-increment: stepNum; + padding: 0px 10px; text-align: center; display: table-cell; position: relative; diff --git a/src/app/styles/Dashboard.css b/src/app/styles/Dashboard.css index 81df2133..01a38884 100755 --- a/src/app/styles/Dashboard.css +++ b/src/app/styles/Dashboard.css @@ -1,6 +1,6 @@ .Resizer.horizontal { background: #000; - opacity: 0.2; + opacity: 0.7; width: 2px; z-index: 1; -moz-box-sizing: border-box; @@ -26,7 +26,7 @@ .Resizer.vertical { background: #000; - opacity: 0.2; + opacity: 0.7; width: 2px; z-index: 1; -moz-box-sizing: border-box; @@ -48,3 +48,27 @@ border-left: 5px solid rgba(0, 0, 0, 0.5); border-right: 5px solid rgba(0, 0, 0, 0.5); } + +.ace_scrollbar { + transition: opacity 0.3s ease-in-out; + opacity: 0; +} +.ace_editor:hover .ace_scrollbar { + opacity: 1; +} +.ace_scrollbar-v { + width: 7px !important; +} + +.ace_scrollbar-h { + height: 7px !important; +} + +::-webkit-scrollbar { + background-color: rgba(255, 255, 255, 0.1); + color: black; +} + +::-webkit-scrollbar-thumb { + background-color: rgba(0, 0, 0, 0.3); +} diff --git a/src/app/styles/FaqElement.module.css b/src/app/styles/FaqElement.module.css index f3ec60a8..3ff9fb66 100644 --- a/src/app/styles/FaqElement.module.css +++ b/src/app/styles/FaqElement.module.css @@ -61,9 +61,9 @@ .faq-heading { display: flex; + flex-wrap: nowrap; margin: 0; margin-bottom: 0; - width: 90%; position: relative; } .heading-text { @@ -71,8 +71,8 @@ align-self: center; font-size: 18px; font-family: Karla !important; - margin: 0 !important; - text-align: center; + margin: 0px 10px; + text-align: left; } .cont { diff --git a/src/app/styles/LandingPage.module.css b/src/app/styles/LandingPage.module.css index bfb67f3f..500155a2 100644 --- a/src/app/styles/LandingPage.module.css +++ b/src/app/styles/LandingPage.module.css @@ -15,6 +15,7 @@ .landing-heading h1 { font-size: 8rem; + font-size: min(8rem, 16vw); font-family: 'Under'; } @@ -24,7 +25,6 @@ } .nav { - height: 65px; width: 100%; background-color: white; position: relative; @@ -78,7 +78,6 @@ opacity: 0.5; } .landing-heading { - width: 100vw !important; text-align: center !important; justify-content: center !important; padding-left: 0 !important; @@ -199,7 +198,8 @@ .about-container { margin-top: 40px; - margin-left: 50px; + margin-left: 40px; + margin-left: min(40px, 5vw); font-family: 'Axiforma'; } diff --git a/src/app/styles/UserProfileModal.module.css b/src/app/styles/UserProfileModal.module.css index a318cb77..97a673bb 100755 --- a/src/app/styles/UserProfileModal.module.css +++ b/src/app/styles/UserProfileModal.module.css @@ -1,5 +1,4 @@ .UserProfileModal { - width: 100vw; height: 100vh; position: fixed; display: flex; @@ -118,14 +117,10 @@ .passwordForm { padding: 10px 25px; - width: 100%; - margin-left: 5%; } .profileForm { padding: 10px 25px; - width: 85%; - margin-left: 12%; } .formHeading { @@ -199,14 +194,6 @@ background-color: #ddd; } -.editProfileElement { - overflow-x: hidden; - padding-left: 10px; - padding-right: 10px; - margin-left: 30%; - margin-top: 2%; -} - .editPasswordElement { overflow-x: hidden; padding-left: 10px; @@ -240,12 +227,7 @@ width: 100%; } -.loginPageLink { - cursor: pointer; - margin-left: 38%; -} - +.loginPageLink, .passwordPageLink { cursor: pointer; - margin-left: 37%; } diff --git a/src/assets/index.html b/src/assets/index.html index 85f102e6..fc280e7d 100644 --- a/src/assets/index.html +++ b/src/assets/index.html @@ -10,7 +10,7 @@ rel="stylesheet" />