This repository has been archived by the owner on Jan 19, 2023. It is now read-only.
-
-
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
16 changed files
with
1,698 additions
and
318 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import React, { useState } from 'react'; | ||
import { ipcRenderer } from 'electron'; | ||
import { Button, InputGroup } from '@blueprintjs/core'; | ||
|
||
import { Events } from '../../events'; | ||
|
||
type Props = { | ||
files: any[]; | ||
output: string; | ||
}; | ||
|
||
function Find({ files, output }: Props) { | ||
const [columns, setColumns] = useState(''); | ||
const [wordToFind, setWordToFind] = useState(''); | ||
|
||
return ( | ||
<> | ||
<div style={{ marginBottom: 10 }}> | ||
<InputGroup | ||
placeholder="Column numbers seperated by a comma. Ex: j,r,c,d" | ||
small | ||
value={columns} | ||
onChange={e => setColumns(e.target.value)} | ||
/> | ||
<InputGroup | ||
placeholder="Column letter of word to find" | ||
small | ||
value={wordToFind} | ||
onChange={e => setWordToFind(e.target.value)} | ||
/> | ||
</div> | ||
<Button | ||
disabled={!files || !output || files.length > 1} | ||
text="Start" | ||
onClick={() => { | ||
ipcRenderer.send(Events.Find, { | ||
files: files.length > 0 && files[0], | ||
output, | ||
columns: columns.split(','), | ||
word: wordToFind | ||
}); | ||
}} | ||
/> | ||
</> | ||
); | ||
} | ||
|
||
export default Find; |
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,12 +1,13 @@ | ||
/* eslint-disable prefer-const */ | ||
import { Intent } from '@blueprintjs/core'; | ||
import { Events } from './events'; | ||
|
||
// eslint-disable-next-line import/no-mutable-exports | ||
export let bus = {}; | ||
|
||
export function init(mainWindow) { | ||
bus.message = (message, type = 'log') => | ||
mainWindow.webContents.send(Events.Message, { type, message }); | ||
bus.message = (message, intent: Intent = Intent.PRIMARY) => | ||
mainWindow.webContents.send(Events.Message, { intent, message }); | ||
bus.progress = (message, pct) => | ||
mainWindow.webContents.send(Events.Progress, { message, pct }); | ||
} |
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.