-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Remove deprecated code and environment variables
This commit removes deprecated code and environment variables that are no longer used in the application. The `.env`, `.env.local`, and `.env.production` files have been updated to remove the `NEXT_PUBLIC_BASE` and `NEXT_PUBLIC_ANALYTICS` variables. Additionally, the `inter` font import in the `layout.tsx` file has been removed, as it is no longer needed. The `useTitle` hook in the `useTitle.tsx` file has been marked as deprecated and a comment has been added to suggest using Next.js metadata instead. Finally, the `base` property in the `environment.ts` file has been removed, as it is no longer used.
- Loading branch information
Showing
6 changed files
with
10 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
NEXT_PUBLIC_BRAND_NAME=Tetromino | ||
NEXT_PUBLIC_GITHUB=https://github.com/reactgular/tetromino | ||
NEXT_PUBLIC_STORAGE_KEY=tetromino | ||
# Base path for loading audio files | ||
NEXT_PUBLIC_BASE=/tetromino | ||
NEXT_PUBLIC_ANALYTICS= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
NEXT_PUBLIC_BASE=/ | ||
NEXT_PUBLIC_ANALYTICS= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# Please change to your Google Analytics ID | ||
NEXT_PUBLIC_ANALYTICS=UA-141015392-3 | ||
NEXT_PUBLIC_ANALYTICS= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,19 @@ | ||
import type {Metadata} from 'next'; | ||
import {Inter} from 'next/font/google'; | ||
import './globals.css'; | ||
|
||
const inter = Inter({subsets: ['latin']}); | ||
import {PropsWithChildren} from 'react'; | ||
import {environment} from '../environment/environment'; | ||
|
||
export const metadata: Metadata = { | ||
title: 'Create Next App', | ||
title: `${environment.brandName}`, | ||
description: 'Generated by create next app' | ||
}; | ||
|
||
export default function RootLayout({ | ||
children | ||
}: Readonly<{ | ||
children: React.ReactNode; | ||
}>) { | ||
}: Readonly<PropsWithChildren>) { | ||
return ( | ||
<html lang="en"> | ||
<body className={inter.className}>{children}</body> | ||
<body>{children}</body> | ||
</html> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,16 @@ | ||
const endsInSlash = (str: string): string => str.endsWith('/') ? str : `${str}/`; | ||
|
||
export interface Environment { | ||
analytics: string; | ||
|
||
/** | ||
* @deprecated use basePath from router instead | ||
*/ | ||
base: string; | ||
|
||
brandName: string; | ||
|
||
github: string; | ||
|
||
storageKey: string; | ||
|
||
/** | ||
* @deprecated | ||
*/ | ||
version: string; | ||
} | ||
|
||
export const environment: Environment = { | ||
analytics: process.env.NEXT_PUBLIC_ANALYTICS as string, | ||
brandName: process.env.NEXT_PUBLIC_BRAND_NAME as string, | ||
github: process.env.NEXT_PUBLIC_GITHUB as string, | ||
storageKey: process.env.NEXT_PUBLIC_STORAGE_KEY as string, | ||
version: process.env.NEXT_PUBLIC_VERSION as string, | ||
base: endsInSlash(process.env.NEXT_PUBLIC_BASE as string ?? '/') | ||
storageKey: process.env.NEXT_PUBLIC_STORAGE_KEY as string | ||
}; |