Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Commit

Permalink
move blog component imports, rename blog list and blog resource compo…
Browse files Browse the repository at this point in the history
…nents
  • Loading branch information
zlonko committed May 10, 2022
1 parent 155864e commit 011165f
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 42 deletions.
6 changes: 1 addition & 5 deletions src/components/Blog/BlogListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,7 @@ export const BlogListItem: FunctionComponent<PostIndexItem> = ({
<Link href={`/blog/${slugPath}`} passHref={true}>
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
<a>
<img
className="w-100"
src={frontmatter.heroImage}
alt={frontmatter.title}
/>
<img className="w-100" src={frontmatter.heroImage} alt={frontmatter.title} />
</a>
</Link>
</div>
Expand Down
8 changes: 2 additions & 6 deletions src/components/Blog/PressReleaseListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const PressReleaseListItem: FunctionComponent<PostIndexItem> = ({
) : (
<p>{excerpt}</p>
)}
<div className="text-center text-sm-left">
<div className="text-center text-sm-left">
<Link href={`/press-release/${slugPath}`} passHref={true}>
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
<a className="font-weight-bold">Read more</a>
Expand All @@ -53,11 +53,7 @@ export const PressReleaseListItem: FunctionComponent<PostIndexItem> = ({
<Link href={`/press-release/${slugPath}`} passHref={true}>
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
<a>
<img
className="max-h-150"
src={frontmatter.heroImage}
alt={frontmatter.title}
/>
<img className="max-h-150" src={frontmatter.heroImage} alt={frontmatter.title} />
</a>
</Link>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Blog/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from './BlogHeader'
export * from './BlogListItem'
export * from './BlogPost'
export * from './LinkPost'
export * from './PodcastPost'
Expand All @@ -8,6 +9,5 @@ export * from './PostsListPage'
export * from './PressReleaseListItem'
export * from './PressReleasePost'
export * from './ReleasePost'
export * from './postTypes'
export * from './BlogListItem'
export * from './PodcastAudioPlayer'
export * from './postTypes'
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface Image {
alt: string
}

export const BlogListItem: FunctionComponent<Props> = ({ blog }) => (
export const BlogResourceItem: FunctionComponent<Props> = ({ blog }) => (
<div className="w-100 row mx-0 mb-5 pb-4 border-bottom">
<div className="col-sm-8 col-md-9">
<a className="posts-list__post-title-link" href={blog.href}>
Expand Down
4 changes: 2 additions & 2 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export { Install } from './Install'
export { EmbeddedHubSpot } from './HubSpot'
export { BackButton, BackButtonBold, BackButtonLight } from './BackButton'
export { FormLegal } from './FormLegal'
export { BlogListItem } from './BlogListItem'
export { BlogResourceItem } from './BlogResourceItem'
export { BlockquoteWithBorder, BlockquoteWithLogoTop, BlockquoteWithLogoBottom } from './Blockquote'
export { Video } from './Video'
export { CustomerLogosSectionAnimated } from './CustomerLogosSectionAnimated'
Expand Down Expand Up @@ -52,13 +52,13 @@ export {
InContentImage,
MediaQuote,
NewCaseStudyLayout,
ThreeUpText,
UseChallengeSolutionResults,
} from './CaseStudies'

// Blog
export {
BlogHeader,
BlogListItem,
BlogPost,
LinkPost,
PodcastPost,
Expand Down
4 changes: 2 additions & 2 deletions src/interfaces/posts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import {
LinkPost,
PodcastListItem,
PodcastPost,
PressReleaseListItem,
PressReleasePost,
ReleasePost,
} from '@components'
} from '../components/Blog'
import { PressReleaseListItem } from '../components/Blog/PressReleaseListItem'

export enum PostType {
BlogPost,
Expand Down
8 changes: 4 additions & 4 deletions src/pages/code-insights.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
} from '@code-insights/mock-data'
import { CodeInsightExampleType } from '@code-insights/types'
import {
BlogListItem,
BlogResourceItem,
ContentSection,
CustomCarousel,
Layout,
Expand Down Expand Up @@ -267,7 +267,7 @@ const templates = {
],
}

const blogListItems = [
const blogResourceItems = [
{
title: 'How we migrated entirely to CSS Modules using codemods and Sourcegraph Code Insights',
description:
Expand Down Expand Up @@ -611,8 +611,8 @@ export const CodeInsightsPage: FunctionComponent = () => (
<div className="col-lg-6">
<h1 className="mb-5 font-weight-bold">Learn more</h1>
</div>
{blogListItems.map(item => (
<BlogListItem key={item.title} blog={item} />
{blogResourceItems.map(item => (
<BlogResourceItem key={item.title} blog={item} />
))}
</div>
</ContentSection>
Expand Down
8 changes: 4 additions & 4 deletions src/pages/partner-podcast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { FunctionComponent } from 'react'

import Link from 'next/link'

import { Layout, CaseStudyCard, FormLegal, BlogListItem } from '@components'
import { Layout, CaseStudyCard, FormLegal, BlogResourceItem } from '@components'
import { useHubSpot } from '@hooks'

const resourceItems = [
const blogResourceItems = [
{
title: 'Continuous developer onboarding: A guide to cultivating a culture of professional growth',
description:
Expand Down Expand Up @@ -136,8 +136,8 @@ const PartnerPodcastPage: FunctionComponent = () => {
<div className="col-lg-6">
<h1 className="mb-5 font-weight-bold">Related resources</h1>
</div>
{resourceItems.map(item => (
<BlogListItem key={item.title} blog={item} />
{blogResourceItems.map(item => (
<BlogResourceItem key={item.title} blog={item} />
))}
</div>

Expand Down
8 changes: 4 additions & 4 deletions src/pages/use-cases/code-health.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Link from 'next/link'
import {
BackButtonBold,
BlockquoteWithBorder,
BlogListItem,
BlogResourceItem,
buttonStyle,
buttonLocation,
ContentSection,
Expand Down Expand Up @@ -159,7 +159,7 @@ const quoteCarouselItems = [
},
]

const blogListItems = [
const blogResourceItems = [
{
title: 'How not to break a search engine or: What I learned about unglamorous engineering',
description:
Expand Down Expand Up @@ -357,8 +357,8 @@ const UseCasePage: FunctionComponent = () => (
<div className="col-lg-6">
<h1 className="mb-5 font-weight-bold">Related resources</h1>
</div>
{blogListItems.map(item => (
<BlogListItem key={item.title} blog={item} />
{blogResourceItems.map(item => (
<BlogResourceItem key={item.title} blog={item} />
))}
</div>
</ContentSection>
Expand Down
8 changes: 4 additions & 4 deletions src/pages/use-cases/code-reuse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Link from 'next/link'
import {
BackButtonBold,
BlockquoteWithBorder,
BlogListItem,
BlogResourceItem,
buttonStyle,
buttonLocation,
ContentSection,
Expand Down Expand Up @@ -135,7 +135,7 @@ const threeUpTextItems = [
},
]

const resourceItems = [
const blogResourceItems = [
{
title: 'FactSet avoids duplicative work across engineering teams',
description:
Expand Down Expand Up @@ -317,8 +317,8 @@ const CodeReusePage: FunctionComponent = () => (
<div className="col-lg-6">
<h1 className="mb-5 font-weight-bold">Related resources</h1>
</div>
{resourceItems.map(item => (
<BlogListItem key={item.title} blog={item} />
{blogResourceItems.map(item => (
<BlogResourceItem key={item.title} blog={item} />
))}
</div>
</ContentSection>
Expand Down
8 changes: 4 additions & 4 deletions src/pages/use-cases/onboarding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
BackButtonBold,
BlockquoteWithBorder,
BlockquoteWithLogoBottom,
BlogListItem,
BlogResourceItem,
buttonStyle,
buttonLocation,
CustomCarousel,
Expand Down Expand Up @@ -110,7 +110,7 @@ const items = [
},
]

const blogListItems = [
const blogResourceItems = [
{
title: '8 ways to implement better onboarding',
description:
Expand Down Expand Up @@ -318,8 +318,8 @@ const UseCasePage: FunctionComponent = () => (
<div className="col-lg-6">
<h1 className="mb-5 font-weight-bold">Related resources</h1>
</div>
{blogListItems.map(item => (
<BlogListItem key={item.title} blog={item} />
{blogResourceItems.map(item => (
<BlogResourceItem key={item.title} blog={item} />
))}
</div>
</ContentSection>
Expand Down
8 changes: 4 additions & 4 deletions src/pages/use-cases/vulnerabilities.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Link from 'next/link'
import {
Layout,
BackButtonBold,
BlogListItem,
BlogResourceItem,
buttonStyle,
buttonLocation,
ContentSection,
Expand Down Expand Up @@ -173,7 +173,7 @@ const quoteCarouselItems = [
},
]

const blogListItems = [
const blogResourceItems = [
{
title: 'Log4j Log4Shell 0-day: find, fix, and track affected code',
description:
Expand Down Expand Up @@ -366,8 +366,8 @@ const UseCasePage: FunctionComponent = () => (
<div className="col-lg-6">
<h1 className="mb-5 font-weight-bold">Related resources</h1>
</div>
{blogListItems.map(item => (
<BlogListItem key={item.title} blog={item} />
{blogResourceItems.map(item => (
<BlogResourceItem key={item.title} blog={item} />
))}
</div>
</ContentSection>
Expand Down

0 comments on commit 011165f

Please sign in to comment.