Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Embedded Genesys UI
Commits
2c549018
Commit
2c549018
authored
Nov 30, 2020
by
Matija Obreza
Browse files
Fix: Page title component should not use t()
parent
170aa79b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/ui/common/PageTitle.tsx
View file @
2c549018
import
*
as
React
from
'
react
'
;
import
{
WithTranslation
,
withTranslation
}
from
'
react-i18next
'
;
import
{
Helmet
}
from
'
react-helmet-async
'
;
import
{
stripHtml
}
from
'
@genesys/client/utilities
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
WithConfig
}
from
'
config/config
'
;
interface
IPageTitle
extends
React
.
ClassAttributes
<
any
>
,
WithTranslation
{
interface
IPageTitle
extends
React
.
ClassAttributes
<
any
>
{
title
:
string
;
description
?:
string
;
}
class
PageTitle
extends
React
.
Component
<
IPageTitle
&
WithConfig
,
any
>
{
public
constructor
(
props
,
context
)
{
super
(
props
,
context
);
}
public
render
()
{
const
{
appConfig
:
{
title
:
appTitle
},
title
,
description
,
t
}
=
this
.
props
;
const
{
appConfig
:
{
title
:
appTitle
},
title
,
description
}
=
this
.
props
;
return
(
<
Helmet
>
<
title
>
{
t
(
stripHtml
(
appTitle
?
(
appTitle
+
'
'
+
title
).
trim
()
:
title
)
)
}
</
title
>
{
description
&&
<
meta
name
=
"description"
content
=
{
t
(
description
)
}
/>
}
<
title
>
{
stripHtml
(
appTitle
?
(
appTitle
+
'
'
+
title
).
trim
()
:
title
)
}
</
title
>
{
description
&&
<
meta
name
=
"description"
content
=
{
stripHtml
(
description
)
}
/>
}
</
Helmet
>
);
}
...
...
@@ -31,4 +27,4 @@ const mapStateToProps = (state) => ({
appConfig
:
state
.
appConfig
.
config
,
});
export
default
connect
(
mapStateToProps
)(
withTranslation
()(
PageTitle
)
)
;
export
default
connect
(
mapStateToProps
)(
PageTitle
);
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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