Skip to content

Commit c64770b

Browse files
authored
fix: Use correct changelog link on mobile (#10716)
* fix: Use correct changelog link on mobile * chore: simplify skip build logic * chore: add comment
1 parent 6f110b6 commit c64770b

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

skip-build.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,12 @@
77
# - https://vercel.com/docs/projects/overview#ignored-build-step
88
# - https://vercel.com/guides/how-do-i-use-the-ignored-build-step-field-on-vercel
99

10-
# diff status for develop-docs + docs content
1110
dev_docs_diff_status=$(git diff HEAD^ HEAD --quiet -- develop-docs; echo $?)
1211
docs_diff_status=$(git diff HEAD^ HEAD --quiet -- docs includes platform-includes ; echo $?)
13-
14-
# have changes occurred outside of the content directories
15-
non_content_diff_status=$(git diff HEAD^ HEAD --name-only | grep -vE '^(docs/|platform-includes/|includes/|develop-docs/)' | wc -l)
12+
app_diff_status=$(git diff HEAD^ HEAD --quiet -- src app public ; echo $?)
1613

1714
# always build on changes in non-content related directories
18-
if [[ $non_content_diff_status -eq 1 ]] ; then
15+
if [[ $app_diff_status -eq 1 ]] ; then
1916
exit 1
2017
fi
2118

src/components/header.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {HamburgerMenuIcon} from '@radix-ui/react-icons';
22
import Image from 'next/image';
33

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

77
import sidebarStyles from './sidebar/style.module.scss';
@@ -57,11 +57,7 @@ export function Header({pathname, searchPlatforms, noSearch}: Props) {
5757
</div>
5858
)}
5959
<div className="hidden lg:flex justify-end flex-1 space-x-2 items-center">
60-
<NavLink
61-
href={isDeveloperDocs ? 'https://docs.sentry.io/changelog' : '/changelog'}
62-
>
63-
Changelog
64-
</NavLink>
60+
<NavLink href={getChangelogLink()}>Changelog</NavLink>
6561
<NavLink href="https://try.sentry-demo.com/demo/start/">Sandbox</NavLink>
6662
<NavLink href="https://sentry.io/">Sign In</NavLink>
6763
</div>

src/components/mobileMenu/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {Box, Button, Theme} from '@radix-ui/themes';
55
import Link from 'next/link';
66

77
import {Search} from 'sentry-docs/components/search';
8+
import {getChangelogLink} from 'sentry-docs/getChangelogLink';
89

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

@@ -49,7 +50,7 @@ export function MobileMenu({pathname, searchPlatforms}: Props) {
4950
<DropdownMenu.Separator className={styles.DropdownMenuSeparator} />
5051
</Box>
5152
<DropdownMenu.Item className={styles.DropdownMenuItem} asChild>
52-
<Link href="/changelog">Changelog</Link>
53+
<Link href={getChangelogLink()}>Changelog</Link>
5354
</DropdownMenu.Item>
5455
<DropdownMenu.Item className={styles.DropdownMenuItem} asChild>
5556
<Link href="https://try.sentry-demo.com/demo/start/">Sandbox</Link>

src/getChangelogLink.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import {isDeveloperDocs} from './isDeveloperDocs';
2+
3+
// changelog app is only available on user-facing docs
4+
export const getChangelogLink = () =>
5+
isDeveloperDocs ? 'https://docs.sentry.io/changelog' : '/changelog';

0 commit comments

Comments
 (0)