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

New feedback form #865

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
5 changes: 4 additions & 1 deletion src/components/footer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Box, FooterLanding } from '@vtex/brand-ui'
import { useRouter } from 'next/router'
import { getMessages } from 'utils/get-messages'
import styles from './styles'
import {
Expand All @@ -9,6 +10,8 @@ import {
} from 'utils/get-url'

const messages = getMessages()
const router = useRouter()
const currentPage = router.asPath.split('?')[0]

const links = [
{
Expand All @@ -25,7 +28,7 @@ const links = [
},
{
message: messages['landing_page_footer_feedback.message'],
to: () => getFeedbackURL(),
to: () => `${getFeedbackURL()}https://developers.vtex.com${currentPage}`,
},
]

Expand Down
3 changes: 2 additions & 1 deletion src/components/header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ interface Props {
const Header = ({ isEditor }: Props) => {
const router = useRouter()
const isBranchPreview = router.isPreview
const currentPage = router.asPath.split('?')[0]

const { branchPreview } = useContext(PreviewContext)

Expand Down Expand Up @@ -153,7 +154,7 @@ const Header = ({ isEditor }: Props) => {

<VtexLink
sx={styles.rightLinksItem}
href={getFeedbackURL()}
href={`${getFeedbackURL()}https://developers.vtex.com${currentPage}`}
target="_blank"
>
<LongArrowIcon />
Expand Down
10 changes: 6 additions & 4 deletions src/pages/404.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@ import getNavigation from 'utils/getNavigation'
import { GetStaticProps } from 'next'
import { useContext } from 'react'
import { PreviewContext } from 'utils/contexts/preview'
import { getFeedbackURL } from 'utils/get-url'
import { useRouter } from 'next/router'

interface Props {
branch: string
}

const FourOhFour: Page<Props> = ({ branch }) => {
const router = useRouter()
const { setBranchPreview } = useContext(PreviewContext)
setBranchPreview(branch)
const currentPage = router.asPath.split('?')[0]
const feedbackUrl = `${getFeedbackURL()}https://developers.vtex.com${currentPage}&entry.358925425=Page+not+found`

return (
<>
Expand All @@ -34,10 +39,7 @@ const FourOhFour: Page<Props> = ({ branch }) => {
error.
</Text>
<Button sx={styles.button}>
<Link
sx={styles.buttonLink}
href="https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com&entry.1799503232="
>
<Link sx={styles.buttonLink} href={feedbackUrl}>
CONTACT US
</Link>
</Button>
Expand Down
10 changes: 6 additions & 4 deletions src/pages/500.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@ import { GetStaticProps } from 'next'
import getNavigation from 'utils/getNavigation'
import { useContext } from 'react'
import { PreviewContext } from 'utils/contexts/preview'
import { getFeedbackURL } from 'utils/get-url'
import { useRouter } from 'next/router'

interface Props {
branch: string
}

const fiveHundredPage: Page<Props> = ({ branch }) => {
const router = useRouter()
const { setBranchPreview } = useContext(PreviewContext)
setBranchPreview(branch)
const currentPage = router.asPath.split('?')[0]
const feedbackUrl = `${getFeedbackURL()}https://developers.vtex.com${currentPage}&entry.358925425=Site+error`

return (
<>
Expand All @@ -31,10 +36,7 @@ const fiveHundredPage: Page<Props> = ({ branch }) => {
contact us if the problem persists.
</Text>
<Button sx={styles.button}>
<Link
sx={styles.buttonLink}
href="https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com&entry.1799503232="
>
<Link sx={styles.buttonLink} href={feedbackUrl}>
CONTACT US
</Link>
</Button>
Expand Down
2 changes: 1 addition & 1 deletion src/utils/get-url.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const getFeedbackURL = () => {
return `https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com&entry.1799503232=`
return `https://docs.google.com/forms/d/e/1FAIpQLSejjkI4aRPadDn0C9EKa-_mESUWPjwoS6yMTN8KA9PPCLfcfA/viewform?usp=pp_url&entry.1077155995=`
}

export const getGithubURL = () => {
Expand Down
Loading