Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
99658852
Commit
99658852
authored
Feb 21, 2019
by
Dominik Prokop
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed failing tests because of circular dependency
parent
75e9c1e8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
16 deletions
+18
-16
packages/grafana-ui/src/themes/ThemeContext.tsx
+1
-1
packages/grafana-ui/src/themes/getTheme.ts
+15
-0
packages/grafana-ui/src/themes/index.ts
+2
-15
No files found.
packages/grafana-ui/src/themes/ThemeContext.tsx
View file @
99658852
import
React
from
'react'
;
import
{
getTheme
}
from
'./
index
'
;
import
{
getTheme
}
from
'./
getTheme
'
;
import
{
GrafanaThemeType
,
Themeable
}
from
'../types/theme'
;
type
Omit
<
T
,
K
>
=
Pick
<
T
,
Exclude
<
keyof
T
,
K
>>
;
...
...
packages/grafana-ui/src/themes/getTheme.ts
0 → 100644
View file @
99658852
import
darkTheme
from
'./dark'
;
import
lightTheme
from
'./light'
;
import
{
GrafanaTheme
}
from
'../types/theme'
;
let
themeMock
:
((
name
?:
string
)
=>
GrafanaTheme
)
|
null
;
export
const
getTheme
=
(
name
?:
string
)
=>
(
themeMock
&&
themeMock
(
name
))
||
(
name
===
'light'
?
lightTheme
:
darkTheme
);
export
const
mockTheme
=
(
mock
:
(
name
?:
string
)
=>
GrafanaTheme
)
=>
{
themeMock
=
mock
;
return
()
=>
{
themeMock
=
null
;
};
};
packages/grafana-ui/src/themes/index.ts
View file @
99658852
import
darkTheme
from
'./dark'
;
import
lightTheme
from
'./light'
;
import
{
GrafanaTheme
}
from
'../types/theme'
;
import
{
ThemeContext
,
withTheme
}
from
'./ThemeContext'
;
import
{
getTheme
,
mockTheme
}
from
'./getTheme'
;
let
themeMock
:
((
name
?:
string
)
=>
GrafanaTheme
)
|
null
;
export
let
getTheme
=
(
name
?:
string
)
=>
(
themeMock
&&
themeMock
(
name
))
||
(
name
===
'light'
?
lightTheme
:
darkTheme
);
export
const
mockTheme
=
(
mock
:
(
name
?:
string
)
=>
GrafanaTheme
)
=>
{
themeMock
=
mock
;
return
()
=>
{
themeMock
=
null
;
};
};
export
{
ThemeContext
,
withTheme
};
export
{
ThemeContext
,
withTheme
,
mockTheme
,
getTheme
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment