-
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
8 changed files
with
105 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { ipcRenderer } from 'electron' | ||
import React from 'react' | ||
import { IpcMainMessage } from '../../../types' | ||
|
||
interface Props { | ||
label: string | ||
buttonLabel: string | ||
placeholder: string | ||
filePath: string | ||
ipcMessage: IpcMainMessage | ||
onType: (text: string) => unknown | ||
} | ||
|
||
const FileUploadField = ({ | ||
label, | ||
buttonLabel, | ||
placeholder, | ||
filePath, | ||
ipcMessage, | ||
onType, | ||
}: Props) => { | ||
return ( | ||
<div className='field'> | ||
<label className='label'>{label}</label> | ||
<div className='is-flex'> | ||
<input | ||
className='input' | ||
type='text' | ||
placeholder={placeholder} | ||
value={filePath} | ||
onInput={(e) => { | ||
onType((e.target as HTMLInputElement).value) | ||
}} | ||
/> | ||
<button | ||
className='button is-primary is-outlined ml-3' | ||
onClick={() => { | ||
ipcRenderer.send(ipcMessage) | ||
}} | ||
> | ||
{buttonLabel} | ||
</button> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default FileUploadField |
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 |
---|---|---|
|
@@ -13,6 +13,7 @@ rules.push({ | |
}) | ||
|
||
module.exports = { | ||
target: 'electron-renderer', | ||
module: { | ||
rules, | ||
}, | ||
|