-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:csssr-dreamteam/core-design
- Loading branch information
Showing
48 changed files
with
446 additions
and
5,136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 CSSSR Pte. Ltd. registered in Singapore under unique entity number 201909633C | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
packages/core-design/src/components/ErrorPage/ErrorPage.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import * as React from 'react' | ||
import { storiesOf } from '@storybook/react' | ||
import ErrorPage from './ErrorPage' | ||
import { PictureForAllResolutions } from '../PictureForAllResolutions' | ||
|
||
const Img = ({ className }) => { | ||
const image = { | ||
pathToImagesFolder: require.context('../../static/images/imagesForStories'), | ||
imageName: 'ultramarine', | ||
alt: 'Сержант Ультрамаринов', | ||
} | ||
|
||
return <PictureForAllResolutions className={className} image={image} /> | ||
} | ||
|
||
storiesOf('ErrorPage', module).add('ErrorPage', () => { | ||
return ( | ||
<ErrorPage | ||
title="Ошибка на сервере" | ||
subTitle="Что-то пошло не так. Попробуйте еще раз или свяжитесь с нами по почте <a href='mailto:[email protected]'>[email protected]</a>" | ||
Img={Img} | ||
/> | ||
) | ||
}) |
149 changes: 149 additions & 0 deletions
149
packages/core-design/src/components/ErrorPage/ErrorPage.styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
import { css } from '@emotion/core' | ||
|
||
const base = css` | ||
.header { | ||
padding-bottom: 4rem; | ||
} | ||
.logo { | ||
grid-column: 2 / span 2; | ||
margin-top: 5.25rem; | ||
width: 11.5rem; | ||
height: 2.875rem; | ||
color: black; | ||
} | ||
.title { | ||
margin-top: 3.875rem; | ||
grid-column: 2 / span 7; | ||
grid-row: 1; | ||
} | ||
.subtitle { | ||
grid-column: 9 / span 4; | ||
margin-top: -3.1875rem; | ||
grid-row: 2; | ||
} | ||
.link { | ||
color: #345eff; | ||
} | ||
.code-wrapper { | ||
grid-column: 2 / span 6; | ||
grid-row: 2 / span 10; | ||
margin-top: 2.5rem; | ||
width: calc(100% + 1rem); | ||
height: 25rem; | ||
} | ||
.picture { | ||
grid-column: 2 / span 7; | ||
grid-row: 2 / span 10; | ||
margin-top: 1.5rem; | ||
z-index: -1; | ||
height: 51.5rem; | ||
} | ||
@media (min-width: 1360px) and (max-width: 1919px) { | ||
.code-wrapper { | ||
margin-top: 3.5rem; | ||
width: 41.75rem; | ||
height: 18.625rem; | ||
} | ||
.picture { | ||
height: 38.5rem; | ||
} | ||
} | ||
@media (min-width: 1280px) and (max-width: 1359px) { | ||
.code-wrapper { | ||
margin-top: 2.5rem; | ||
width: 41.75rem; | ||
height: 18.625rem; | ||
} | ||
.picture { | ||
height: 35.5rem; | ||
} | ||
} | ||
@media (min-width: 768px) and (max-width: 1279px) { | ||
.title { | ||
margin-top: 5.6875rem; | ||
} | ||
.subtitle { | ||
margin-top: -2.375rem; | ||
} | ||
.code-wrapper { | ||
margin-top: 2.5rem; | ||
width: 30.5rem; | ||
height: 13.625rem; | ||
} | ||
.picture { | ||
height: 27rem; | ||
} | ||
} | ||
@media (max-width: 767px) { | ||
.header { | ||
padding-bottom: 2.875rem; | ||
} | ||
.error-code_500 .subtitle { | ||
grid-column: 1 / span 4; | ||
} | ||
.error-code_500 .code-wrapper { | ||
margin-top: 0; | ||
margin-left: 0; | ||
width: 17.875rem; | ||
height: 8.5rem; | ||
width: 18.75rem; | ||
height: 8.9375rem; | ||
} | ||
.logo { | ||
grid-column: 1 / span 3; | ||
margin-top: 3.625rem; | ||
width: 10rem; | ||
height: 2.5rem; | ||
color: black; | ||
} | ||
.title { | ||
grid-column: 1 / span 6; | ||
grid-row: 1; | ||
margin-top: 3.6875rem; | ||
} | ||
.subtitle { | ||
margin-top: 2.625rem; | ||
grid-column: 1 / span 2; | ||
grid-row: 3; | ||
} | ||
.code-wrapper { | ||
grid-column: 1 / span 5; | ||
grid-row: 2; | ||
margin-top: 3.5625rem; | ||
margin-left: 0.1875rem; | ||
width: 16.125rem; | ||
height: 7.25rem; | ||
} | ||
.picture { | ||
grid-column: 1 / span 6; | ||
grid-row: 2; | ||
height: 16.5rem; | ||
} | ||
} | ||
` | ||
|
||
export default () => css` | ||
${base} | ||
` |
39 changes: 39 additions & 0 deletions
39
packages/core-design/src/components/ErrorPage/ErrorPage.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React from 'react' | ||
import styled from '@emotion/styled' | ||
import Grid from '../Grid' | ||
import { ErrorPageProps as Props } from './types' | ||
|
||
import styles from './ErrorPage.styles' | ||
|
||
/* tslint:disable */ | ||
const LogoIcon = require('../../static/icons/csssr_logo.svg') | ||
const ServerError = require('../../static/icons/serverError.svg') | ||
/* tslint:enable */ | ||
|
||
const ErrorPage: React.FC<Props> = ({ className, title, subTitle, Img }) => { | ||
return ( | ||
<div className={className}> | ||
<Grid className="header"> | ||
<a className="logo"> | ||
<LogoIcon width="100%" height="100%" /> | ||
</a> | ||
</Grid> | ||
|
||
<Grid className="error-code_500"> | ||
<h1 className="font_h1-slab title" dangerouslySetInnerHTML={{ __html: title }} /> | ||
|
||
{Img && <Img className="picture" />} | ||
|
||
<div className="code-wrapper"> | ||
<ServerError width="100%" height="100%" /> | ||
</div> | ||
|
||
<h2 className="font_subhead-slab subtitle" dangerouslySetInnerHTML={{ __html: subTitle }} /> | ||
</Grid> | ||
</div> | ||
) | ||
} | ||
|
||
export default styled(ErrorPage)` | ||
${styles} | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from './ErrorPage' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export interface ErrorPageProps { | ||
className?: string | ||
title: string | ||
subTitle: string | ||
Img?: React.ComponentType<{ className?: string }> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file removed
BIN
-10.8 KB
packages/core-design/src/static/fonts/Roboto_Slab_normal_300_en.woff2
Binary file not shown.
Binary file removed
BIN
-7.5 KB
packages/core-design/src/static/fonts/Roboto_Slab_normal_300_ru.woff2
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-10.7 KB
packages/core-design/src/static/fonts/Roboto_Slab_normal_400_en.woff2
Binary file not shown.
Binary file removed
BIN
-7.55 KB
packages/core-design/src/static/fonts/Roboto_Slab_normal_400_ru.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.