-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
185 additions
and
108 deletions.
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
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 |
---|---|---|
@@ -1,10 +1,30 @@ | ||
import { contextBridge, ipcRenderer } from 'electron' | ||
import { IpcMainMessage, IpcRendererApi, Maybe, Payload } from '../types' | ||
import { | ||
AppInfo, | ||
ElectronApi, | ||
ExternalSite, | ||
IpcMainMessage, | ||
Maybe, | ||
Payload, | ||
} from '../types/types' | ||
|
||
const ipcRendererApi: IpcRendererApi = { | ||
invoke(channel: IpcMainMessage, payload?: Payload): Promise<Maybe<string[]>> { | ||
return ipcRenderer.invoke(channel, payload) | ||
const electronApi: ElectronApi = { | ||
async invoke( | ||
channel: IpcMainMessage, | ||
payload?: Payload | ||
): Promise<Maybe<string>> { | ||
const value: Maybe<string[]> = await ipcRenderer.invoke(channel, payload) | ||
if (!value) { | ||
return undefined | ||
} | ||
return value[0] | ||
}, | ||
getAppInfo(): Promise<AppInfo> { | ||
return ipcRenderer.invoke(IpcMainMessage.GET_APP_INFO) | ||
}, | ||
openExternal(url: ExternalSite) { | ||
ipcRenderer.send(IpcMainMessage.OPEN_EXTERNAL, url) | ||
}, | ||
} | ||
|
||
contextBridge.exposeInMainWorld('electron', { ipcRenderer: ipcRendererApi }) | ||
contextBridge.exposeInMainWorld('electron', electronApi) |
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 |
---|---|---|
@@ -1,5 +1,31 @@ | ||
import React from 'react' | ||
import { AppInfo, ExternalSite } from '../../types/types' | ||
import Logo from '../../../assets/app-icons/app-icon.iconset/icon_128x128.png' | ||
import ExternalLink from './components/ExternalLink' | ||
|
||
const AboutWindow = () => <div>About Window</div> | ||
interface Props { | ||
appInfo: AppInfo | ||
} | ||
|
||
const AboutWindow = ({ appInfo }: Props) => { | ||
document.title = `About ${appInfo.name}` | ||
|
||
return ( | ||
<main className='hero is-fullheight has-text-centered is-flex is-flex-direction-column is-justify-content-center is-align-items-center pb-2'> | ||
<img src={Logo} alt='Presto Parts Icon' className='image is-64x64' /> | ||
<p className='is-size-5 has-text-weight-bold'>{appInfo.name}</p> | ||
<p className='is-size-7'>{appInfo.version}</p> | ||
<p className='mt-3'>Orangize your sheet music by part</p> | ||
<p className='mt-2'> | ||
<ExternalLink url={ExternalSite.APP_WEBSITE}>Website</ExternalLink> | ||
</p> | ||
<p className='is-size-7 mt-3'> | ||
Navbar icons by{' '} | ||
<ExternalLink url={ExternalSite.ICONS_8}>icons8</ExternalLink> | ||
</p> | ||
<p className='is-size-7 mt-2'>Copyright © 2022 Colin A. Williams</p> | ||
</main> | ||
) | ||
} | ||
|
||
export default AboutWindow |
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,13 @@ | ||
import React from 'react' | ||
import { ExternalSite } from '../../../types/types' | ||
|
||
interface Props { | ||
children: React.ReactNode | ||
url: ExternalSite | ||
} | ||
|
||
const ExternalLink = ({ children, url }: Props) => { | ||
return <a onClick={() => window.electron.openExternal(url)}>{children}</a> | ||
} | ||
|
||
export default ExternalLink |
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
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
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
Oops, something went wrong.