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
891b84e9
Unverified
Commit
891b84e9
authored
Jan 13, 2020
by
Peter Holmberg
Committed by
GitHub
Jan 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: Tab icons not showing (#21465)
* revert back to i element * snap
parent
30eef761
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
5 deletions
+12
-5
packages/grafana-ui/src/components/Tabs/Tab.tsx
+2
-4
packages/grafana-ui/src/components/Tabs/TabsBar.story.tsx
+6
-1
public/app/core/components/PageHeader/PageHeader.tsx
+1
-0
public/app/features/admin/__snapshots__/ServerStats.test.tsx.snap
+3
-0
No files found.
packages/grafana-ui/src/components/Tabs/Tab.tsx
View file @
891b84e9
import
React
,
{
FC
}
from
'react'
;
import
React
,
{
FC
}
from
'react'
;
import
{
cx
}
from
'emotion'
;
import
{
cx
}
from
'emotion'
;
import
{
Icon
}
from
'..'
;
import
{
useTheme
}
from
'../../themes'
;
import
{
useTheme
}
from
'../../themes'
;
import
{
IconType
}
from
'../Icon/types'
;
import
{
getTabsStyle
}
from
'./styles'
;
import
{
getTabsStyle
}
from
'./styles'
;
export
interface
TabProps
{
export
interface
TabProps
{
label
:
string
;
label
:
string
;
active
?:
boolean
;
active
?:
boolean
;
icon
?:
IconType
;
icon
?:
string
;
onChangeTab
:
()
=>
void
;
onChangeTab
:
()
=>
void
;
}
}
...
@@ -18,7 +16,7 @@ export const Tab: FC<TabProps> = ({ label, active, icon, onChangeTab }) => {
...
@@ -18,7 +16,7 @@ export const Tab: FC<TabProps> = ({ label, active, icon, onChangeTab }) => {
return
(
return
(
<
li
className=
{
cx
(
tabsStyles
.
tabItem
,
active
&&
tabsStyles
.
activeStyle
)
}
onClick=
{
onChangeTab
}
>
<
li
className=
{
cx
(
tabsStyles
.
tabItem
,
active
&&
tabsStyles
.
activeStyle
)
}
onClick=
{
onChangeTab
}
>
{
icon
&&
<
Icon
n
ame=
{
icon
}
/>
}
{
icon
&&
<
i
classN
ame=
{
icon
}
/>
}
{
label
}
{
label
}
</
li
>
</
li
>
);
);
...
...
packages/grafana-ui/src/components/Tabs/TabsBar.story.tsx
View file @
891b84e9
...
@@ -26,7 +26,12 @@ const tabs = [
...
@@ -26,7 +26,12 @@ const tabs = [
export
const
Simple
=
()
=>
{
export
const
Simple
=
()
=>
{
const
VISUAL_GROUP
=
'Visual options'
;
const
VISUAL_GROUP
=
'Visual options'
;
// ---
// ---
const
icon
=
select
(
'Icon'
,
{
None
:
undefined
,
Heart
:
'heart'
,
Star
:
'star'
,
User
:
'user'
},
undefined
,
VISUAL_GROUP
);
const
icon
=
select
(
'Icon'
,
{
None
:
undefined
,
Heart
:
'fa fa-heart'
,
Star
:
'fa fa-star'
,
User
:
'fa fa-user'
},
undefined
,
VISUAL_GROUP
);
return
(
return
(
<
UseState
initialState=
{
tabs
}
>
<
UseState
initialState=
{
tabs
}
>
{
(
state
,
updateState
)
=>
{
{
(
state
,
updateState
)
=>
{
...
...
public/app/core/components/PageHeader/PageHeader.tsx
View file @
891b84e9
...
@@ -64,6 +64,7 @@ const Navigation = ({ main }: { main: NavModelItem }) => {
...
@@ -64,6 +64,7 @@ const Navigation = ({ main }: { main: NavModelItem }) => {
label=
{
child
.
text
}
label=
{
child
.
text
}
active=
{
child
.
active
}
active=
{
child
.
active
}
key=
{
`${child.url}-${index}`
}
key=
{
`${child.url}-${index}`
}
icon=
{
child
.
icon
}
onChangeTab=
{
()
=>
goToUrl
(
index
)
}
onChangeTab=
{
()
=>
goToUrl
(
index
)
}
/>
/>
);
);
...
...
public/app/features/admin/__snapshots__/ServerStats.test.tsx.snap
View file @
891b84e9
...
@@ -100,6 +100,9 @@ exports[`ServerStats Should render table with stats 1`] = `
...
@@ -100,6 +100,9 @@ exports[`ServerStats Should render table with stats 1`] = `
className="css-b418eg"
className="css-b418eg"
onClick={[Function]}
onClick={[Function]}
>
>
<i
className="icon"
/>
Admin
Admin
</li>
</li>
</ul>
</ul>
...
...
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