Skip to content

Commit

Permalink
refactor: 🎨 add homepage URL to config and use it in Link
Browse files Browse the repository at this point in the history
  • Loading branch information
MeesoPost authored and AliKdhim87 committed Oct 11, 2024
1 parent 0876b85 commit 8f793bb
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { Main } from '@/components/Main';
import { SearchBar } from '@/components/SearchBar';
import 'react-loading-skeleton/dist/skeleton.css';
import { GET_OPEN_FORMS_TEMPLATE } from '@/query';
import { buildAlternateLinks, createStrapiURL, fetchData } from '@/util';
import { buildAlternateLinks, config, createStrapiURL, fetchData } from '@/util';
import { ComponentComponentsUtrechtNavigation, GetTemplateDataQuery } from '../../../../gql/graphql';
import { getLiveSuggestions, onSearchSubmitAction } from '../../actions';
import { useTranslation } from '../../i18n/index';
Expand Down Expand Up @@ -179,7 +179,7 @@ const RootLayout = async ({ children, params: { locale } }: LayoutProps) => {
<GridCell xs={6}>
<div className="utrecht-logo-wrapper">
<Link
href="https://www.utrecht.nl/"
href={config.homePageURL}
className="utrecht-link utrecht-link--html-a utrecht-link--box-content"
prefetch={false}
aria-label={
Expand Down
4 changes: 2 additions & 2 deletions apps/pdc-frontend/src/app/[locale]/(rootLayout)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { GoogleTranslate } from '@/components/GoogleTranslate';
import { Main } from '@/components/Main';
import { SearchBar } from '@/components/SearchBar';
import { GET_TEMPLATE } from '@/query';
import { buildAlternateLinks, createStrapiURL, fetchData } from '@/util';
import { buildAlternateLinks, config, createStrapiURL, fetchData } from '@/util';
import {
ComponentComponentsUtrechtFooter,
ComponentComponentsUtrechtNavigation,
Expand Down Expand Up @@ -163,7 +163,7 @@ const RootLayout = async ({ children, params: { locale } }: LayoutProps) => {
<GridCell xs={6}>
<div className="utrecht-logo-wrapper">
<Link
href={'https://www.utrecht.nl/'}
href={config.homePageURL}
className="utrecht-link utrecht-link--html-a utrecht-link--box-content"
prefetch={false}
aria-label={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { Main } from '@/components/Main';
import { Markdown } from '@/components/Markdown';
import { GET_ARTICLE_BY_SLUG } from '@/query';
import { SiblingData } from '@/types';
import { config } from '@/util';
import { getImageBaseUrl } from '@/util/getImageBaseUrl';
import { getNavData } from '@/util/getNavData';

Expand Down Expand Up @@ -149,7 +150,7 @@ const ArticlePage = async ({ params: { locale, articleSlug } }: Params) => {
<Header
navList={navList}
logo={{
href: 'https://www.utrecht.nl/',
href: config.homePageURL,
ariaLabel:
t('logo.aria-label', {
defaultValue: 'Gemeente Utrecht logo, ga naar homepagina',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Header, Heading1, Page, PageContent, RichText } from '@/components';
import { Main } from '@/components/Main';
import { Markdown } from '@/components/Markdown';
import { GET_NOT_FOUND_PAGE } from '@/query';
import { config } from '@/util';
import { createStrapiURL } from '@/util/createStrapiURL';
import { fetchData } from '@/util/fetchData';
import { getImageBaseUrl } from '@/util/getImageBaseUrl';
Expand All @@ -25,7 +26,7 @@ const NotFoundPage = async () => {
<Header
navList={navList}
logo={{
href: 'https://www.utrecht.nl/',
href: config.homePageURL,
ariaLabel:
t('logo.aria-label', {
defaultValue: 'Gemeente Utrecht logo, ga naar homepagina',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { Card } from '@/components/Card';
import { Main } from '@/components/Main';
import { GET_THEME_BY_SLUG } from '@/query';
import { SiblingData } from '@/types';
import { config } from '@/util';
import { getImageBaseUrl } from '@/util/getImageBaseUrl';
import { getNavData } from '@/util/getNavData';

Expand Down Expand Up @@ -131,7 +132,7 @@ const ThemePage = async ({ params: { locale, themeSlug } }: Params) => {
<Header
navList={navList}
logo={{
href: 'https://www.utrecht.nl/',
href: config.homePageURL,
ariaLabel:
t('logo.aria-label', {
defaultValue: 'Gemeente Utrecht logo, ga naar homepagina',
Expand Down
3 changes: 2 additions & 1 deletion apps/vth-frontend/src/app/[locale]/(rootLayout)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import '@utrecht/design-tokens/dist/index.css';
import 'react-loading-skeleton/dist/skeleton.css';
import { Editoria11y } from '@/components/Editoria11y';
import { Main } from '@/components/Main';
import { config } from '@/util';
import { getNavData } from '@/util/getNavData';
import '@frameless/ui/dist/bundle.css';
import '../../../styles/globals.css';
Expand Down Expand Up @@ -130,7 +131,7 @@ const RootLayout = async ({ children, params: { locale } }: LayoutProps) => {
<Header
navList={navList}
logo={{
href: 'https://www.utrecht.nl/',
href: config.homePageURL,
ariaLabel:
t('logo.aria-label', {
defaultValue: 'Gemeente Utrecht logo, ga naar homepagina',
Expand Down

0 comments on commit 8f793bb

Please sign in to comment.