Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,258 changes: 933 additions & 325 deletions package-lock.json

Large diffs are not rendered by default.

19 changes: 14 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@
"not op_mini all"
],
"dependencies": {
"@types/classnames": "2.2.6",
"@types/jest": "24.0.15",
"@types/node": "12.0.10",
"@types/react": "16.8.22",
"@types/react-dom": "16.8.4",
"@types/react-window": "1.8.0",
"classnames": "2.2.6",
"csstype": "2.6.5",
"node-sass": "4.12.0",
"react": "16.8.6",
"react-dom": "16.8.6"
},
Expand All @@ -27,12 +36,12 @@
"test": "react-scripts test",
"build": "react-scripts build",
"lint": "npm-run-all lint:*",
"lint:js": "eslint '**/*.{js,jsx}'",
"lint:css": "stylelint '**/*.css'",
"lint:js": "eslint \"**/*.{js,jsx}\"",
"lint:css": "stylelint \"**/*.css\"",
"lint-fix": "npm-run-all lint-fix:*",
"lint-fix:js": "eslint --fix '**/*.{js,jsx}'",
"lint-fix:css": "stylelint --fix '**/*.css'",
"format": "prettier --write '**/*.{js,jsx,css,json,md}'",
"lint-fix:js": "eslint --fix \"**/*.{js,jsx}\"",
"lint-fix:css": "stylelint --fix \"**/*.css\"",
"format": "prettier --write \"**/*.{js,jsx,css,json,md}\"",
"now-build": "npm run build"
}
}
70 changes: 70 additions & 0 deletions src/app/actions/actions.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
.actions {
display: inline-block;
box-sizing: border-box;
margin-top: 13px;
vertical-align: top;
}

.actions > ul {
display: inline-block;
padding-inline-start: 22px;
}

#actions__button-write {
width: 147px;
height: 32px;
box-sizing: border-box;
border-width: 0;
background-color: #6287bd;
border-radius: 3px;
color: white;
font-family: 'HelveticaNeue', serif;
font-size: 12px;
font-stretch: normal;
font-style: normal;
font-weight: 500;
letter-spacing: normal;
line-height: normal;
vertical-align: top;
}

.actions__button-write_night {
background-color: rgb(53, 39, 39) !important;
color: rgb(241, 212, 212) !important;
}

.actions__msgs-income {
margin-top: 8px;
font-weight: bold;
}

.actions__acts {
color: #707070;
font-family: 'HelveticaNeue', serif;
font-size: 11px;
font-stretch: normal;
font-style: normal;
font-weight: 500;
letter-spacing: normal;
line-height: normal;
}

.actions__not-writing {
overflow: hidden;
width: 147px;
min-height: 22px;
box-sizing: border-box;
padding-top: 4px;
padding-left: 10px;
border: 0;
color: #707070;
text-overflow: ellipsis;
}

.actions__not-writing:hover {
background-color: #cdd6e4;
}

.actions__not-writing_night:hover {
background-color: rgb(66, 41, 41);
}
92 changes: 92 additions & 0 deletions src/app/actions/actions.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import React, { Component } from 'react';
import classNames from 'classnames';
import { ThemeContext, Theme } from '../theme-context';

import styles from './actions.module.css';


interface IActionsProps {
addLetter: () => void;
}

export class Actions extends Component<IActionsProps> {
constructor(props: IActionsProps) {
super(props);
this.addLetter = this.addLetter.bind(this);
}

addLetter() {
this.props.addLetter();
}

render() {
let theme = this.context;
let fl = false;
if (theme === Theme.night) {
fl = true;
}
return (
<div className={classNames(styles.actions, fl ? styles.night : '')}>
<ul>
<li>
<input
type="button"
id={styles['actions__button-write']}
className={fl ? styles['actions__button-write_night'] : ''}
onClick={this.addLetter}
name="write"
value="Написать"
/>
</li>
<a href="." className={styles.actions__acts}>
<li
className={classNames(
styles['actions__not-writing'],
styles['actions__msgs-income'],
fl ? styles['actions__not-writing_night'] : '')}
>
Входящие
</li>
</a>
<a href="." className={styles.actions__acts}>
<li
className={classNames(
styles['actions__not-writing'],
fl ? styles['actions__not-writing_night'] : '')}
>Отправленные</li>
</a>
<a href="." className={styles.actions__acts}>
<li
className={classNames(
styles['actions__not-writing'],
fl ? styles['actions__not-writing_night'] : '')}
>Удалённые</li>
</a>
<a href="." className={styles.actions__acts}>
<li
className={classNames(
styles['actions__not-writing'],
fl ? styles['actions__not-writing_night'] : '')}
>Спам</li>
</a>
<a href="." className={styles.actions__acts}>
<li
className={classNames(
styles['actions__not-writing'],
fl ? styles['actions__not-writing_night'] : '')}
>Черновики</li>
</a>
<a href="." className={styles.actions__acts}>
<li
className={classNames(
styles['actions__not-writing'],
fl ? styles['actions__not-writing_night'] : '')}
>Создать папку</li>
</a>
</ul>
</div>
);
}
}

Actions.contextType = ThemeContext;
27 changes: 0 additions & 27 deletions src/app/app.css

This file was deleted.

2 changes: 1 addition & 1 deletion src/app/app.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from 'react';

import './app.css';
// import './app.css';

export class App extends Component {
render() {
Expand Down
19 changes: 19 additions & 0 deletions src/app/app.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@import url(./fonts/fonts.module.css);
@import url(./css/animation.module.css);
@import url(./css/common-styles.module.css);

body {
min-width: 800px;
margin: 0;
font-family: Arial, Helvetica, sans-serif;
}

.light {
height: 101vh;
background-color: #e5eaf0;
}

.night {
height: 101vh;
background-color: #222;
}
58 changes: 58 additions & 0 deletions src/app/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import React, { Component } from 'react';
import classNames from 'classnames';

import { Header } from './header/header';
import { Window } from './window/window';
import { Theme, ThemeProvider } from './theme-context'

import app from './app.module.css';

interface IAppState {
theme: Theme,
toFilterText: string
}

export class App extends Component<{}, IAppState> {

constructor(props: IAppState) {
super(props);
this.state = {
theme: Theme.light,
toFilterText: ''
}
this.changeMode = this.changeMode.bind(this);
this.changeToFilterText = this.changeToFilterText.bind(this);
}

changeMode() {
this.setState(state => ({
theme:
state.theme === Theme.night
? Theme.light
: Theme.night
}));
}

changeToFilterText(toFilterText: string) {
this.setState(() => ({
toFilterText: toFilterText
}))
}

render() {
let fl = false;
if (this.state.theme === Theme.night) {
fl = true;
}
return (
<ThemeProvider value={this.state.theme}>
<div className={classNames(fl ? app['night'] : app['light'])}>
<header className="app-header">
<Header changeMode={this.changeMode} changeToFilterText={this.changeToFilterText} />
<Window toFilterText={this.state.toFilterText}/>
</header>
</div>
</ThemeProvider>
);
}
}
60 changes: 60 additions & 0 deletions src/app/can-do/can-do.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
.can-do {
position: relative;
width: 100%;
box-sizing: border-box;
padding-bottom: 7px;
margin-top: 8px;
margin-bottom: 0;
border-bottom: solid 1px #e2e2e2;
font-size: 13px;
outline: none;
padding-inline-start: 17px;
}

.night {
border-bottom: solid 1px #222;
}

.can-do__links {
color: #ccc;
cursor: pointer;
}

#can-do__highlight {
width: 16px;
height: 16px;
border: solid 1px rgba(0, 0, 0, 0.15);
border-radius: 3px;
}

.can-do__resend {
display: inline-block;
margin-top: 3px;
margin-left: 23px;
font-family: 'HelveticaNeue', serif;
vertical-align: top;
}

.can-do__delete {
display: inline-block;
margin-top: 3px;
margin-left: 29px;
font-family: 'HelveticaNeue', serif;
vertical-align: top;
}

.can-do__make-spam {
display: inline-block;
margin-top: 3px;
margin-left: 27px;
font-family: 'HelveticaNeue', serif;
vertical-align: top;
}

.can-do__read-msgs {
display: inline-block;
margin-top: 3px;
margin-left: 28px;
font-family: 'HelveticaNeue', serif;
vertical-align: top;
}
Loading