-
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
22 changed files
with
2,630 additions
and
5,939 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,7 +1,7 @@ | ||
const retrieveInput = require("./retrieveInput") | ||
const sendResults = require("./sendResults") | ||
const returnError = require("./returnError") | ||
|
||
module.exports = { | ||
retrieveInput: retrieveInput, | ||
sendResults: sendResults, | ||
returnError: returnError, | ||
} |
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,5 @@ | ||
function returnError(event, args) { | ||
event.sender.send("error", args) | ||
} | ||
|
||
module.exports = returnError |
This file was deleted.
Oops, something went wrong.
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,18 +1,18 @@ | ||
import { Playnite } from "./components/playnite" | ||
import { Steam } from "./components/steam" | ||
import { Go } from "./components/go" | ||
// import { Attribution } from "./components/attribution" | ||
import { Alert } from "./components/alert" | ||
import "./app.css" | ||
|
||
export function App() { | ||
window.api.listenForError((_, message) => { | ||
Alert({ title: "Error", text: message }) | ||
}) | ||
return ( | ||
<> | ||
<main> | ||
<Playnite /> | ||
<Steam /> | ||
<Go /> | ||
</main> | ||
{/* <Attribution /> */} | ||
</> | ||
<main> | ||
<Playnite /> | ||
<Steam /> | ||
<Go /> | ||
</main> | ||
) | ||
} |
Empty file.
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,17 @@ | ||
import Swal from "sweetalert2" | ||
import withReactContent from "sweetalert2-react-content" | ||
|
||
import "./alert.css" | ||
|
||
const mySwal = withReactContent(Swal) | ||
|
||
export function Alert(props) { | ||
mySwal.fire({ | ||
title: "Error", | ||
titleText: props.title, | ||
text: props.text, | ||
backdrop: true, | ||
target: "body", | ||
confirmButtonColor: "orangered", | ||
}) | ||
} |
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 @@ | ||
export { Alert } from "./alert" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,18 +1,39 @@ | ||
import { Alert } from "../alert" | ||
|
||
import "./go.css" | ||
|
||
export function Go() { | ||
return ( | ||
<div id="submit"> | ||
<button className="submit-button" onClick={sendToMain}> | ||
Go | ||
crosscheck | ||
</button> | ||
</div> | ||
) | ||
} | ||
|
||
function validateInput(dialogOutput, uid, apiKey) { | ||
if (dialogOutput && dialogOutput.type === "text/csv") { | ||
if (uid.length === 0) { | ||
Alert({ text: "Please insert your Steam user ID" }) | ||
return false | ||
} else if (apiKey.length === 0) { | ||
Alert({ text: "Please insert your Steam API key" }) | ||
return false | ||
} | ||
} else { | ||
Alert({ text: "Please select a CSV file" }) | ||
return false | ||
} | ||
return true | ||
} | ||
|
||
function sendToMain() { | ||
const csvFilePath = document.querySelector("#csv-file").files[0].path | ||
const dialogOutput = document.querySelector("#csv-file").files[0] | ||
const uid = document.querySelector("#steam-userid").value | ||
const apiKey = document.querySelector("#steam-api-key").value | ||
window.api.sendInput([csvFilePath, uid, apiKey]) | ||
if (validateInput(dialogOutput, uid, apiKey)) { | ||
const csvFilePath = dialogOutput.path | ||
window.api.sendInput([csvFilePath, uid, apiKey]) | ||
} | ||
} |
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,6 @@ | ||
import React from "react" | ||
import ReactDOM from "react-dom" | ||
import * as ReactDOMClient from "react-dom/client" | ||
import { App } from "./app" | ||
|
||
ReactDOM.render( | ||
<React.StrictMode> | ||
<App /> | ||
</React.StrictMode>, | ||
document.querySelector("#root") | ||
) | ||
const container = document.querySelector("#root") | ||
const root = ReactDOMClient.createRoot(container) | ||
root.render(<App />) |