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

Move ShareButton to components lib and place it in the feedback section #79

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
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
9 changes: 8 additions & 1 deletion src/components/feedback-section/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ interface DocPath {
slug?: string
docPath?: string
suggestEdits?: boolean
shareButton?: boolean
}

const FeedbackSection = ({ slug, docPath, suggestEdits = true }: DocPath) => {
const FeedbackSection = ({
slug,
docPath,
suggestEdits = true,
shareButton = false,
}: DocPath) => {
const sendFeedback = async (comment: string, liked: boolean) => {
const feedback = {
data: [
Expand All @@ -31,6 +37,7 @@ const FeedbackSection = ({ slug, docPath, suggestEdits = true }: DocPath) => {
urlToEdit={urlToEdit}
suggestEdits={suggestEdits}
slug={slug}
shareButton={shareButton}
/>
)
}
Expand Down
20 changes: 0 additions & 20 deletions src/components/icons/email-icon.tsx

This file was deleted.

18 changes: 0 additions & 18 deletions src/components/icons/facebook-icon.tsx

This file was deleted.

20 changes: 0 additions & 20 deletions src/components/icons/linkedin-icon.tsx

This file was deleted.

20 changes: 0 additions & 20 deletions src/components/icons/twitter-icon.tsx

This file was deleted.

80 changes: 0 additions & 80 deletions src/components/share-button/index.tsx

This file was deleted.

64 changes: 0 additions & 64 deletions src/components/share-button/styles.ts

This file was deleted.

6 changes: 5 additions & 1 deletion src/components/tutorial-markdown-render/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ const TutorialMarkdownRender = (props: Props) => {
<Contributors contributors={props.contributors} />
</Box>

<FeedbackSection docPath={props.path} slug={props.slug} />
<FeedbackSection
docPath={props.path}
slug={props.slug}
shareButton={true}
/>
{props.isListed && (
<ArticlePagination
hidePaginationNext={
Expand Down
5 changes: 2 additions & 3 deletions src/pages/announcements/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ import {
getParents,
localeType,
} from 'utils/navigation-utils'
import { MarkdownRenderer } from '@vtexdocs/components'
import ShareButton from 'components/share-button'
import { MarkdownRenderer, ShareButton } from '@vtexdocs/components'
import Author from 'components/author'
import { useIntl } from 'react-intl'
import MoreArticlesSection from 'components/more-articles-section'
Expand Down Expand Up @@ -139,7 +138,7 @@ const AnnouncementPage: NextPage<Props> = ({
<MarkdownRenderer serialized={serialized} />
</article>
</Box>
<FeedbackSection docPath={path} slug={slug} />
<FeedbackSection docPath={path} slug={slug} shareButton={true} />
{serialized.frontmatter?.seeAlso && (
<MoreArticlesSection docs={seeAlsoData} />
)}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/docs/tracks/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ const TrackPage: NextPage<Props> = ({
<Contributors contributors={contributors} />
</Box>

<FeedbackSection docPath={path} slug={slug} />
<FeedbackSection docPath={path} slug={slug} shareButton={true} />
{isListed && (
<ArticlePagination
hidePaginationNext={
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3096,9 +3096,9 @@
resolved "https://registry.npmjs.org/@vtex/tsconfig/-/tsconfig-0.6.0.tgz"
integrity sha512-SVQBxaSdEVdpJFja1aVTIiZBgpQKePyYOUWGzcYq6LYkSWqSbz2LoC7TuLUsmfweYmVkv8+4eVuxcDpQVEpq1A==

"@vtexdocs/components@https://github.com/vtexdocs/components.git#v2.0.0":
version "2.0.0"
resolved "https://github.com/vtexdocs/components.git#1efb9f446177b76b2c6b7c5289b258c541a34b2e"
"@vtexdocs/components@https://github.com/vtexdocs/components.git#v2.1.0":
version "2.1.0"
resolved "https://github.com/vtexdocs/components.git#716b2ca9bdb645b92ddc0d2f25a9712fafa6d498"
dependencies:
"@code-hike/mdx" "^0.9.0"
"@vtex/brand-ui" "^0.46.1"
Expand Down