Skip to content

Commit

Permalink
Work done
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgeny Talagaev committed Sep 25, 2023
1 parent 8332896 commit 5758263
Show file tree
Hide file tree
Showing 77 changed files with 1,314 additions and 763 deletions.
10 changes: 9 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
"no-console": 0,
"import/extensions": 0,
"quotes": 0,
"semi": 0
"semi": 0,
"no-underscore-dangle": 0,
"no-tabs": 0,
"lines-between-class-members": 0,
"class-methods-use-this": 0,
"no-undef": 0,
"no-param-reassign": 0,
"import/prefer-default-export": 0,
"import/no-extraneous-dependencies": 0
}
}
3 changes: 2 additions & 1 deletion .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"extends": "stylelint-config-standard-scss"
"extends": "stylelint-config-standard-scss",
"ignoreFiles": ["build/*", "node_modules/*", "static/*"]
}
68 changes: 0 additions & 68 deletions _proxyProps.js

This file was deleted.

21 changes: 16 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"devDependencies": {
"@types/express": "^4.17.17",
"@types/pug": "^2.0.6",
"@types/uuid": "^9.0.4",
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@typescript-eslint/parser": "^6.7.0",
"concurrently": "^8.2.1",
Expand All @@ -25,10 +26,10 @@
"sass": "^1.66.1",
"stylelint": "^15.10.3",
"stylelint-config-standard-scss": "^11.0.0",
"uuid": "^9.0.1",
"vite": "^4.4.5"
},
"dependencies": {
"pug": "^3.0.2"
"pug": "^3.0.2",
"uuid": "^9.0.1"
}
}
15 changes: 15 additions & 0 deletions src/404/404.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { render } from "../utils/index";
import { ErrorPage } from "../pages/index";

import "../scss/index.scss";

const props = {
title: '404',
text: 'who seeks will always find',
linkText: 'go to chats page',
linkHref: '/chats-and-chat/',
}

const page = new ErrorPage(props);

render(page);
12 changes: 12 additions & 0 deletions src/404/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html class="page" lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>404 page</title>
</head>
<body>
<main id="app"></main>
<script src="404.ts" type="module"></script>
</body>
</html>
15 changes: 15 additions & 0 deletions src/500/500.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { render } from "../utils/index";
import { ErrorPage } from "../pages/index";

import "../scss/index.scss";

const props = {
title: '500',
text: 'something went wrong',
linkText: 'go to chats page',
linkHref: '/chats-and-chat/',
}

const page = new ErrorPage(props);

render(page);
12 changes: 12 additions & 0 deletions src/500/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html class="page" lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>500 page</title>
</head>
<body>
<main id="app"></main>
<script src="500.ts" type="module"></script>
</body>
</html>
8 changes: 8 additions & 0 deletions src/chats-and-chat/chats-and-chat.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { render } from "../utils/index";
import { ChatsAndChat } from "../pages/index";

import "../scss/index.scss";

const page = new ChatsAndChat();

render(page);
12 changes: 12 additions & 0 deletions src/chats-and-chat/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html class="page" lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Chats and chat page</title>
</head>
<body>
<main id="app"></main>
<script src="chats-and-chat.ts" type="module"></script>
</body>
</html>
7 changes: 7 additions & 0 deletions src/components/AuthorizationForm/AuthorizationForm.tmp.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
form.form
if (title)
h1.form__title= title
.form__field!= fieldLogin
.form__field!= fieldPassword
.form__field.form__field--accent!= sendBtn
.form__field.t-right!= link
20 changes: 20 additions & 0 deletions src/components/AuthorizationForm/AuthorizationForm.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Block } from "../../core/index";
import template from "./AuthorizationForm.tmp.pug";
import { getValuesFromForm } from "../utils/index";

export default class AuthorizationForm extends Block {
constructor(props?: object) {
const newProps = {
...props,
events: new Map([
['submit', (event: object) => getValuesFromForm(event, this)],
]),
}

super('div', newProps);
}

render() {
return this.compile(template, this.props);
}
}
2 changes: 1 addition & 1 deletion src/components/Button/Button.tmp.pug
Original file line number Diff line number Diff line change
@@ -1 +1 @@
button.btn text
button(class=className, type=type, form=form)= text
6 changes: 4 additions & 2 deletions src/components/Button/Button.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { Block } from "../../core/index";
import template from "./Button.tmp.pug";

import "./Button.scss";

export default class Button extends Block {
constructor(props) {
super('button', props);
constructor(props?: object) {
super('div', props);
}

render() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
form#userSettingsForm.user-settings__form
ul.user-settings__list
li.user-settings__list-item!= currentPassword
li.user-settings__list-item!= newPassword
li.user-settings__list-item!= repeatNewPassword
20 changes: 20 additions & 0 deletions src/components/EditingPasswordForm/EditingPasswordForm.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Block } from "../../core/index";
import template from "./EditingPasswordForm.tmp.pug";
import { getValuesFromForm } from "../utils/index";

export default class EditingPasswordForm extends Block {
constructor(props?: object) {
const newProps = {
...props,
events: new Map([
['submit', (event: object) => getValuesFromForm(event, this)],
]),
}

super('div', newProps);
}

render() {
return this.compile(template, this.props);
}
}
25 changes: 25 additions & 0 deletions src/components/EditingSettingsForm/EditingSettingsForm.tmp.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
form#userSettingsForm.user-settings__form
ul.user-settings__list
li.user-settings__list-item!= nickname
li.user-settings__list-item!= firstName
li.user-settings__list-item!= secondName
li.user-settings__list-item!= email
li.user-settings__list-item!= phone

//ul.user-settings__list
li.user-settings__list-item
label.user-settings__list-item-name(for="display_name") Nickname:
input.user-settings__list-item-value.t-right(id="display_name" type="text" name="display_name" value="user name")
li.user-settings__list-item
label.user-settings__list-item-name(for="first_name") First name:
input.user-settings__list-item-value.t-right(id="first_name" type="text" name="first_name" value="first name")
li.user-settings__list-item
label.user-settings__list-item-name(for="second_name") Second name:
input.user-settings__list-item-value.t-right(id="second_name" type="text" name="second_name" value="second name")
li.user-settings__list-item
label.user-settings__list-item-name(for="email") Email:
input.user-settings__list-item-value.t-right(id="email" type="text" name="email" value="[email protected]")
li.user-settings__list-item
label.user-settings__list-item-name(for="phone") Phone:
input.user-settings__list-item-value.t-right(id="phone" type="text" name="phone" value="+7 (000) 000-00-00")
//input(type="file", name="avatar", hidden)
20 changes: 20 additions & 0 deletions src/components/EditingSettingsForm/EditingSettingsForm.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Block } from "../../core/index";
import template from "./EditingSettingsForm.tmp.pug";
import { getValuesFromForm } from "../utils/index";

export default class EditingSettingsForm extends Block {
constructor(props?: object) {
const newProps = {
...props,
events: new Map([
['submit', (event: object) => getValuesFromForm(event, this)],
]),
}

super('div', newProps);
}

render() {
return this.compile(template, this.props);
}
}
Loading

0 comments on commit 5758263

Please sign in to comment.