Skip to content

Commit

Permalink
rename function
Browse files Browse the repository at this point in the history
  • Loading branch information
ethangardner committed Dec 12, 2024
1 parent f8b7858 commit 586fab5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions apps/spotlight/src/components/Footer.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
import { type GithubRepository, getBranchTreeUrl } from '../lib/github.js';
import { Image } from 'astro:assets';
import { getBaseUrl } from '../routes';
import { getPublicDirUrl } from '../routes';
type Props = {
github: GithubRepository;
Expand All @@ -26,7 +26,7 @@ const { github } = Astro.props;
class="usa-identifier__logo GSAFooter__logo"
>
<Image
src=`${getBaseUrl()}images/gsa-logo.svg`
src=`${getPublicDirUrl()}images/gsa-logo.svg`
alt="GSA.gov home."
width="60"
height="60"
Expand Down
10 changes: 6 additions & 4 deletions apps/spotlight/src/components/Header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import closeSvg from '@atj/design/static/uswds/img/usa-icons/close.svg';
import * as routes from '../routes';
import { Image } from 'astro:assets';
import { getBaseUrl } from '../routes';
import { getPublicDirUrl } from '../routes';
const getNavLinkClasses = (url: string) => {
if (url === Astro.url.pathname) {
Expand All @@ -12,8 +12,10 @@ const getNavLinkClasses = (url: string) => {
}
};
const currentRoute = Astro.url.pathname;
const isAboutContent = currentRoute.startsWith('/about');
const currentRoute = Astro.url.href;
console.log(currentRoute);
console.log(`${routes.getHomeUrl()}about`);
const isAboutContent = currentRoute.startsWith(`${routes.getHomeUrl()}about`);
const showAboutContent = false;
---

Expand All @@ -32,7 +34,7 @@ const showAboutContent = false;
<em class="usa-logo__text">
<a href={routes.getHomeUrl()} title="10x Forms Platform">
<Image
src=`${getBaseUrl()}images/10x-logo.svg`
src=`${getPublicDirUrl()}images/10x-logo.svg`
alt="10x Forms Platform home"
width="72"
height="34"
Expand Down
2 changes: 1 addition & 1 deletion apps/spotlight/src/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const getStorybookUrl = () => {
return `${context.baseUrl}design/index.html`;
};

export const getBaseUrl = () => {
export const getPublicDirUrl = () => {
const context = getAppContext();
return context.baseUrl;
};
Expand Down

0 comments on commit 586fab5

Please sign in to comment.