added window.openLink() for support electron desktop to open new window with the default os browser

This commit is contained in:
srgooglo 2020-10-07 18:17:15 +02:00
parent af1c26aa0c
commit aa75f8f9ed
4 changed files with 17 additions and 11 deletions

View File

@ -1,6 +1,5 @@
module.exports = {
gitlab: "https://gitlab.com/rstudio-development/comty-development",
github:"https://github.com/srgooglo/Comty-Development",
trellojoin: "https://trello.com/invite/b/UbwvlG1I/2bc02725b9b210d2e9e9a82c5040b895/comty-development",
github:"https://github.com/srgooglo/comty",
trello: "https://trello.com/invite/b/UbwvlG1I/2bc02725b9b210d2e9e9a82c5040b895/comty-development",
patreon: "https://www.patreon.com/rstudio",
}

View File

@ -1,6 +1,5 @@
{
"gitlab": "https://gitlab.com/rstudio-development/comty-development",
"github":"https://github.com/srgooglo/Comty-Development",
"github":"https://github.com/srgooglo/comty",
"trellojoin": "https://trello.com/invite/b/UbwvlG1I/2bc02725b9b210d2e9e9a82c5040b895/comty-development",
"patreon": "https://www.patreon.com/rstudio"
}

View File

@ -35,6 +35,13 @@ class PrimaryLayout extends React.Component {
}, false)
// include API extensions
window.openLink = (e) => {
if(this.props.app.embedded){
this.props.app.electron.shell.openExternal(e)
}else{
window.open(e)
}
}
window.requireQuery = (require) =>{
return new Promise(resolve => {
this.props.dispatch({

View File

@ -6,24 +6,25 @@ import l from 'globals/links'
export default class AppAbout extends React.Component {
render() {
const handleClickLinks = (e) => {
const link = l[e]
link? window.openLink(link) : console.log("Link not available")
}
return <>
<About />
<antd.Card>
<div>
<h4>🎉 It's completely free and open source !</h4>
<h5>It is an impressive amount of work and effort, help us to continue offering quality services, you can support us from our patreon campaign.</h5>
<a href={l.patreon}><Icons.Patreon/> Support us with Patreon!</a>
<a onClick={() => handleClickLinks("patreon")}><Icons.Patreon/> Support us with Patreon!</a>
</div>
<antd.Divider dashed />
<div>
<h4>👨💻 You are developer? You can help us by joining our team!</h4>
<a href={l.gitlab}><Icons.Gitlab />Official Repository</a><br />
<a href={l.github}><Icons.GitHub />Mirror Repository</a><br />
<a href={l.trellojoin}><Icons.Trello />Join our Trello</a>
<a onClick={() => handleClickLinks("github")}><Icons.GitHub />Official Repository</a><br />
<a onClick={() => handleClickLinks("trello")}><Icons.Trello />Join our Trello</a>
</div>
</antd.Card>
</>
}
}