-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1798 from epam/develop
Updated query string 'theme'
- Loading branch information
Showing
26 changed files
with
1,276 additions
and
1,612 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
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
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,7 @@ | ||
import { TTheme } from '../common/docs'; | ||
import { getQuery } from './getQuery'; | ||
|
||
const DEFAULT_THEME = TTheme.loveship; | ||
export const getCurrentTheme: () => TTheme = () => { | ||
return getQuery('theme') ?? (localStorage.getItem('app-theme') as TTheme) ?? DEFAULT_THEME; | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* Underlying test runner | ||
* @type {{mock: (function(string, function(): *=): void), isMockFunction: (function(function(): *): boolean), requireActual: (function(string): *)}|undefined} | ||
*/ | ||
export const testRunner = getTestRunner(); | ||
|
||
/** | ||
* | ||
* @returns {{ | ||
* mock: (moduleName: string, factory?: () => unknown) => void | ||
* isMockFunction: (fn: () => unknown) => boolean | ||
* requireActual: (moduleName: string) => any | ||
* } | undefined} | ||
*/ | ||
function getTestRunner() { | ||
// @ts-ignore | ||
if (typeof jest !== 'undefined') { | ||
return jest; | ||
} else { // @ts-ignore | ||
if (typeof vi !== 'undefined') { | ||
// @ts-ignore | ||
// eslint-disable-next-line no-undef | ||
return vi; | ||
} | ||
} | ||
// Neither "jest" nor "vi" was found in global scope. | ||
// Only Jest and Vitest are currently supported. | ||
} |
Oops, something went wrong.