refactor(config): improve projectConfig file with types
This commit is contained in:
parent
5a82f96c7d
commit
2d2ef2457d
8
types/projectConfig.ts
Normal file
8
types/projectConfig.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
type PCKeys = 'shortName' | 'longName' | 'description' | 'url' | 'color'
|
||||||
|
type PCIconsKeys = 'default' | 'image' | 'apple' | '16_16' | '32_32'
|
||||||
|
|
||||||
|
type PCProps = Record<PCKeys, string>
|
||||||
|
|
||||||
|
export interface PCDefaultValues extends PCProps {
|
||||||
|
icons: Record<PCIconsKeys, string>
|
||||||
|
}
|
@ -1,33 +1,16 @@
|
|||||||
type PCProps = 'shortName' | 'longName' | 'description' | 'url' | 'color'
|
import { PCDefaultValues } from 'types/projectConfig'
|
||||||
type PCDefaultValues = Record<PCProps, string>
|
|
||||||
|
|
||||||
const projectDefaultConfigValues: PCDefaultValues = {
|
export const projectConfig: PCDefaultValues = {
|
||||||
shortName: 'Unknown project name',
|
shortName: 'Unknown project name',
|
||||||
longName: 'Unknown project name',
|
longName: 'Unknown project name',
|
||||||
description: 'Unknown project description',
|
description: 'Unknown project description',
|
||||||
url: 'Unknown project url',
|
url: 'Unknown project url',
|
||||||
color: '#FF0000'
|
color: '#FF0000',
|
||||||
}
|
icons: {
|
||||||
|
image: '/images/Logo.png',
|
||||||
export const projectConfig = {
|
default: '/icons/favicons/favicon.ico',
|
||||||
shortName:
|
apple: '/icons/favicons/apple-touch-icon.png',
|
||||||
process.env.NEXT_PUBLIC_PROJECT_SHORT_NAME != null
|
'16_16': '/icons/favicons/favicon-16x16.png',
|
||||||
? process.env.NEXT_PUBLIC_PROJECT_SHORT_NAME
|
'32_32': '/icons/favicons/favicon-32x32.png'
|
||||||
: projectDefaultConfigValues.shortName,
|
}
|
||||||
longName:
|
|
||||||
process.env.NEXT_PUBLIC_PROJECT_LONG_NAME != null
|
|
||||||
? process.env.NEXT_PUBLIC_PROJECT_LONG_NAME
|
|
||||||
: projectDefaultConfigValues.longName,
|
|
||||||
description:
|
|
||||||
process.env.NEXT_PUBLIC_PROJECT_DESCRIPTION != null
|
|
||||||
? process.env.NEXT_PUBLIC_PROJECT_DESCRIPTION
|
|
||||||
: projectDefaultConfigValues.description,
|
|
||||||
url:
|
|
||||||
process.env.NEXT_PUBLIC_PROJECT_URL != null
|
|
||||||
? process.env.NEXT_PUBLIC_PROJECT_URL
|
|
||||||
: projectDefaultConfigValues.url,
|
|
||||||
color:
|
|
||||||
process.env.NEXT_PUBLIC_PROJECT_COLOR != null
|
|
||||||
? process.env.NEXT_PUBLIC_PROJECT_COLOR
|
|
||||||
: projectDefaultConfigValues.color
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user