1
0
mirror of synced 2025-12-22 03:16:52 -05:00

fix lint errors

This commit is contained in:
Grace Park
2021-06-10 14:32:36 -07:00
parent 2d289bdabc
commit d635ee5cf4
5 changed files with 25 additions and 23 deletions

View File

@@ -26,21 +26,8 @@ export const Breadcrumbs = () => {
<span key={title} title={title}> <span key={title} title={title}>
{breadcrumb.title} {breadcrumb.title}
</span> </span>
) : pathWithLocale.includes('/guides') ? ( ) : pathWithLocale.includes('/guides') ? (
<span className='text-mono color-text-secondary text-uppercase'> <span className="text-mono color-text-secondary text-uppercase">
<Link
key={title}
href={breadcrumb.href}
title={title}
className={cx(
'd-inline-block',
pathWithLocale === breadcrumb.href && 'color-text-tertiary'
)}
>
{breadcrumb.title}
</Link>
</span>
) : (
<Link <Link
key={title} key={title}
href={breadcrumb.href} href={breadcrumb.href}
@@ -52,7 +39,20 @@ export const Breadcrumbs = () => {
> >
{breadcrumb.title} {breadcrumb.title}
</Link> </Link>
) </span>
) : (
<Link
key={title}
href={breadcrumb.href}
title={title}
className={cx(
'd-inline-block',
pathWithLocale === breadcrumb.href && 'color-text-tertiary'
)}
>
{breadcrumb.title}
</Link>
)
})} })}
</nav> </nav>
) )

View File

@@ -1,6 +1,5 @@
import { createContext, useContext } from 'react' import { createContext, useContext } from 'react'
import pick from 'lodash/pick' import pick from 'lodash/pick'
import _ from 'lodash'
export type FeaturedTrack = { export type FeaturedTrack = {
trackName: string trackName: string

View File

@@ -29,7 +29,11 @@ export const CodeExampleCard = ({ example }: Props) => {
</div> </div>
<footer className="border-top p-4 color-text-secondary d-flex flex-items-center"> <footer className="border-top p-4 color-text-secondary d-flex flex-items-center">
<RepoIcon className="flex-shrink-0" /> <RepoIcon className="flex-shrink-0" />
<TruncateLines as="span" maxLines={1} className="ml-2 text-mono text-small color-text-link line-break-anywhere"> <TruncateLines
as="span"
maxLines={1}
className="ml-2 text-mono text-small color-text-link line-break-anywhere"
>
{example.href} {example.href}
</TruncateLines> </TruncateLines>
</footer> </footer>

View File

@@ -14,7 +14,7 @@ export const LandingSection = ({ title, children, className, sectionLink, descri
return ( return (
<div className={cx('container-xl px-3 px-md-6', className)} id={sectionLink}> <div className={cx('container-xl px-3 px-md-6', className)} id={sectionLink}>
{title && ( {title && (
<h2 className={cx('font-mktg', !!description ? 'mb-3' : 'mb-4')}> <h2 className={cx('font-mktg', !description ? 'mb-3' : 'mb-4')}>
{sectionLink ? <a href={`#${sectionLink}`}>{title}</a> : title} {sectionLink ? <a href={`#${sectionLink}`}>{title}</a> : title}
</h2> </h2>
)} )}

View File

@@ -9,7 +9,6 @@ type Props = {
const MAX_VISIBLE_GUIDES = 4 const MAX_VISIBLE_GUIDES = 4
export const LearningTrack = ({ track }: Props) => { export const LearningTrack = ({ track }: Props) => {
// const guides = track?.guides
const [visibleGuides, setVisibleGuides] = useState(track.guides?.slice(0, 4)) const [visibleGuides, setVisibleGuides] = useState(track.guides?.slice(0, 4))
const showAll = () => { const showAll = () => {
setVisibleGuides(track.guides) setVisibleGuides(track.guides)
@@ -57,8 +56,8 @@ export const LearningTrack = ({ track }: Props) => {
{t('guide_types')[guide.page.type]} {t('guide_types')[guide.page.type]}
</div> </div>
</a> </a>
{track.guides && track.guides?.indexOf(guide) + 1 == MAX_VISIBLE_GUIDES ? ( {track.guides && track.guides?.indexOf(guide) + 1 === MAX_VISIBLE_GUIDES ? (
<a <button
className="Box-footer btn-link border-top-0 position-relative text-center text-bold color-text-link pt-1 pb-3 col-12 js-show-more-button" className="Box-footer btn-link border-top-0 position-relative text-center text-bold color-text-link pt-1 pb-3 col-12 js-show-more-button"
onClick={showAll} onClick={showAll}
> >
@@ -69,7 +68,7 @@ export const LearningTrack = ({ track }: Props) => {
<span> <span>
Show {track.guides?.length - MAX_VISIBLE_GUIDES} {t(`more_guides`)} Show {track.guides?.length - MAX_VISIBLE_GUIDES} {t(`more_guides`)}
</span> </span>
</a> </button>
) : ( ) : (
<div /> <div />
)} )}