Refactor utils.jsx

This commit is contained in:
Ariful Alam
2022-07-18 12:40:51 +06:00
parent caff2ce258
commit 66bd370f34

View File

@@ -136,11 +136,11 @@ export const sanitizeConfig = (config) => {
return { return {
github: { github: {
username: config.github.username, username: config?.github?.username || '',
sortBy: config.github.sortBy || 'stars', sortBy: config?.github?.sortBy || 'stars',
limit: config.github.limit || 8, limit: config?.github?.limit || 8,
exclude: { exclude: {
forks: config?.github?.exclude?.forks, forks: config?.github?.exclude?.forks || false,
projects: config?.github?.exclude?.projects || [], projects: config?.github?.exclude?.projects || [],
}, },
}, },
@@ -174,8 +174,9 @@ export const sanitizeConfig = (config) => {
}, },
themeConfig: { themeConfig: {
defaultTheme: config?.themeConfig?.defaultTheme || themes[0], defaultTheme: config?.themeConfig?.defaultTheme || themes[0],
disableSwitch: config?.themeConfig?.disableSwitch, disableSwitch: config?.themeConfig?.disableSwitch || false,
respectPrefersColorScheme: config?.themeConfig?.respectPrefersColorScheme, respectPrefersColorScheme:
config?.themeConfig?.respectPrefersColorScheme || false,
themes: themes, themes: themes,
customTheme: customTheme, customTheme: customTheme,
}, },