This repository has been archived by the owner on Jul 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Add "About Orion" window #172
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<title>Siderus Orion</title> | ||
</head> | ||
|
||
<body> | ||
<div id="host"></div> | ||
</body> | ||
|
||
<!-- Electron Javascript --> | ||
<script src="loader.js" charset="utf-8"></script> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Spinner from 'spin.js' | ||
|
||
var target = document.getElementById('host') | ||
new Spinner().spin(target) | ||
|
||
// After the spinner is rendered, we require the actual component | ||
setTimeout(() => require('./renderer.jsx'), 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import React from 'react' | ||
import ReactDom from 'react-dom' | ||
import { shell } from 'electron' | ||
import styled from 'styled-components' | ||
import 'react-photonkit' | ||
|
||
import { trackEvent } from '../../stats' | ||
import OrionLogo from '../../../docs/logo.svg' | ||
import SiderusLogo from '../../../docs/siderus-logo.svg' | ||
import pjson from '../../../package.json' | ||
|
||
const Window = styled.div` | ||
height: 100vh; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
padding: 24px; | ||
` | ||
const Orion = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
margin-bottom: 30px; | ||
` | ||
|
||
const SiderusLink = styled.div` | ||
position: absolute; | ||
bottom: 0; | ||
right: 0; | ||
margin: 10px 24px; | ||
|
||
display: flex; | ||
align-items: center; | ||
svg { | ||
margin-left: 5px; | ||
} | ||
&, svg, path, g { | ||
cursor: pointer; | ||
} | ||
` | ||
|
||
class AboutWindow extends React.Component { | ||
componentDidMount () { | ||
trackEvent('AboutWindowOpen') | ||
} | ||
|
||
render () { | ||
return ( | ||
<Window> | ||
<Orion> | ||
<OrionLogo width='150px' /> | ||
<h2>Siderus Orion</h2> | ||
<p>App version: {pjson.version}<br />IPFS version: {pjson.ipfsVersion} (go-ipfs)</p> | ||
</Orion> | ||
<SiderusLink onClick={event => shell.openExternal('https://siderus.io')}> | ||
Copyright © 2018 {pjson.author.name} <SiderusLogo width='30px' height='30px' /> | ||
</SiderusLink> | ||
</Window> | ||
) | ||
} | ||
} | ||
|
||
ReactDom.render(<AboutWindow />, document.querySelector('#host')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import path from 'path' | ||
import url from 'url' | ||
|
||
import { BrowserWindow, remote } from 'electron' | ||
|
||
import isRenderer from 'is-electron-renderer' | ||
|
||
// Allow us to use create() in both electron windows and main process | ||
let BrowserWindowClass | ||
if (isRenderer) { | ||
BrowserWindowClass = remote.BrowserWindow | ||
} else { | ||
BrowserWindowClass = BrowserWindow | ||
} | ||
|
||
module.exports = {} | ||
|
||
module.exports.create = function createResolveIPNSWindow (app) { | ||
// Create the browser modal window. | ||
let thisWindow = new BrowserWindowClass({ | ||
width: 600, | ||
minWidth: 600, | ||
height: 400, | ||
minHeight: 400, | ||
|
||
maximizable: false, | ||
resizable: false, | ||
fullscreenable: false, | ||
icon: path.join(__dirname, '../../../docs/logo.png'), | ||
|
||
show: false, | ||
webPreferences: { | ||
preload: path.join(__dirname, '../../lib/report/preload.js') | ||
} | ||
}) | ||
|
||
// Show menu only on StorageList | ||
thisWindow.setMenu(null) | ||
|
||
// Show the window only when ready | ||
thisWindow.once('ready-to-show', () => { | ||
thisWindow.show() | ||
}) | ||
|
||
// Load the index.html of the app. | ||
thisWindow.loadURL(url.format({ | ||
pathname: path.join(__dirname, 'index.html'), | ||
protocol: 'file:', | ||
slashes: true | ||
})) | ||
|
||
// Emitted when the window is closed. | ||
thisWindow.on('closed', () => { | ||
// Dereference the window object, usually you would store windows | ||
// in an array if your app supports multi windows, this is the time | ||
// when you should delete the corresponding element. | ||
thisWindow = null | ||
}) | ||
|
||
return thisWindow | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess macOS Users are expecting the About to be under the "Orion" Menu (as it was).
Can we add About Orion here just for Win+Gnu and under the Mac-only menu for Mac?