= ({ children, align, className, margin, size, color }) => {
return (
@@ -33,6 +36,8 @@ Description.defaultProps = {
className: "",
align: AlignType.left,
margin: MarginType.none,
+ size:ISize.s,
+ color: "black",
};
export { Description };
diff --git a/src/ui/Description/style.scss b/src/ui/Description/style.scss
index 1c171d6..55f50df 100644
--- a/src/ui/Description/style.scss
+++ b/src/ui/Description/style.scss
@@ -4,4 +4,6 @@
@include main-font(500);
@include base-aligns();
@include base-margins();
+ @include base-font-sizes();
+ @include base-colors();
}
diff --git a/src/ui/Icon/index.tsx b/src/ui/Icon/index.tsx
new file mode 100644
index 0000000..b09819b
--- /dev/null
+++ b/src/ui/Icon/index.tsx
@@ -0,0 +1,26 @@
+import * as React from 'react';
+import { ISizeIcon } from "../enums";
+import MaterialIcon, {colorPalette} from 'material-icons-react';
+import { Color } from "csstype";
+
+export interface IIcon {
+ icon?: string;
+ color: Color;
+ size: ISizeIcon;
+ disabled?: boolean;
+}
+
+const Icon: React.FC = ({ icon, size, color, disabled }) => {
+ return (
+
+ );
+};
+
+Icon.defaultProps = {
+ size: ISizeIcon.s,
+ disabled: false,
+ icon: 'dashboard',
+ color: 'black',
+};
+
+export { Icon };
\ No newline at end of file
diff --git a/src/ui/Title/style.scss b/src/ui/Title/style.scss
index edb8c34..61bdcff 100644
--- a/src/ui/Title/style.scss
+++ b/src/ui/Title/style.scss
@@ -2,30 +2,10 @@
@include base-aligns();
@include base-margins();
@include base-weight();
+ @include base-font-sizes();
+ @include base-colors();
color: $black;
&__uppercase {
text-transform: uppercase;
}
- &__size {
- &_l {
- font-size: 48px;
- }
- &_m {
- font-size: 36px;
- }
- &_s {
- font-size: 18px;
- }
- }
- &__color {
- &_white {
- color: $white;
- }
- &_orange {
- color: $orange;
- }
- &_black {
- color: $black;
- }
- }
}
diff --git a/src/ui/enums.ts b/src/ui/enums.ts
index 2d102c5..68ef33c 100644
--- a/src/ui/enums.ts
+++ b/src/ui/enums.ts
@@ -17,6 +17,14 @@ export enum MarginType {
bottom_x2 = "bottom_x2"
}
+export enum PaddingType {
+ none = "none",
+ s = "5",
+ m = "10",
+ l = "15",
+ xl = "20",
+}
+
export enum FillType {
void = "void",
fill = "fill"
@@ -26,7 +34,17 @@ export enum ISize {
s = "s",
m = "m",
l = "l",
- full = "full"
+ xl = "xl",
+ xxl = "xxl",
+ full = "full",
+ auto = "auto",
+}
+
+export enum ISizeIcon {
+ s = 'tiny',
+ m = 'small',
+ l = 'medium',
+ xl = 'large',
}
export enum WeightEnum {
@@ -39,5 +57,7 @@ export type ButtonType = "submit" | "reset" | "button";
export enum Colors {
"white",
- "orange"
+ "orange",
+ "blue",
+ "black",
}
diff --git a/src/widgets/Auth/index.tsx b/src/widgets/Auth/index.tsx
index 58d36b0..d9f67aa 100644
--- a/src/widgets/Auth/index.tsx
+++ b/src/widgets/Auth/index.tsx
@@ -4,7 +4,6 @@ import { Input } from "widgets/fields";
import { Column } from "ui/Layout";
import { Button } from "ui/Button";
import { Title } from "ui/Title";
-import { Description } from "ui/Description";
import { getValidationForField } from "./validations";
import {default as config} from "./config.json";
diff --git a/src/widgets/Header/config.js b/src/widgets/Header/config.js
new file mode 100644
index 0000000..0c41341
--- /dev/null
+++ b/src/widgets/Header/config.js
@@ -0,0 +1,18 @@
+export default [
+ {
+ name: 'bookmark',
+ icon: 'star',
+ },
+ {
+ name: 'extension',
+ icon: 'extension',
+ },
+ {
+ name: 'add',
+ icon: 'add_circle',
+ },
+ {
+ name: 'notifications',
+ icon: 'notifications',
+ },
+];
diff --git a/src/widgets/Header/index.tsx b/src/widgets/Header/index.tsx
index cacc340..4583165 100644
--- a/src/widgets/Header/index.tsx
+++ b/src/widgets/Header/index.tsx
@@ -1,29 +1,81 @@
import * as React from "react";
+import cx from 'classnames';
import { Title } from "ui/Title";
-import { Row } from "ui/Layout";
+import { Button } from "ui/Button";
+import { Icon } from "ui/Icon";
+import { Row, Column } from "ui/Layout";
+import { Profile } from 'widgets/Profile';
import { Link } from "react-router-dom";
+import {ISize, ISizeIcon, PaddingType, MarginType } from "ui/enums";
import "statics/logo.svg";
import { default as logo } from "statics/logo.svg";
-import "./style.scss";
import * as style from "./style.scss";
+import config from './config';
// tslint:disable-next-line:no-empty-interface
export interface IHeader {
+ authorized?: boolean;
+}
+
+function renderLogo(title) {
+ return (
+
+
+ {title}
+
+ )
+}
+function IconButton({ icon }) {
+ if(!icon) {
+ return null;
+ }
+ return (
+
+ )
}
// tslint:disable-next-line:variable-name
-const Header: React.FC = () => {
+const Header: React.FC = ({ authorized = false }) => {
+ if(!authorized) {
+ return (
+
+
+ {renderLogo('WERP')}
+
+
+ );
+ }
return (
-
-
-
-
- WERP
+
+
+
+
+
+
+ search...
+
+
+
+
+ {config.map(item => {
+ const { icon, name } = item;
+ return
+
+ })}
+
+
+
+
+
- );
+ )
};
export { Header };
diff --git a/src/widgets/Header/style.scss b/src/widgets/Header/style.scss
index 711c17c..29c8c4c 100644
--- a/src/widgets/Header/style.scss
+++ b/src/widgets/Header/style.scss
@@ -6,4 +6,28 @@
height: 34px;
margin-right: 10px;
}
+
+ &__buttons {
+ > * {
+ width: 42px;
+
+ &:last-child {
+ margin-right: 0;
+ }
+ }
+ }
+
+ &__item {
+ border-left: 1px solid $grey;
+ border-right: 1px solid $grey;
+ padding: 10px 15px;
+ width: auto;
+ &:last-child {
+ border-left: 0;
+ }
+ }
+}
+
+.search {
+ height: 42px;
}
\ No newline at end of file
diff --git a/src/widgets/Profile/helpers.tsx b/src/widgets/Profile/helpers.tsx
new file mode 100644
index 0000000..88c7723
--- /dev/null
+++ b/src/widgets/Profile/helpers.tsx
@@ -0,0 +1,4 @@
+export function getFirstLetter(str) {
+ console.log('st', str);
+ return str.charAt(0).toUpperCase();
+}
\ No newline at end of file
diff --git a/src/widgets/Profile/index.tsx b/src/widgets/Profile/index.tsx
new file mode 100644
index 0000000..4426643
--- /dev/null
+++ b/src/widgets/Profile/index.tsx
@@ -0,0 +1,34 @@
+import * as React from 'react';
+import cx from 'classnames';
+import { Row, Column } from 'ui/Layout';
+import { Description } from 'ui/Description';
+import { getFirstLetter } from './helpers';
+import { MarginType, ISize, Colors } from "ui/enums";
+import * as style from './style.scss';
+
+export interface IProfile {
+ size?: ISize;
+ firstName?: string;
+ lastName?: string;
+}
+
+const ProfileImage: React.FC = ({ firstName, lastName, size }) => {
+ const text = `${getFirstLetter(firstName)}${getFirstLetter(lastName)}`;
+ return (
+
+ {text}
+
+ )
+};
+
+const Profile: React.FC = ({ firstName = 'Ivan', lastName = 'Ivanov', size }) => {
+ const text = `${firstName} ${lastName}`;
+ return (
+
+
+ {text}
+
+ )
+};
+
+export { Profile };
\ No newline at end of file
diff --git a/src/widgets/Profile/style.scss b/src/widgets/Profile/style.scss
new file mode 100644
index 0000000..af94409
--- /dev/null
+++ b/src/widgets/Profile/style.scss
@@ -0,0 +1,9 @@
+.profile {
+ &__image {
+ width: 30px;
+ height: 30px;
+ border-radius: 50px;
+ background-color: $orange;
+ @include base-font-sizes;
+ }
+}
\ No newline at end of file
diff --git a/yarn.lock b/yarn.lock
index c261690..2abfa02 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1069,16 +1069,53 @@
"@svgr/plugin-svgo" "^4.0.3"
loader-utils "^1.1.0"
+"@types/jest-diff@*":
+ version "20.0.1"
+ resolved "https://registry.yarnpkg.com/@types/jest-diff/-/jest-diff-20.0.1.tgz#35cc15b9c4f30a18ef21852e255fdb02f6d59b89"
+ integrity sha512-yALhelO3i0hqZwhjtcr6dYyaLoCHbAMshwtj6cGxTvHZAKXHsYGdff6E8EPw3xLKY0ELUTQ69Q1rQiJENnccMA==
+
+"@types/jest@^24.0.11":
+ version "24.0.11"
+ resolved "https://registry.yarnpkg.com/@types/jest/-/jest-24.0.11.tgz#1f099bea332c228ea6505a88159bfa86a5858340"
+ integrity sha512-2kLuPC5FDnWIDvaJBzsGTBQaBbnDweznicvK7UGYzlIJP4RJR2a4A/ByLUXEyEgag6jz8eHdlWExGDtH3EYUXQ==
+ dependencies:
+ "@types/jest-diff" "*"
+
"@types/node@*":
version "11.10.5"
resolved "https://registry.yarnpkg.com/@types/node/-/node-11.10.5.tgz#fbaca34086bdc118011e1f05c47688d432f2d571"
integrity sha512-DuIRlQbX4K+d5I+GMnv+UfnGh+ist0RdlvOp+JZ7ePJ6KQONCFQv/gKYSU1ZzbVdFSUCKZOltjmpFAGGv5MdYA==
+"@types/node@^11.13.6":
+ version "11.13.6"
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-11.13.6.tgz#37ec75690830acb0d74ce3c6c43caab787081e85"
+ integrity sha512-Xoo/EBzEe8HxTSwaZNLZjaW6M6tA/+GmD3/DZ6uo8qSaolE/9Oarko0oV1fVfrLqOz0tx0nXJB4rdD5c+vixLw==
+
+"@types/prop-types@*":
+ version "15.7.1"
+ resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.1.tgz#f1a11e7babb0c3cad68100be381d1e064c68f1f6"
+ integrity sha512-CFzn9idOEpHrgdw8JsoTkaDDyRWk1jrzIV8djzcgpq0y9tG4B4lFT+Nxh52DVpDXV+n4+NPNv7M1Dj5uMp6XFg==
+
"@types/q@^1.5.1":
version "1.5.1"
resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.1.tgz#48fd98c1561fe718b61733daed46ff115b496e18"
integrity sha512-eqz8c/0kwNi/OEHQfvIuJVLTst3in0e7uTKeuY+WL/zfKn0xVujOTp42bS/vUUokhK5P2BppLd9JXMOMHcgbjA==
+"@types/react-dom@^16.8.4":
+ version "16.8.4"
+ resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.8.4.tgz#7fb7ba368857c7aa0f4e4511c4710ca2c5a12a88"
+ integrity sha512-eIRpEW73DCzPIMaNBDP5pPIpK1KXyZwNgfxiVagb5iGiz6da+9A5hslSX6GAQKdO7SayVCS/Fr2kjqprgAvkfA==
+ dependencies:
+ "@types/react" "*"
+
+"@types/react@*", "@types/react@^16.8.14":
+ version "16.8.14"
+ resolved "https://registry.yarnpkg.com/@types/react/-/react-16.8.14.tgz#b561bfabeb8f60d12e6d4766367e7a9ae927aa18"
+ integrity sha512-26tFVJ1omGmzIdFTFmnC5zhz1GTaqCjxgUxV4KzWvsybF42P7/j4RBn6UeO3KbHPXqKWZszMXMoI65xIWm954A==
+ dependencies:
+ "@types/prop-types" "*"
+ csstype "^2.2.0"
+
"@types/tapable@1.0.2":
version "1.0.2"
resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.2.tgz#e13182e1b69871a422d7863e11a4a6f5b814a4bd"
@@ -2845,6 +2882,15 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4:
safe-buffer "^5.0.1"
sha.js "^2.4.8"
+create-react-class@^15.6.0:
+ version "15.6.3"
+ resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.6.3.tgz#2d73237fb3f970ae6ebe011a9e66f46dbca80036"
+ integrity sha512-M+/3Q6E6DLO6Yx3OwrWjwHBnvfXXYA7W+dFjt/ZDBemHO1DDZhsalX/NUtnTYclN6GfnBDRh4qRHjcDHmlJBJg==
+ dependencies:
+ fbjs "^0.8.9"
+ loose-envify "^1.3.1"
+ object-assign "^4.1.1"
+
create-react-context@^0.2.2:
version "0.2.3"
resolved "https://registry.yarnpkg.com/create-react-context/-/create-react-context-0.2.3.tgz#9ec140a6914a22ef04b8b09b7771de89567cb6f3"
@@ -3113,6 +3159,11 @@ cssstyle@^1.0.0:
dependencies:
cssom "0.3.x"
+csstype@^2.2.0:
+ version "2.6.4"
+ resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.4.tgz#d585a6062096e324e7187f80e04f92bd0f00e37f"
+ integrity sha512-lAJUJP3M6HxFXbqtGRc0iZrdyeN+WzOWeY0q/VnFzI+kqVrYIzC7bWlKqCW7oCIdzoPkvfp82EVvrTlQ8zsWQg==
+
currently-unhandled@^0.4.1:
version "0.4.1"
resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea"
@@ -4119,7 +4170,7 @@ fb-watchman@^2.0.0:
dependencies:
bser "^2.0.0"
-fbjs@^0.8.0:
+fbjs@^0.8.0, fbjs@^0.8.9:
version "0.8.17"
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd"
integrity sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90=
@@ -6679,6 +6730,16 @@ matcher@^1.0.0:
dependencies:
escape-string-regexp "^1.0.4"
+material-icons-react@^1.0.4:
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/material-icons-react/-/material-icons-react-1.0.4.tgz#b8763fbe4615a8bd0f88c249ad73ad75f7841241"
+ integrity sha512-ZTCD0Nl+/hTyvONWz8N6gCrpLWfbkOF77NWbD9ThYdkBK8gtvFMc/ORS8nfU0qlmS1wNdVXf1oTaBRWLCiNkxw==
+ dependencies:
+ prop-types "^15.6.1"
+ react "^15.0.0"
+ react-dom "^15.0.0"
+ webfontloader "^1.6.28"
+
math-random@^1.0.1:
version "1.0.4"
resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.4.tgz#5dd6943c938548267016d4e34f057583080c514c"
@@ -8620,7 +8681,7 @@ prompts@^0.1.9:
kleur "^2.0.1"
sisteransi "^0.1.1"
-prop-types@^15.5.10, prop-types@^15.5.6, prop-types@^15.6.2, prop-types@^15.7.2:
+prop-types@^15.5.10, prop-types@^15.5.6, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2:
version "15.7.2"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
@@ -8844,6 +8905,16 @@ react-dev-utils@^8.0.0:
strip-ansi "5.0.0"
text-table "0.2.0"
+react-dom@^15.0.0:
+ version "15.6.2"
+ resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-15.6.2.tgz#41cfadf693b757faf2708443a1d1fd5a02bef730"
+ integrity sha1-Qc+t9pO3V/rycIRDodH9WgK+9zA=
+ dependencies:
+ fbjs "^0.8.9"
+ loose-envify "^1.1.0"
+ object-assign "^4.1.0"
+ prop-types "^15.5.10"
+
react-dom@^16.8.4:
version "16.8.4"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.8.4.tgz#1061a8e01a2b3b0c8160037441c3bf00a0e3bc48"
@@ -8879,7 +8950,7 @@ react-onclickoutside@^6.8.0:
resolved "https://registry.yarnpkg.com/react-onclickoutside/-/react-onclickoutside-6.8.0.tgz#9f91b5b3ed59f4d9e43fd71620dc200773a4d569"
integrity sha512-5Q4Rn7QLEoh7WIe66KFvYIpWJ49GeHoygP1/EtJyZjXKgrWH19Tf0Ty3lWyQzrEEDyLOwUvvmBFSE3dcDdvagA==
-react-router-dom@^4.4.0:
+react-router-dom@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-5.0.0.tgz#542a9b86af269a37f0b87218c4c25ea8dcf0c073"
integrity sha512-wSpja5g9kh5dIteZT3tUoggjnsa+TPFHSMrpHXMpFsaHhQkm/JNVGh2jiF9Dkh4+duj4MKCkwO6H08u6inZYgQ==
@@ -8915,6 +8986,17 @@ react-text-mask@^5.4.3:
dependencies:
prop-types "^15.5.6"
+react@^15.0.0:
+ version "15.6.2"
+ resolved "https://registry.yarnpkg.com/react/-/react-15.6.2.tgz#dba0434ab439cfe82f108f0f511663908179aa72"
+ integrity sha1-26BDSrQ5z+gvEI8PURZjkIF5qnI=
+ dependencies:
+ create-react-class "^15.6.0"
+ fbjs "^0.8.9"
+ loose-envify "^1.1.0"
+ object-assign "^4.1.0"
+ prop-types "^15.5.10"
+
react@^16.8.4:
version "16.8.4"
resolved "https://registry.yarnpkg.com/react/-/react-16.8.4.tgz#fdf7bd9ae53f03a9c4cd1a371432c206be1c4768"
@@ -10450,6 +10532,11 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
+typescript@^3.4.4:
+ version "3.4.4"
+ resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.4.4.tgz#aac4a08abecab8091a75f10842ffa0631818f785"
+ integrity sha512-xt5RsIRCEaf6+j9AyOBgvVuAec0i92rgCaS3S+UVf5Z/vF2Hvtsw08wtUTJqp4djwznoAgjSxeCcU4r+CcDBJA==
+
ua-parser-js@^0.7.18:
version "0.7.19"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.19.tgz#94151be4c0a7fb1d001af7022fdaca4642659e4b"
@@ -10802,6 +10889,11 @@ web-namespaces@^1.1.2:
resolved "https://registry.yarnpkg.com/web-namespaces/-/web-namespaces-1.1.2.tgz#c8dc267ab639505276bae19e129dbd6ae72b22b4"
integrity sha512-II+n2ms4mPxK+RnIxRPOw3zwF2jRscdJIUE9BfkKHm4FYEg9+biIoTMnaZF5MpemE3T+VhMLrhbyD4ilkPCSbg==
+webfontloader@^1.6.28:
+ version "1.6.28"
+ resolved "https://registry.yarnpkg.com/webfontloader/-/webfontloader-1.6.28.tgz#db786129253cb6e8eae54c2fb05f870af6675bae"
+ integrity sha1-23hhKSU8tujq5UwvsF+HCvZnW64=
+
webidl-conversions@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad"