-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: Update installation and cache actions in GitHub workflows * chore: Update installation and cache actions in GitHub workflows * chore: Fix if condition in GitHub workflows to compare string values * refactor: Optimize GameMusic component for better performance The GameMusic component has been refactored to improve performance. Instead of rendering the GameAudio component conditionally within a fragment, it now directly returns the GameAudio component if the 'music' prop is truthy, and returns null otherwise. This change reduces unnecessary rendering and improves the efficiency of the component. * 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. * Update manifest.json path in index.html to fix broken link * chore: Update font import in layout.tsx for better performance This commit updates the font import in the layout.tsx file to improve performance. The deprecated 'inter' font import has been removed and replaced with a local font import using the 'next/font/local' package. This change reduces unnecessary network requests and improves the efficiency of the component.
- Loading branch information
Showing
21 changed files
with
92 additions
and
79 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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: "📥 Install" | ||
description: "📥 Install dependencies" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: "💽 Restore node_modules cache" | ||
uses: actions/cache@v4 | ||
id: cache-node-modules | ||
with: | ||
path: "node_modules" | ||
key: ${{ runner.os }}-${{ runner.arch }}-node-modules-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ runner.arch }}-node-modules- | ||
- name: "📥 Install dependencies" | ||
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }} | ||
shell: bash | ||
run: yarn install --frozen-lockfile |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: "📥 NestJS cache" | ||
description: "📥 Cache NestJS dependencies" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: "💽 Restore .next/cache cache" | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ github.workspace }}/.next/cache | ||
key: ${{ runner.os }}-${{ runner.arch }}-nextjs-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ runner.arch }}-nextjs-${{ hashFiles('**/yarn.lock') }}- |
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
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
File renamed without changes.
File renamed without changes
File renamed without changes.
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
File renamed without changes
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,25 @@ | ||
import type {Metadata} from 'next'; | ||
import {Inter} from 'next/font/google'; | ||
import './globals.css'; | ||
import localFont from 'next/font/local'; | ||
import {PropsWithChildren} from 'react'; | ||
import {environment} from '../environment/environment'; | ||
|
||
const inter = Inter({subsets: ['latin']}); | ||
const segment = localFont({ | ||
src: './Segment7-4Gml.otf', | ||
variable: '--font-segment' | ||
}); | ||
|
||
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 className={segment.className}>{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
File renamed without changes.
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
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,27 +1,16 @@ | ||
const endsInSlash = (str: string): string => str.endsWith('/') ? str : `${str}/`; | ||
|
||
export interface Environment { | ||
analytics: string; | ||
|
||
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 | ||
}; |
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