Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Genesys Website
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
21
Issues
21
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Genesys PGR
Genesys Website
Commits
a2445eed
Commit
a2445eed
authored
Apr 12, 2019
by
Oleksii Savran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Links on accession browser tabs
parent
51a04e94
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
14 deletions
+16
-14
src/ui/common/Tabs.tsx
src/ui/common/Tabs.tsx
+16
-14
No files found.
src/ui/common/Tabs.tsx
View file @
a2445eed
...
...
@@ -7,9 +7,7 @@ import * as React from 'react';
import
{
translate
}
from
'
react-i18next
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
Link
}
from
'
react-router-dom
'
;
import
{
bindActionCreators
}
from
'
redux
'
;
import
{
navigateTo
}
from
'
actions/navigation
'
;
import
MuiTabs
from
'
@material-ui/core/Tabs
'
;
import
MuiTab
from
'
@material-ui/core/Tab
'
;
import
{
withStyles
}
from
'
@material-ui/core/styles
'
;
...
...
@@ -62,6 +60,9 @@ const styles = (theme) => ({
},
tabsArea
:
{
alignSelf
:
'
flex-end
'
as
'
flex-end
'
,
'
& a
'
:
{
color
:
'
black
'
,
}
}
});
/*tslint:enable*/
...
...
@@ -83,7 +84,7 @@ class Tab extends React.Component<ITabProps, any> {
class
Tabs
extends
React
.
Component
<
any
>
{
public
render
()
{
const
{
tab
,
children
,
navigateTo
,
actions
,
classes
,
t
}
=
this
.
props
;
const
{
tab
,
children
,
actions
,
classes
,
t
}
=
this
.
props
;
const
tabs
=
(
children
as
Tab
[]).
map
((
ch
)
=>
{
return
{
...
...
@@ -97,15 +98,20 @@ class Tabs extends React.Component<any> {
return
t
.
name
===
tab
;
})
||
0
;
const
tabChange
=
(
e
,
index
)
=>
{
navigateTo
(
tabs
[
index
].
to
);
};
return
(
<
Grid
container
className
=
{
`pr-10
${
classes
.
root
}
`
}
>
<
Grid
item
className
=
{
`float-left
${
classes
.
tabsArea
}
`
}
>
<
MuiTabs
value
=
{
currentTab
}
indicatorColor
=
"primary"
onChange
=
{
tabChange
}
>
{
tabs
.
map
((
tab
)
=>
<
MuiTab
key
=
{
tab
.
to
}
label
=
{
typeof
tab
.
label
===
'
string
'
?
t
(
tab
.
label
)
:
tab
.
label
}
/>)
}
<
MuiTabs
value
=
{
currentTab
}
indicatorColor
=
"primary"
>
{
tabs
.
map
((
tab
)
=>
{
return
(
<
MuiTab
key
=
{
tab
.
to
}
label
=
{
typeof
tab
.
label
===
'
string
'
?
t
(
tab
.
label
)
:
tab
.
label
}
component
=
{
Link
as
any
}
{
...
tab
}
/>
);
})
}
</
MuiTabs
>
</
Grid
>
<
Grid
item
className
=
{
`float-right
${
classes
.
actionsArea
}
`
}
>
...
...
@@ -121,10 +127,6 @@ const mapStateToProps = (state, ownProps) => ({
foo
:
ownProps
,
});
const
mapDispatchToProps
=
(
dispatch
)
=>
bindActionCreators
({
navigateTo
,
},
dispatch
);
const
tabs
=
translate
()(
connect
(
mapStateToProps
,
mapDispatchToProps
)(
withStyles
(
styles
)(
Tabs
)));
const
tabs
=
translate
()(
connect
(
mapStateToProps
,
null
)(
withStyles
(
styles
)(
Tabs
)));
export
{
tabs
as
default
,
Tab
};
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