Skip to content

Commit

Permalink
fix: Use correct changelog link on mobile (#10716)
Browse files Browse the repository at this point in the history
* fix: Use correct changelog link on mobile

* chore: simplify skip build logic

* chore: add comment
  • Loading branch information
chargome authored Jul 15, 2024
1 parent 6f110b6 commit c64770b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
7 changes: 2 additions & 5 deletions skip-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@
# - https://vercel.com/docs/projects/overview#ignored-build-step
# - https://vercel.com/guides/how-do-i-use-the-ignored-build-step-field-on-vercel

# diff status for develop-docs + docs content
dev_docs_diff_status=$(git diff HEAD^ HEAD --quiet -- develop-docs; echo $?)
docs_diff_status=$(git diff HEAD^ HEAD --quiet -- docs includes platform-includes ; echo $?)

# have changes occurred outside of the content directories
non_content_diff_status=$(git diff HEAD^ HEAD --name-only | grep -vE '^(docs/|platform-includes/|includes/|develop-docs/)' | wc -l)
app_diff_status=$(git diff HEAD^ HEAD --quiet -- src app public ; echo $?)

# always build on changes in non-content related directories
if [[ $non_content_diff_status -eq 1 ]] ; then
if [[ $app_diff_status -eq 1 ]] ; then
exit 1
fi

Expand Down
8 changes: 2 additions & 6 deletions src/components/header.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {HamburgerMenuIcon} from '@radix-ui/react-icons';
import Image from 'next/image';

import {isDeveloperDocs} from 'sentry-docs/isDeveloperDocs';
import {getChangelogLink} from 'sentry-docs/getChangelogLink';
import SentryLogoSVG from 'sentry-docs/logos/sentry-logo-dark.svg';

import sidebarStyles from './sidebar/style.module.scss';
Expand Down Expand Up @@ -57,11 +57,7 @@ export function Header({pathname, searchPlatforms, noSearch}: Props) {
</div>
)}
<div className="hidden lg:flex justify-end flex-1 space-x-2 items-center">
<NavLink
href={isDeveloperDocs ? 'https://docs.sentry.io/changelog' : '/changelog'}
>
Changelog
</NavLink>
<NavLink href={getChangelogLink()}>Changelog</NavLink>
<NavLink href="https://try.sentry-demo.com/demo/start/">Sandbox</NavLink>
<NavLink href="https://sentry.io/">Sign In</NavLink>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/components/mobileMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {Box, Button, Theme} from '@radix-ui/themes';
import Link from 'next/link';

import {Search} from 'sentry-docs/components/search';
import {getChangelogLink} from 'sentry-docs/getChangelogLink';

import styles from './styles.module.scss';

Expand Down Expand Up @@ -49,7 +50,7 @@ export function MobileMenu({pathname, searchPlatforms}: Props) {
<DropdownMenu.Separator className={styles.DropdownMenuSeparator} />
</Box>
<DropdownMenu.Item className={styles.DropdownMenuItem} asChild>
<Link href="/changelog">Changelog</Link>
<Link href={getChangelogLink()}>Changelog</Link>
</DropdownMenu.Item>
<DropdownMenu.Item className={styles.DropdownMenuItem} asChild>
<Link href="https://try.sentry-demo.com/demo/start/">Sandbox</Link>
Expand Down
5 changes: 5 additions & 0 deletions src/getChangelogLink.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import {isDeveloperDocs} from './isDeveloperDocs';

// changelog app is only available on user-facing docs
export const getChangelogLink = () =>
isDeveloperDocs ? 'https://docs.sentry.io/changelog' : '/changelog';

0 comments on commit c64770b

Please sign in to comment.