Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "yarn upgrade && yarn format-all" #2799

Merged
merged 1 commit into from
Sep 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions content/docs/user-guide/contributing/blog.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ tags:
- Version Control
- AI
---

```

- `title` (**required**) - title of the post.
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@
},
"dependencies": {
"@hapi/wreck": "^17.0.0",
"@octokit/graphql": "^4.8.0",
"@octokit/graphql": "^4.3.1",
"@reach/portal": "^0.10.0",
"@reach/router": "^1.3.3",
"@reach/tooltip": "^0.10.0",
"classnames": "^2.2.6",
"color": "^3.2.1",
"color": "^3.1.2",
"compression": "^1.7.4",
"date-fns": "^2.23.0",
"date-fns": "^2.11.1",
"docsearch.js": "^2.6.3",
"ease-component": "^1.0.0",
"express": "^4.17.1",
Expand All @@ -59,9 +59,9 @@
"isomorphic-fetch": "^2.2.1",
"lodash": "^4.17.21",
"moment": "^2.25.3",
"nanoid": "^3.1.25",
"nanoid": "^3.0.2",
"node-cache": "^5.1.0",
"perfect-scrollbar": "^1.5.2",
"perfect-scrollbar": "^1.5.0",
"pretty-quick": "^2.0.1",
"prismjs": "^1.24.0",
"promise-polyfill": "^8.1.3",
Expand All @@ -78,7 +78,7 @@
"react-use": "^14.0.0",
"rehype-react": "^5.0.1",
"remark-preset-lint-recommended": "^5.0.0",
"repo-link-check": "^0.7.3",
"repo-link-check": "^0.7.1",
"reset-css": "^5.0.1",
"s3-client": "^4.4.2",
"scroll": "^3.0.1",
Expand All @@ -89,12 +89,12 @@
"upath": "^1.2.0"
},
"devDependencies": {
"@babel/core": "^7.15.0",
"@babel/core": "^7.9.0",
"@svgr/webpack": "^5.3.1",
"@types/classnames": "^2.2.10",
"@types/isomorphic-fetch": "^0.0.35",
"@types/promise-polyfill": "^6.0.3",
"@types/react": "^16.14.14",
"@types/react": "^16.9.32",
"@types/react-collapse": "^5.0.0",
"@types/react-dom": "^16.9.6",
"@types/react-helmet": "^5.0.15",
Expand All @@ -112,8 +112,8 @@
"eslint-config-prettier": "^6.10.1",
"eslint-plugin-json": "^2.1.1",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-prettier": "^3.4.1",
"eslint-plugin-react": "^7.25.1",
"eslint-plugin-prettier": "^3.1.2",
"eslint-plugin-react": "^7.19.0",
"gatsby-plugin-catch-links": "^2.2.1",
"gatsby-plugin-feed": "^2.4.1",
"gatsby-plugin-google-analytics": "^2.2.2",
Expand Down
5 changes: 3 additions & 2 deletions scripts/deploy-with-s3.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ const {
cleanEntry
} = require('./s3-utils')
const { move } = require('fs-extra')
const { downloadAllFromS3, uploadAllToS3, cleanAllLocal } =
withEntries(cacheDirs)
const { downloadAllFromS3, uploadAllToS3, cleanAllLocal } = withEntries(
cacheDirs
)

function run(command) {
execSync(command, {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Blog/Feed/Item/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const Item: React.FC<IBlogFeedItemProps> = ({
)}
>
<Link href={slug} className={styles.pictureLink}>
{image ? (
{picture ? (
<Image fluid={image} className={styles.picture} />
) : (
<Placeholder className={styles.picture} />
Expand Down
40 changes: 16 additions & 24 deletions src/components/Blog/Post/HeroPic/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,34 @@ import Image from 'gatsby-image'
import React from 'react'

import { BLOG } from '../../../../consts'
import { IFluidObject } from '../../../../templates/blog-post'
import {
IBlogPostHeroPic,
IGatsbyImageProps
} from '../../../../templates/blog-post'

import styles from './styles.module.css'

interface INonStretchedImageProps {
fluid: IFluidObject
style?: object
}

interface IHeroPicProps {
picture: {
fluid: IFluidObject
}
pictureComment?: string
}

const NonStretchedImage: React.FC<INonStretchedImageProps> = props => {
let style = {}
const NonStretchedImage: React.FC<IGatsbyImageProps> = props => {
let normalizedProps = props
if (props.fluid && props.fluid.presentationWidth) {
const presetantionWidth = props.fluid.presentationWidth
const presetantionWidth = props.fluid?.presentationWidth
const width =
presetantionWidth < BLOG.imageMaxWidthHero
? presetantionWidth / 2
: presetantionWidth
style = {
...(props.style || {}),

maxWidth: width,
margin: '0 auto'
normalizedProps = {
...props,
style: {
...(props.style || {}),
maxWidth: width,
margin: '0 auto'
}
}
}

return <Image style={style} {...props} />
return <Image {...normalizedProps} />
}

const HeroPic: React.FC<IHeroPicProps> = ({ pictureComment, picture }) => {
const HeroPic: React.FC<IBlogPostHeroPic> = ({ pictureComment, picture }) => {
return (
<div className={styles.pictureWrapper}>
<div className={styles.picture}>
Expand Down
7 changes: 3 additions & 4 deletions src/components/Community/Learn/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,9 @@ const BlogPost: React.FC<ICommunityBlogPost> = ({
return null
}

const logPost = useCallback(
() => logEvent('community', 'blog', title),
[title]
)
const logPost = useCallback(() => logEvent('community', 'blog', title), [
title
])

const { error, ready, result } = useCommentsCount(commentsUrl)

Expand Down
14 changes: 6 additions & 8 deletions src/components/Community/Meet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ const Topic: React.FC<{ color: string } & IDiscussTopic> = ({
comments,
color
}) => {
const logTopic = useCallback(
() => logEvent('community', 'forum', title),
[title]
)
const logTopic = useCallback(() => logEvent('community', 'forum', title), [
title
])

return (
<div className={sharedStyles.line}>
Expand Down Expand Up @@ -68,10 +67,9 @@ const Issue: React.FC<{ color: string } & IGithubIssue> = ({
comments,
color
}) => {
const logIssue = useCallback(
() => logEvent('community', 'issue', title),
[title]
)
const logIssue = useCallback(() => logEvent('community', 'issue', title), [
title
])

return (
<div className={sharedStyles.line}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Documentation/Markdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const Details: React.FC<{
*/
return (
<Collapsible
trigger={triggerChildren as unknown as ReactElement}
trigger={(triggerChildren as unknown) as ReactElement}
transitionTime={200}
>
{filteredChildren.slice(1)}
Expand Down
70 changes: 36 additions & 34 deletions src/components/DownloadButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,42 +78,44 @@ const getUserOS = (): OS => {
return OSName
}

const DownloadButtonDropdownItems: React.FC<IDownloadButtonDropdownItemsProps> =
({ onClick, userOS }) => {
return (
<div className={styles.links}>
{dropdownItems.map((os, index) => {
if (os === null) {
return (
<div
className={styles.dropdownDelimiter}
key={`delimiter-${index}`}
/>
)
}

const item = itemsByOs[os]

const DownloadButtonDropdownItems: React.FC<IDownloadButtonDropdownItemsProps> = ({
onClick,
userOS
}) => {
return (
<div className={styles.links}>
{dropdownItems.map((os, index) => {
if (os === null) {
return (
<Link
download={item.download}
key={os}
className={cn(
styles.dropdownItem,
os === userOS && styles.active,
'link-with-focus'
)}
href={item.url}
optOutPreRedirect={true}
onClick={(): void => onClick(os)}
>
{item.title}
</Link>
<div
className={styles.dropdownDelimiter}
key={`delimiter-${index}`}
/>
)
})}
</div>
)
}
}

const item = itemsByOs[os]

return (
<Link
download={item.download}
key={os}
className={cn(
styles.dropdownItem,
os === userOS && styles.active,
'link-with-focus'
)}
href={item.url}
optOutPreRedirect={true}
onClick={(): void => onClick(os)}
>
{item.title}
</Link>
)
})}
</div>
)
}

const DownloadButton: React.FC<IDownloadButtonProps> = ({ openTop }) => {
const userOS = useRef(getUserOS())
Expand Down
5 changes: 3 additions & 2 deletions src/components/Paginator/LocationContext/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ export interface IPaginatorLocationContextValue {
}
}

export const PaginatorLocationContext =
createContext<IPaginatorLocationContextValue | null>(null)
export const PaginatorLocationContext = createContext<IPaginatorLocationContextValue | null>(
null
)

export const usePaginatorContext = (): IPaginatorLocationContextValue | null =>
useContext(PaginatorLocationContext)
9 changes: 5 additions & 4 deletions src/gatsby/models/authors/parse-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ function parseLink(input) {
switch (typeof input) {
// Handle shorthand string links
case 'string':
const { groups } =
/^(?<scheme>.*?\/\/)?(?:www\.)?(?<host>[^\/]*)(?<pathname>.*?)\/?$/.exec(
input
)
const {
groups
} = /^(?<scheme>.*?\/\/)?(?:www\.)?(?<host>[^\/]*)(?<pathname>.*?)\/?$/.exec(
input
)

// Extract groups into variables and assign defaults to non-matches
return (processors[groups.host] || defaultProcessor)(groups)
Expand Down
2 changes: 1 addition & 1 deletion src/templates/blog-home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const BlogHomePage: React.FC<IBlogHomePageProps> = ({
export default BlogHomePage

export const pageQuery = graphql`
query ($skip: Int, $limit: Int) {
query($skip: Int, $limit: Int) {
posts: allBlogPost(
sort: { fields: [date], order: DESC }
skip: $skip
Expand Down
15 changes: 13 additions & 2 deletions src/templates/blog-post.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FixedObject, FluidObject } from 'gatsby-image'
import { FixedObject, FluidObject, GatsbyImageProps } from 'gatsby-image'

import { graphql } from 'gatsby'
import React from 'react'
Expand All @@ -8,11 +8,22 @@ import Post from '../components/Blog/Post'

import { ISocialIcon } from '../components/SocialIcon'

export interface IFluidObject extends FluidObject {
interface IFluidObject extends FluidObject {
presentationWidth: number
presentationHeight: number
}

export interface IGatsbyImageProps extends GatsbyImageProps {
fluid?: IFluidObject
}

export interface IBlogPostHeroPic {
picture?: {
fluid: IFluidObject
}
pictureComment?: string
}

export interface IBlogPostData {
id: string
html: string
Expand Down
2 changes: 1 addition & 1 deletion src/templates/blog-tags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const BlogTagsPage: React.FC<IBlogTagsPageData> = ({
export default BlogTagsPage

export const pageQuery = graphql`
query ($tag: String, $skip: Int, $limit: Int) {
query($tag: String, $skip: Int, $limit: Int) {
posts: allBlogPost(
sort: { fields: [date], order: DESC }
filter: { tags: { in: [$tag] } }
Expand Down
Loading