Skip to content

Commit

Permalink
add imgPrefix to Hero and logo
Browse files Browse the repository at this point in the history
  • Loading branch information
jojortz committed Jan 11, 2024
1 parent 7f58fd8 commit 45d4334
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 0 additions & 2 deletions app/company/about-us/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
import PageHero from "@/app/components/hero/PageHero";
import Button from "../../components/Button";
import Container from "../../components/Container";
import Heading from "../../components/Heading";
import Section from "@/app/components/Section";
import Image from "next/image";

const sections = [
{
Expand Down
3 changes: 2 additions & 1 deletion app/components/hero/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import Container from "../Container";
import Image from 'next/image';
import { useTypingEffect } from "@/app/hooks/useTypingEffect";
import { imgPrefix } from "@/app/hooks/useImgPrefix";

interface HeroProps {
title: string;
Expand All @@ -17,7 +18,7 @@ const Hero: React.FC<HeroProps> = ({ title, descriptions, center, image }) => {
<Container styles="h-[85vh]">
{image &&
<Image
src={image}
src={imgPrefix + image}
alt="Hero"
fill
style={{
Expand Down
3 changes: 2 additions & 1 deletion app/components/navbar/Logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import Image from 'next/image';
import { useRouter } from 'next/navigation';
import { imgPrefix } from '@/app/hooks/useImgPrefix';

interface LogoProps {
small?: boolean;
Expand All @@ -16,7 +17,7 @@ const Logo: React.FC<LogoProps> = ({small}) => {
className="cursor-pointer"
height={small ? '100' : '175'}
width={small ? '100' : '175'}
src="/images/logo.png"
src={imgPrefix + '/images/logo.png'}
onClick={() => router.push('/')}
/>
)
Expand Down
3 changes: 3 additions & 0 deletions app/hooks/useImgPrefix.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const imgPrefix = process.env.NEXT_PUBLIC_BASE_PATH || '';

export { imgPrefix };

0 comments on commit 45d4334

Please sign in to comment.