-
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.
feat: relocate TitleBlock component from web
- Loading branch information
1 parent
3a5760b
commit 292676b
Showing
3 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
src/components/atoms/TitleBlock/TitleBlock.styles.module.scss
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,30 @@ | ||
@import 'src/scss/mixins'; | ||
|
||
.heading { | ||
width: 100%; | ||
height: 70px; | ||
display: flex; | ||
flex-wrap: wrap; | ||
|
||
@include desktop { | ||
margin-top: 80px; | ||
} | ||
|
||
@include devices { | ||
margin-top: 20px; | ||
} | ||
} | ||
|
||
.text { | ||
font-family: $font-lato; | ||
font-size: 48px; | ||
font-style: normal; | ||
font-weight: 700; | ||
line-height: 58px; | ||
letter-spacing: 0; | ||
text-align: left; | ||
} | ||
|
||
.text-color { | ||
color: $color-base; | ||
} |
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,40 @@ | ||
import React from 'react' | ||
|
||
import cx from 'classnames' | ||
|
||
import css from './TitleBlock.styles.module.scss' | ||
|
||
export type TitleBlockProps = { | ||
simpleText?: string | ||
highlightText?: string | ||
className?: string | ||
simpleClassName?: string | ||
highlightClassName?: string | ||
} | ||
|
||
export const TitleBlock = ({ | ||
simpleText, | ||
highlightText, | ||
className, | ||
simpleClassName, | ||
highlightClassName | ||
}: TitleBlockProps) => { | ||
if (!simpleText && !highlightText) { | ||
return null | ||
} | ||
|
||
const getSimpleText = () => { | ||
if (simpleText) { | ||
return <>{simpleText} </> | ||
} | ||
|
||
return simpleText | ||
} | ||
|
||
return ( | ||
<div className={cx(css.heading, className)}> | ||
{simpleText && <span className={cx(css.text, simpleClassName)}>{getSimpleText()}</span>} | ||
{highlightText && <span className={cx(css.text, css.textColor, highlightClassName)}>{highlightText}</span>} | ||
</div> | ||
) | ||
} |
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 * from './TitleBlock' |