-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] import component from lodestar-app-element
- Loading branch information
FT
committed
Jun 28, 2021
1 parent
18a5222
commit 0cdc499
Showing
11 changed files
with
306 additions
and
117 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
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,25 @@ | ||
import Accordion from 'lodestar-app-element/src/components/Accordion' | ||
import React from 'react' | ||
import { SectionTitle, StyledSection } from '../../pages/AppPage' | ||
|
||
const AccordionSection: React.FC<{ | ||
options: { | ||
title?: string | ||
infos?: { | ||
title: string | ||
description: string | ||
}[] | ||
} | ||
}> = ({ options: { title, infos = [] } }) => { | ||
return ( | ||
<StyledSection> | ||
<div className="container"> | ||
<SectionTitle>{title}</SectionTitle> | ||
|
||
<Accordion list={infos} /> | ||
</div> | ||
</StyledSection> | ||
) | ||
} | ||
|
||
export default AccordionSection |
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,74 @@ | ||
import BackgroundSection from 'lodestar-app-element/src/components/BackgroundSection' | ||
import Button from 'lodestar-app-element/src/components/Button' | ||
import HeadingSnippet from 'lodestar-app-element/src/components/HeadingSnippet' | ||
import React from 'react' | ||
import { Link } from 'react-router-dom' | ||
import styled, { css } from 'styled-components' | ||
|
||
const StyledContainer = styled.div<{ row: boolean }>` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
${props => | ||
props.row && | ||
css` | ||
@media (min-width: 768px) { | ||
flex-direction: row; | ||
justify-content: space-between; | ||
} | ||
`} | ||
` | ||
|
||
const StyledDescription = styled.p<{ row: boolean }>` | ||
font-family: NotoSansCJKtc; | ||
font-size: 16px; | ||
font-weight: 500; | ||
line-height: 1.38; | ||
color: #ffffff; | ||
margin-top: 24px; | ||
text-align: center; | ||
${props => | ||
props.row && | ||
css` | ||
@media (min-width: 768px) { | ||
text-align: left; | ||
} | ||
`} | ||
` | ||
|
||
const CTASection: React.FC<{ | ||
options: { | ||
mode?: 'light' | 'dark' | ||
direction?: 'row' | 'column' | ||
title?: string | ||
description?: string | ||
link?: { | ||
text: string | ||
path: string | ||
} | ||
backgroundUrl?: string | ||
} | ||
}> = ({ options: { mode, direction, title, description, link, backgroundUrl = null } }) => { | ||
return ( | ||
<BackgroundSection background={backgroundUrl || ''} mode={mode}> | ||
<StyledContainer className="container" row={direction === 'row'}> | ||
<HeadingSnippet direction={direction || 'row'}> | ||
{title && <HeadingSnippet.Title row={direction === 'row'}>{title}</HeadingSnippet.Title>} | ||
{description && <StyledDescription row={direction === 'row'}>{description}</StyledDescription>} | ||
</HeadingSnippet> | ||
|
||
<div> | ||
{link && ( | ||
<Link to={link.path}> | ||
<Button>{link.text}</Button> | ||
</Link> | ||
)} | ||
</div> | ||
</StyledContainer> | ||
</BackgroundSection> | ||
) | ||
} | ||
|
||
export default CTASection |
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,52 @@ | ||
import Article from 'lodestar-app-element/src/components/Article' | ||
import React from 'react' | ||
import styled from 'styled-components' | ||
import { StyledSection } from '../../pages/AppPage' | ||
|
||
const StyledTitle = styled(Article.Title)` | ||
font-family: NotoSansCJKtc; | ||
font-size: 24px; | ||
font-weight: bold; | ||
letter-spacing: 0.2px; | ||
color: var(--gray-darker); | ||
` | ||
|
||
const StyledContent = styled(Article.Content)` | ||
font-family: NotoSansCJKtc; | ||
font-size: 16px; | ||
font-weight: 500; | ||
line-height: 1.69; | ||
letter-spacing: 0.2px; | ||
text-align: justify; | ||
color: var(--gray-darker); | ||
` | ||
|
||
const DescriptionSection: React.FC<{ | ||
options: { | ||
infos?: { | ||
title: string | ||
description: string | ||
}[] | ||
imgSrc: string | ||
} | ||
}> = ({ options: { infos, imgSrc } }) => { | ||
return ( | ||
<StyledSection> | ||
<div className="container"> | ||
<div className="row"> | ||
<div className="col-12 col-md-7"> | ||
{infos?.map(v => ( | ||
<Article className="my-5"> | ||
<StyledTitle className="mb-4">{v.title}</StyledTitle> | ||
<StyledContent>{v.description}</StyledContent> | ||
</Article> | ||
))} | ||
</div> | ||
<img className="col-12 col-md-5 m-auto" src={imgSrc} alt="feature" /> | ||
</div> | ||
</div> | ||
</StyledSection> | ||
) | ||
} | ||
|
||
export default DescriptionSection |
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,53 @@ | ||
import Article from 'lodestar-app-element/src/components/Article' | ||
import React from 'react' | ||
import styled from 'styled-components' | ||
import { SectionTitle, StyledSection } from '../../pages/AppPage' | ||
|
||
const StyledContainer = styled.div` | ||
margin: 0 auto; | ||
padding: 0 20px; | ||
@media (min-width: 768px) { | ||
max-width: 768px; | ||
} | ||
` | ||
|
||
const StyledBlock = styled.div` | ||
column-count: 1; | ||
@media (min-width: 768px) { | ||
column-count: 2; | ||
column-gap: 2rem; | ||
} | ||
` | ||
|
||
const FAQSection: React.FC<{ | ||
options: { | ||
title?: string | ||
infos?: { | ||
title: string | ||
description: string | ||
}[] | ||
} | ||
}> = ({ options: { title, infos = [] } }) => { | ||
return ( | ||
<StyledSection> | ||
<StyledContainer> | ||
<SectionTitle>{title}</SectionTitle> | ||
|
||
<StyledBlock> | ||
{infos?.map(v => ( | ||
<Article className="mb-4"> | ||
<Article.Title highlight className="mb-3"> | ||
{v.title} | ||
</Article.Title> | ||
<Article.Content>{v.description}</Article.Content> | ||
</Article> | ||
))} | ||
</StyledBlock> | ||
</StyledContainer> | ||
</StyledSection> | ||
) | ||
} | ||
|
||
export default FAQSection |
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,46 @@ | ||
import BackgroundSection from 'lodestar-app-element/src/components/BackgroundSection' | ||
import Card from 'lodestar-app-element/src/components/Card' | ||
import React from 'react' | ||
import styled from 'styled-components' | ||
import { SectionTitle } from '../../pages/AppPage' | ||
|
||
const StyledImage = styled.img` | ||
width: 40px; | ||
height: auto; | ||
` | ||
|
||
const FeatureDescriptionSection: React.FC<{ | ||
options: { | ||
backgroundUrl?: string | ||
title?: string | ||
infos?: { | ||
iconSrc: string | ||
title: string | ||
description: string | ||
}[] | ||
} | ||
}> = ({ options: { backgroundUrl, title, infos = [] } }) => { | ||
return ( | ||
<BackgroundSection background={backgroundUrl || ''} mode={!!backgroundUrl ? 'dark' : undefined}> | ||
<div className="container"> | ||
<SectionTitle>{title}</SectionTitle> | ||
|
||
<div className="row justify-content-center"> | ||
{infos.map(v => ( | ||
<div className="col-12 col-md-4 mb-3"> | ||
<Card isDark={!!backgroundUrl} direction="column" bordered shadow> | ||
<StyledImage src={v.iconSrc} className="mb-3" alt="icon" /> | ||
<Card.Title isDark={!!backgroundUrl} className="mb-3"> | ||
{v.title} | ||
</Card.Title> | ||
<Card.Content>{v.description}</Card.Content> | ||
</Card> | ||
</div> | ||
))} | ||
</div> | ||
</div> | ||
</BackgroundSection> | ||
) | ||
} | ||
|
||
export default FeatureDescriptionSection |
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
Oops, something went wrong.