Skip to content

Commit 292676b

Browse files
Uzhastin-Nikitathe-homeless-god
authored andcommitted
feat: relocate TitleBlock component from web
1 parent 3a5760b commit 292676b

File tree

3 files changed

+71
-0
lines changed

3 files changed

+71
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
@import 'src/scss/mixins';
2+
3+
.heading {
4+
width: 100%;
5+
height: 70px;
6+
display: flex;
7+
flex-wrap: wrap;
8+
9+
@include desktop {
10+
margin-top: 80px;
11+
}
12+
13+
@include devices {
14+
margin-top: 20px;
15+
}
16+
}
17+
18+
.text {
19+
font-family: $font-lato;
20+
font-size: 48px;
21+
font-style: normal;
22+
font-weight: 700;
23+
line-height: 58px;
24+
letter-spacing: 0;
25+
text-align: left;
26+
}
27+
28+
.text-color {
29+
color: $color-base;
30+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import React from 'react'
2+
3+
import cx from 'classnames'
4+
5+
import css from './TitleBlock.styles.module.scss'
6+
7+
export type TitleBlockProps = {
8+
simpleText?: string
9+
highlightText?: string
10+
className?: string
11+
simpleClassName?: string
12+
highlightClassName?: string
13+
}
14+
15+
export const TitleBlock = ({
16+
simpleText,
17+
highlightText,
18+
className,
19+
simpleClassName,
20+
highlightClassName
21+
}: TitleBlockProps) => {
22+
if (!simpleText && !highlightText) {
23+
return null
24+
}
25+
26+
const getSimpleText = () => {
27+
if (simpleText) {
28+
return <>{simpleText}&nbsp;</>
29+
}
30+
31+
return simpleText
32+
}
33+
34+
return (
35+
<div className={cx(css.heading, className)}>
36+
{simpleText && <span className={cx(css.text, simpleClassName)}>{getSimpleText()}</span>}
37+
{highlightText && <span className={cx(css.text, css.textColor, highlightClassName)}>{highlightText}</span>}
38+
</div>
39+
)
40+
}
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './TitleBlock'

0 commit comments

Comments
 (0)