Skip to content

Commit

Permalink
Switch default BgImg to static import, use custom absolute path via t…
Browse files Browse the repository at this point in the history
…sconfig addition
  • Loading branch information
Xevion committed Apr 3, 2023
1 parent 78aa7f7 commit f1e2f91
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/components/layout/RootLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Toaster } from "react-hot-toast";
import { classNames } from "@/utils/helpers";
import Footer from "@/components/util/Footer";
import Image, { StaticImageData } from "next/image";
import BgImg from "@/img/bg.png";

type RootLayoutProps = {
className?: string;
Expand Down Expand Up @@ -38,7 +39,7 @@ const RootLayout: FunctionComponent<RootLayoutProps> = ({
footer = footer ?? true;

if (backgroundImage === undefined) {
backgroundImage = "/img/bg.png";
backgroundImage = BgImg;
backgroundClass = "brightness-[0.60]";
}

Expand Down
7 changes: 4 additions & 3 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import OpenGraph from "@/components/common/OpenGraph";
import useOpenGraph from "@/components/common/useOpenGraph";
import RootLayout from "@/components/layout/RootLayout";
import Balancer from "react-wrap-balancer";
import BgDark from "../../public/img/bg-dark.png";
import BgImgDark from "@/img/bg-dark.png";

const Home: NextPage = () => {
const ogp = useOpenGraph({
Expand All @@ -25,7 +25,7 @@ const Home: NextPage = () => {
<RootLayout
innerClassName="text-white flex items-center justify-center"
backgroundClass="brightness-90"
backgroundImage={BgDark}
backgroundImage={BgImgDark}
>
<div className="w-full px-2 !mb-8 md:!mb-12 lg:!mb-20 max-w-[90rem] h-full flex flex-col items-center align-middle mx-auto px-4">
<div className="flex flex-col items-center">
Expand All @@ -44,13 +44,14 @@ const Home: NextPage = () => {
</h1>
<h4 className="mt-4 font-inter text-xl text-center text-zinc-200">
<Balancer>
The Premier Student Computer Science Organization at{" "}
We are the Premier Computer Science Organization at{" "}
<span
className="font-bold font-roboto font-white tracking-tighter"
title="The University of Texas at San Antonio"
>
UTSA
</span>
, run & staffed by students.
</Balancer>
</h4>
</div>
Expand Down
3 changes: 3 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
"noUncheckedIndexedAccess": true,
"baseUrl": "./src/",
"paths": {
"@/img/*": [
"../public/img/*"
],
"@/config/*": [
"../config/*"
],
Expand Down

1 comment on commit f1e2f91

@vercel
Copy link

@vercel vercel bot commented on f1e2f91 Apr 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.