-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'connect-more' into button-component-CSS
- Loading branch information
Showing
21 changed files
with
268 additions
and
23 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 Button from '~/components/Button' | ||
import ListTable from '~/components/Table' | ||
import {ArrowRight} from '~/components/icons-generated' | ||
import useToC from '~/hooks/useToC' | ||
import type {TOCItem} from '~/routes/questions.toc' | ||
import type {Question} from '~/server-utils/stampy' | ||
import './keepGoing.css' | ||
|
||
const NextArticle = ({category, next}: {category?: string; next?: TOCItem}) => | ||
next && ( | ||
<> | ||
<h2>Keep going! 👉</h2> | ||
<span>Continue with the next article in {category}</span> | ||
<div className="keepGoing-next"> | ||
<span className="keepGoing-next-title">{next.title}</span> | ||
<Button action={`/${next.pageid}`} className="primary-alt"> | ||
Next | ||
<ArrowRight /> | ||
</Button> | ||
</div> | ||
</> | ||
) | ||
|
||
export const KeepGoing = ({pageid, relatedQuestions}: Question) => { | ||
const {findSection, getNext} = useToC() | ||
const {category} = findSection(pageid) || {} | ||
const next = getNext(pageid) | ||
const hasRelated = relatedQuestions && relatedQuestions.length > 0 | ||
|
||
return ( | ||
<div className="keepGoing"> | ||
<NextArticle category={category} next={next} /> | ||
|
||
{next && hasRelated && <span>Or jump to a related question</span>} | ||
{hasRelated && <ListTable elements={relatedQuestions.map((i) => ({...i, hasIcon: true}))} />} | ||
</div> | ||
) | ||
} | ||
|
||
export default KeepGoing |
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 @@ | ||
.keepGoing-next { | ||
width: calc(99% - 32px); | ||
position: relative; | ||
border-radius: 6px; | ||
background-color: var(--colors-teal-600); | ||
display: flex; | ||
justify-content: space-between; | ||
padding: 32px; | ||
margin-bottom: 56px; | ||
} | ||
.keepGoing span { | ||
font-size: 18px; | ||
} | ||
.keepGoing-next-title { | ||
position: relative; | ||
font-size: 18px; | ||
letter-spacing: -0.01em; | ||
line-height: 170%; | ||
font-weight: 600; | ||
font-family: Poppins; | ||
color: #fff; | ||
color: #fff; | ||
text-align: left; | ||
display: inline-block; | ||
} |
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
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
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,9 @@ | ||
import type {SVGProps} from 'react' | ||
const SvgArrowUpRight = (props: SVGProps<SVGSVGElement>) => ( | ||
<svg xmlns="http://www.w3.org/2000/svg" width={16} height={16} fill="none" {...props}> | ||
<g stroke="#1D9089" strokeLinecap="round" strokeLinejoin="round"> | ||
<path d="M8 2.5h5.5V8M13 3 2.5 13.5" /> | ||
</g> | ||
</svg> | ||
) | ||
export default SvgArrowUpRight |
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
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
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
Oops, something went wrong.