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

Feat/tutorials #31

Merged
merged 94 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
efb09e8
feat: adds type to docs tutorial
Pvcunha Feb 1, 2024
a839fd2
feat: adds get children and pagination
Pvcunha Feb 2, 2024
67d54e5
feat: adds tutorial-category
Pvcunha Feb 6, 2024
c04efcd
feat: adds title and description messages
Pvcunha Feb 6, 2024
7d1e07d
feat: creates index page for tutorials
Pvcunha Feb 6, 2024
a4b1296
feat: fix pagination when is only next item
Pvcunha Feb 6, 2024
9246f09
feat: adds style for just next
Pvcunha Feb 6, 2024
19ae9d9
fix: fix react hooking
Pvcunha Feb 7, 2024
d0fd092
fix: removing unused vars
Pvcunha Feb 7, 2024
277b7cc
feat: adds type to docs tutorial
Pvcunha Feb 1, 2024
f5a8184
feat: adds get children and pagination
Pvcunha Feb 2, 2024
aab96de
feat: adds tutorial-category
Pvcunha Feb 6, 2024
8179502
feat: adds title and description messages
Pvcunha Feb 6, 2024
9989bc8
feat: creates index page for tutorials
Pvcunha Feb 6, 2024
ce2ba98
feat: fix pagination when is only next item
Pvcunha Feb 6, 2024
e4df3f6
feat: adds style for just next
Pvcunha Feb 6, 2024
7ea078c
fix: fix react hooking
Pvcunha Feb 7, 2024
49b132a
fix: removing unused vars
Pvcunha Feb 7, 2024
b97bb0f
Merge branch 'feat/tutorials' of github.com:vtexdocs/helpcenter into …
Pvcunha Feb 8, 2024
2ab4150
fix: pagination button error with small widths
Pvcunha Feb 8, 2024
dcbca1c
feat: adds reading time
Pvcunha Feb 8, 2024
c424c3e
fix: pagination when just one item is been displayed
Pvcunha Feb 8, 2024
c85efa9
refactor: changes type name for tutorial indexing and creates compone…
Pvcunha Feb 9, 2024
8a3b0ae
fix: fixing hover when just next pagination is active
Pvcunha Feb 9, 2024
6676b97
feat: removes commented code
Pvcunha Feb 19, 2024
b5de94e
feat: changes props return from getstaticprops
Pvcunha Feb 19, 2024
cdcc427
chore(deps): add react-share
aliceoq Jan 31, 2024
13bb0e9
fix: create social media icons without circles
aliceoq Jan 31, 2024
3928c57
feat: create single author component
aliceoq Jan 31, 2024
c429415
feat: create share button
aliceoq Jan 31, 2024
92d8e14
feat: wip announcement page
aliceoq Jan 31, 2024
cf66871
feat(icons): add copy, email and linkedin icon
aliceoq Jan 31, 2024
541ce20
style: improve share button styling
aliceoq Jan 31, 2024
f8e91a7
chore: update lock file
aliceoq Jan 31, 2024
6b1164c
fix(icons): update icons and fix warnings
aliceoq Feb 1, 2024
8ea2b2c
fix(share): use click outside to close dropdown
aliceoq Feb 1, 2024
0f3eb63
fix(announcements): check if window is defined
aliceoq Feb 1, 2024
d3fc168
fix(overview): fix invalid name warning
aliceoq Feb 1, 2024
275ff9c
fix(messages): replace news with announcements
aliceoq Feb 5, 2024
203fbd5
fix(announcement): rename timeline card
aliceoq Feb 5, 2024
abdefd7
feat: improve announcement page messages
aliceoq Feb 5, 2024
ab58353
feat: add new announcement card
aliceoq Feb 5, 2024
0c8e02b
fix: news section should be called announcements
aliceoq Feb 5, 2024
d3f30b7
feat: create more articles section
aliceoq Feb 5, 2024
63c9520
feat(tag): add new color variant
aliceoq Feb 5, 2024
4ea3fb6
fix: rename news documentation
aliceoq Feb 5, 2024
90c6fdf
feat(announcements): add breadcrumb and more articles section
aliceoq Feb 5, 2024
636f989
fix: change announcements route
aliceoq Feb 6, 2024
01dcef2
feat: update known issues and announcements messages
aliceoq Feb 6, 2024
f20b35e
fix: use AnnouncementDataElement
aliceoq Feb 6, 2024
b4d7044
style: add small and large announcement card
aliceoq Feb 6, 2024
5f5fb21
fix(select): remove test placeholder
aliceoq Feb 6, 2024
deae908
fix: add link to redirect on see more button
aliceoq Feb 6, 2024
a034283
feat: create input component
aliceoq Feb 6, 2024
d32a38d
feat: create announcement listing page
aliceoq Feb 6, 2024
53a9b44
feat: update announcements image
aliceoq Feb 7, 2024
e9f1d17
feat: create component to show dates
aliceoq Feb 8, 2024
bb593bb
fix(messages): update date messages
aliceoq Feb 8, 2024
94f4d0b
fix(known-issues): fix dates
aliceoq Feb 8, 2024
4109fc7
feat(announcement): show dates
aliceoq Feb 8, 2024
b844329
style: fix padding in cards
aliceoq Feb 8, 2024
c55ab5e
fix: remove emphasis from date
aliceoq Feb 8, 2024
8966e42
chore(release): 0.3.0
aliceoq Feb 9, 2024
1fab335
fix: rename messages and types
aliceoq Feb 7, 2024
36ab07a
fix: fix faq route and rename sort options
aliceoq Feb 7, 2024
1b261d0
feat: create faq card
aliceoq Feb 7, 2024
a7b9b3d
feat: create faq pages
aliceoq Feb 7, 2024
78cf040
feat: add faq filter title
aliceoq Feb 7, 2024
d002ea4
fix: filter doesn't require two filter types
aliceoq Feb 7, 2024
1fc5057
feat(tag): add Gray color
aliceoq Feb 7, 2024
ba6c8a3
feat(faq): add product team
aliceoq Feb 7, 2024
7343308
feat(faq): add filter
aliceoq Feb 7, 2024
a7b72c9
style(breadcrumb): add flex wrap
aliceoq Feb 9, 2024
cabc801
fix: fix filter sizing
aliceoq Feb 9, 2024
139c93f
style: fix select height and remove outline
aliceoq Feb 9, 2024
f5fafd3
feat: add dates to faq card
aliceoq Feb 9, 2024
cca170c
feat: add dates to faq page
aliceoq Feb 9, 2024
839675b
style: fix position of reading time text
aliceoq Feb 9, 2024
b6ed897
fix(faq): import the correct sortBy type
aliceoq Feb 9, 2024
cf8d3e2
fix: change faq header image
aliceoq Feb 9, 2024
7af8e0c
fix(faq): show 5 items per page
aliceoq Feb 9, 2024
031bf3b
chore(release): 0.4.0
aliceoq Feb 16, 2024
3894329
feat: adds tutorial-category
Pvcunha Feb 6, 2024
0f2563e
feat: adds title and description messages
Pvcunha Feb 6, 2024
c712401
feat: adds type to docs tutorial
Pvcunha Feb 1, 2024
fd671a6
feat: adds get children and pagination
Pvcunha Feb 2, 2024
49b47c5
feat: adds tutorial-category
Pvcunha Feb 6, 2024
de0ae29
feat: adds title and description messages
Pvcunha Feb 6, 2024
7694b29
feat: creates index page for tutorials
Pvcunha Feb 6, 2024
c4fa9c5
fix: fix react hooking
Pvcunha Feb 7, 2024
1c2ed04
feat: removes commented code
Pvcunha Feb 19, 2024
d74c013
fix: fix after rebase
Pvcunha Feb 20, 2024
f65ea21
Merge branch 'main' into feat/tutorials
Pvcunha Feb 20, 2024
4a72eb4
fix: remove enter
Pvcunha Feb 20, 2024
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
4 changes: 2 additions & 2 deletions public/navigation.json
Original file line number Diff line number Diff line change
Expand Up @@ -3650,7 +3650,7 @@
"name": { "en": "Beta", "es": "Beta", "pt": "Beta" },
"slug": "beta-products",
"origin": "",
"type": "category",
"type": "tutorial-category",
"children": [
{
"name": {
Expand All @@ -3660,7 +3660,7 @@
},
"slug": "subscriptions-beta",
"origin": "",
"type": "category",
"type": "tutorial-category",
"children": [
{
"name": {
Expand Down
6 changes: 5 additions & 1 deletion src/components/article-pagination/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ const ArticlePagination = ({
handleClick(e, pagination.nextDoc.slug as string)
}}
>
<Box sx={styles.paginationBox}>
<Box
sx={
!hidePaginationPrevious ? styles.paginationBox : styles.justNext
}
>
<Text sx={styles.paginationText}>{pagination.nextDoc.name}</Text>
<Text sx={styles.subTitle}>Next »</Text>
</Box>
Expand Down
16 changes: 16 additions & 0 deletions src/components/article-pagination/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,20 @@ const paginationBox: SxStyleProp = {
color: '#4A596B',
}

const justNext: SxStyleProp = {
':hover': {
border: '1px solid #CCCED8',
boxShadow: '0px 0px 16px rgba(0, 0, 0, 0.1)',
color: '#000711',
},
justifySelf: 'right',
border: '1px solid #E7E9EE',
padding: '16px',
borderRadius: '4px',
textAlign: 'right',
color: '#4A596B',
}

const paginationText: SxStyleProp = {
whiteSpace: 'nowrap',
overflow: 'hidden',
Expand All @@ -48,6 +62,7 @@ const paginationLinkNext: SxStyleProp = {
...paginationLink,
justifySelf: 'flex-end',
textAlign: 'right',
justifyContent: 'right',
}

const paginationLinkPrevious: SxStyleProp = {
Expand All @@ -56,6 +71,7 @@ const paginationLinkPrevious: SxStyleProp = {
}

export default {
justNext,
mainContainer,
flexContainer,
paginationLinkNext,
Expand Down
71 changes: 71 additions & 0 deletions src/components/tutorial-index/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { Box, Flex, Link, Text } from '@vtex/brand-ui'
import Breadcrumb from 'components/breadcrumb'

import FeedbackSection from 'components/feedback-section'
import startHereImage from '../../../public/images/start-here.png'
import PageHeader from 'components/page-header'

import styles from 'styles/documentation-page'
import ArticlePagination from 'components/article-pagination'
import { useIntl } from 'react-intl'

const TutorialIndexing = ({ ...props }) => {
const intl = useIntl()

return (
<>
<PageHeader
title={intl.formatMessage({
id: 'tutorial_and_solutions_page.title',
})}
description={intl.formatMessage({
id: 'tutorial_and_solutions_page.description',
})}
imageUrl={startHereImage}
imageAlt={intl.formatMessage({
id: 'tutorial_and_solutions_page.title',
})}
/>
<Flex sx={styles.innerContainer}>
<Box sx={styles.articleBox}>
<Box sx={styles.contentContainer}>
<article>
<header style={{ all: 'unset' }}>
{props.breadcrumbList.length > 1 ? (
<Breadcrumb breadcrumbList={props.breadcrumbList} />
) : undefined}
</header>
<Box sx={styles.textContainer}>
<Box sx={styles.titleContainer}>
<Text>{props.name}</Text>
</Box>
<Box sx={styles.indexContainer}>
<Text sx={{ fontSize: '22px', pt: '32px' }}>
In this section
</Text>
<Flex sx={styles.linksContainer}>
{props.children.map(
(el: { slug: string; name: string }) => (
<Link href={el.slug}>{el.name}</Link>
)
)}
</Flex>
</Box>
</Box>
</article>
</Box>
<FeedbackSection slug={props.slug} suggestEdits={false} />
{props.isListed && (
<ArticlePagination
hidePaginationNext={props.hidePaginationNext || false}
hidePaginationPrevious={props.hidePaginationPrevious || false}
pagination={props.pagination}
/>
)}
</Box>
</Flex>
</>
)
}

export default TutorialIndexing
145 changes: 145 additions & 0 deletions src/components/tutorial-markdown-render/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
import Head from 'next/head'
import { Box, Flex, Text } from '@vtex/brand-ui'
import Breadcrumb from 'components/breadcrumb'

import FeedbackSection from 'components/feedback-section'
import OnThisPage from 'components/on-this-page'
import SeeAlsoSection from 'components/see-also-section'
import startHereImage from '../../../public/images/start-here.png'
import PageHeader from 'components/page-header'
import { useIntl } from 'react-intl'
import DocumentContextProvider from 'utils/contexts/documentContext'
import { Item, MarkdownRenderer, TableOfContents } from '@vtexdocs/components'

import styles from 'styles/documentation-page'
import ArticlePagination from 'components/article-pagination'
import Contributors from 'components/contributors'
import { MDXRemoteSerializeResult } from 'next-mdx-remote'
import { ContributorsType } from 'utils/getFileContributors'

interface Props {
content: string
serialized: MDXRemoteSerializeResult
contributors: ContributorsType[]
path: string
headingList: Item[]
seeAlsoData: {
url: string
title: string
category: string
}[]
// sectionSelected: string
// sidebarfallback: any //eslint-disable-line
slug: string
// parentsArray: string[]
// path: string
isListed: boolean
branch: string
pagination: {
previousDoc: {
slug: string | null
name: string | null
}
nextDoc: {
slug: string | null
name: string | null
}
}
breadcrumbList: { slug: string; name: string; type: string }[]
headings: Item[]
}
const TutorialMarkdownRender = (props: Props) => {
const intl = useIntl()

return (
<>
<Head>
<title>{props.serialized.frontmatter?.title as string}</title>
<meta name="docsearch:doctype" content="Tutorials & Solutions" />
{props.serialized.frontmatter?.hidden && (
<meta name="robots" content="noindex" />
)}
{props.serialized.frontmatter?.excerpt && (
<meta
property="og:description"
content={props.serialized.frontmatter?.excerpt as string}
/>
)}
</Head>
<PageHeader
title={intl.formatMessage({
id: 'tutorial_and_solutions_page.title',
})}
description={intl.formatMessage({
id: 'tutorial_and_solutions_page.description',
})}
imageUrl={startHereImage}
imageAlt={intl.formatMessage({
id: 'tutorial_and_solutions_page.title',
})}
/>
<DocumentContextProvider headings={props.headings}>
<Flex sx={styles.innerContainer}>
<Box sx={styles.articleBox}>
<Box sx={styles.contentContainer}>
<article>
<header>
<Breadcrumb breadcrumbList={props.breadcrumbList} />
<Text sx={styles.documentationTitle} className="title">
{props.serialized.frontmatter?.title}
</Text>
<Text sx={styles.documentationExcerpt}>
{props.serialized.frontmatter?.excerpt}
</Text>
</header>
<Text sx={styles.readingTime}>
{intl.formatMessage(
{
id: 'documentation_reading_time.text',
defaultMessage: '',
},
{
minutes: props.serialized.frontmatter?.readingTime,
}
)}
</Text>
<MarkdownRenderer serialized={props.serialized} />
</article>
</Box>

<Box sx={styles.bottomContributorsContainer}>
<Box sx={styles.bottomContributorsDivider} />
<Contributors contributors={props.contributors} />
</Box>

<FeedbackSection docPath={props.path} slug={props.slug} />
{props.isListed && (
<ArticlePagination
hidePaginationNext={
Boolean(props.serialized.frontmatter?.hidePaginationNext) ||
false
}
hidePaginationPrevious={
Boolean(
props.serialized.frontmatter?.hidePaginationPrevious
) || false
}
pagination={props.pagination}
/>
)}
{props.serialized.frontmatter?.seeAlso && (
<SeeAlsoSection docs={props.seeAlsoData} />
)}
</Box>
<Box sx={styles.rightContainer}>
<Contributors contributors={props.contributors} />
<TableOfContents headingList={props.headings} />
</Box>
<OnThisPage />
</Flex>
</DocumentContextProvider>
</>
)
}

export default TutorialMarkdownRender
5 changes: 5 additions & 0 deletions src/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@
"sort.label": "Sort by:",
"sort.recently_updated": "Recently updated",
"sort.newest": "Newest",
"known_issues_result.empty": "No matching results. Try other filters.",
"known_issues_date.created": "Created at",
"known_issues_date.updated": "Updated at",
"tutorial_and_solutions_page.title": "Tutorials & Solutions",
"tutorial_and_solutions_page.description": "Access the documentation of all platform modules and clarify your doubts.",
"date_text.created": "Published on",
"date_text.updated": "Last update on",
"announcements_page_result.empty": "No matching results.",
Expand Down
5 changes: 5 additions & 0 deletions src/messages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,11 @@
"sort.label": "Ordenar por:",
"sort.recently_updated": "Recientemente actualizados",
"sort.newest": "Más nuevos",
"known_issues_result.empty": "Ningún resultado coincidente. Pruebe con otros filtros.",
"known_issues_date.created": "Creado en",
"known_issues_date.updated": "Actualizado en",
"tutorial_and_solutions_page.title": "Tutoriales y Soluciones",
"tutorial_and_solutions_page.description": "Accede a la documentación de todos los módulos de la plataforma y resuelve tus dudas.",
"date_text.created": "Publicado en",
"date_text.updated": "Última actualización",
"announcements_page_result.empty": "Ningún resultado coincidente.",
Expand Down
5 changes: 5 additions & 0 deletions src/messages/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,11 @@
"sort.label": "Ordenar por:",
"sort.recently_updated": "Recentemente atualizado",
"sort.newest": "Mais novos",
"known_issues_result.empty": "Nenhum resultado correspondente. Tente outros filtros.",
"known_issues_date.created": "Criado em",
"known_issues_date.updated": "Atualizado em",
"tutorial_and_solutions_page.title": "Tutoriais & Soluções",
"tutorial_and_solutions_page.description": "Acesse a documentação de todas os módulos da plataforma e tire suas dúvidas.",
"date_text.created": "Publicado em",
"date_text.updated": "Última atualização em",
"announcements_page_result.empty": "Nenhum resultado correspondente.",
Expand Down
Loading
Loading