removed unnecessary components
This commit is contained in:
parent
d3f6a58f9b
commit
40cc7358e4
7 changed files with 23 additions and 196 deletions
|
@ -4,7 +4,7 @@ This project was bootstrapped with [Create React App](https://github.com/faceboo
|
|||
|
||||
In the project directory, you can run:
|
||||
|
||||
### `npm deploy`
|
||||
### `npm run deploy`
|
||||
deploys script to github pages
|
||||
|
||||
|
||||
|
|
38
src/App.css
38
src/App.css
|
@ -1,38 +0,0 @@
|
|||
.App {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.App-logo {
|
||||
height: 40vmin;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: no-preference) {
|
||||
.App-logo {
|
||||
animation: App-logo-spin infinite 20s linear;
|
||||
}
|
||||
}
|
||||
|
||||
.App-header {
|
||||
background-color: #282c34;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: calc(10px + 2vmin);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.App-link {
|
||||
color: #61dafb;
|
||||
}
|
||||
|
||||
@keyframes App-logo-spin {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
14
src/App.js
14
src/App.js
|
@ -1,14 +0,0 @@
|
|||
import React from 'react';
|
||||
import logo from './logo.svg';
|
||||
import './App.css';
|
||||
import SignIn from './SignIn';
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<div className="App">
|
||||
<SignIn/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
|
@ -1,9 +0,0 @@
|
|||
import React from 'react';
|
||||
import { render } from '@testing-library/react';
|
||||
import App from './App';
|
||||
|
||||
test('renders learn react link', () => {
|
||||
const { getByText } = render(<App />);
|
||||
const linkElement = getByText(/learn react/i);
|
||||
expect(linkElement).toBeInTheDocument();
|
||||
});
|
|
@ -17,6 +17,7 @@ import FileCopyOutlined from '@material-ui/icons/FileCopyOutlined';
|
|||
|
||||
|
||||
import { CopyToClipboard } from 'react-copy-to-clipboard';
|
||||
import { Accordion, AccordionItem } from 'react-sanfona';
|
||||
|
||||
|
||||
const useStyles = theme => ({
|
||||
|
@ -94,8 +95,6 @@ class ChecksumResolver extends React.Component {
|
|||
requestActivationBytes = () => {
|
||||
const { checksum } = this.state;
|
||||
|
||||
// fetch("https://aaxactivationserviceapi.azurewebsites.net/api/v2/activation/" + checksum)
|
||||
// fetch("https://localhost:32768/api/v2/activation/" + checksum)
|
||||
fetch("https://aax.api.j-kit.me/api/v2/activation/" + checksum)
|
||||
.then(res => res.json())
|
||||
.then(
|
||||
|
@ -121,10 +120,10 @@ class ChecksumResolver extends React.Component {
|
|||
|
||||
acceptFile = async files => {
|
||||
const file = files[0];
|
||||
if (!file.name.endsWith(".aax")) {
|
||||
alert('FileType not supported!');
|
||||
return;
|
||||
}
|
||||
// if (!file.name.toLowerCase().endsWith(".aax")) {
|
||||
// alert('FileType not supported!');
|
||||
// return;
|
||||
// }
|
||||
|
||||
const slic = file.slice(653, 653 + 20);
|
||||
const results = this.buf2hex(await slic.arrayBuffer());
|
||||
|
@ -136,6 +135,7 @@ class ChecksumResolver extends React.Component {
|
|||
render() {
|
||||
const { classes } = this.props;
|
||||
const { checksum, activationBytes } = this.state;
|
||||
//const acc = accAX();
|
||||
|
||||
return (
|
||||
<Container component="main" maxWidth="xs">
|
||||
|
@ -224,6 +224,18 @@ class ChecksumResolver extends React.Component {
|
|||
<Box mt={1}>
|
||||
<Copyright />
|
||||
</Box>
|
||||
|
||||
<Accordion backgroundColor="Black">
|
||||
{[1, 2, 3, 4, 5].map(item => {
|
||||
return (
|
||||
<AccordionItem title={`Item ${item}`} expanded={item === 1}>
|
||||
<div>
|
||||
{`Item ${item} content`}
|
||||
</div>
|
||||
</AccordionItem>
|
||||
);
|
||||
})}
|
||||
</Accordion>
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
|
|
123
src/SignIn.js
123
src/SignIn.js
|
@ -1,123 +0,0 @@
|
|||
import React, { useState } from 'react';
|
||||
import { withStyles } from "@material-ui/core/styles";
|
||||
import Avatar from '@material-ui/core/Avatar';
|
||||
import Button from '@material-ui/core/Button';
|
||||
import CssBaseline from '@material-ui/core/CssBaseline';
|
||||
import TextField from '@material-ui/core/TextField';
|
||||
|
||||
import Link from '@material-ui/core/Link';
|
||||
import Box from '@material-ui/core/Box';
|
||||
import LockOutlinedIcon from '@material-ui/icons/LockOutlined';
|
||||
import Typography from '@material-ui/core/Typography';
|
||||
import { makeStyles } from '@material-ui/core/styles';
|
||||
import Container from '@material-ui/core/Container';
|
||||
|
||||
function Copyright() {
|
||||
return (
|
||||
<Typography variant="body2" color="textSecondary" align="center">
|
||||
{'Copyright © '}
|
||||
<Link color="inherit" href="https://material-ui.com/">
|
||||
Your Website
|
||||
</Link>{' '}
|
||||
{new Date().getFullYear()}
|
||||
{'.'}
|
||||
</Typography>
|
||||
);
|
||||
}
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
paper: {
|
||||
marginTop: theme.spacing(8),
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
alignItems: 'center',
|
||||
},
|
||||
avatar: {
|
||||
margin: theme.spacing(1),
|
||||
backgroundColor: theme.palette.secondary.main,
|
||||
},
|
||||
form: {
|
||||
width: '100%', // Fix IE 11 issue.
|
||||
marginTop: theme.spacing(1),
|
||||
}
|
||||
|
||||
}));
|
||||
|
||||
const DarkerDisabledTextField = withStyles({
|
||||
root: {
|
||||
marginRight: 8,
|
||||
"& .MuiInputBase-root.Mui-disabled": {
|
||||
color: "rgba(0, 0, 0, 0.6)" // (default alpha is 0.38)
|
||||
}
|
||||
}
|
||||
})(TextField);
|
||||
|
||||
export default function SignIn() {
|
||||
const classes = useStyles();
|
||||
|
||||
const [checksumValue, setChecksumValue] = useState("");
|
||||
|
||||
return (
|
||||
<Container component="main" maxWidth="xs">
|
||||
{/* <div>
|
||||
<p>You clicked {count} times</p>
|
||||
<button onClick={() => setCount(count + 1)}>
|
||||
Click me
|
||||
</button>
|
||||
</div> */}
|
||||
<CssBaseline />
|
||||
<div className={classes.paper}>
|
||||
<Avatar className={classes.avatar}>
|
||||
<LockOutlinedIcon />
|
||||
</Avatar>
|
||||
<Typography component="h1" variant="h5">
|
||||
AAX Checksum Resolver
|
||||
</Typography>
|
||||
<form className={classes.form} noValidate>
|
||||
<TextField
|
||||
variant="outlined"
|
||||
margin="normal"
|
||||
required
|
||||
fullWidth
|
||||
id="checksum"
|
||||
label="AAX Checksum"
|
||||
name="checksum"
|
||||
autoComplete="checksum"
|
||||
autoFocus
|
||||
onChange={(x) => setChecksumValue(x.target.value)}
|
||||
/>
|
||||
|
||||
<Button
|
||||
fullWidth
|
||||
variant="contained"
|
||||
// className={classes.submit}
|
||||
onClick={() => { alert(checksumValue) }}
|
||||
>
|
||||
Request Activation Bytes
|
||||
</Button>
|
||||
|
||||
<DarkerDisabledTextField
|
||||
disabled
|
||||
variant="outlined"
|
||||
margin="normal"
|
||||
fullWidth
|
||||
id="activationBytes"
|
||||
label="Activation Bytes"
|
||||
name="activationBytes"
|
||||
autoComplete="activationBytes"
|
||||
aria-readonly
|
||||
|
||||
InputProps={{
|
||||
readOnly: true
|
||||
}}
|
||||
|
||||
/>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<Box mt={8}>
|
||||
<Copyright />
|
||||
</Box>
|
||||
</Container>
|
||||
);
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import './index.css';
|
||||
import App from './App';
|
||||
import * as serviceWorker from './serviceWorker';
|
||||
import ChecksumResolver from './ChecksumResolver';
|
||||
|
||||
|
|
Loading…
Reference in a new issue