Skip to content

Commit

Permalink
Merge pull request #15 from aws-samples/deps
Browse files Browse the repository at this point in the history
Upgrade to react-scripts@4
  • Loading branch information
ConnorKirk authored Oct 27, 2020
2 parents d3e748a + c454160 commit 565fd32
Show file tree
Hide file tree
Showing 13 changed files with 7,266 additions and 3,952 deletions.
2 changes: 1 addition & 1 deletion src/cfn/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Globals:
MIN_CONFIDENCE: !Ref MinConfidence
OBJECTS_OF_INTEREST_LABELS: !Join [",", !Ref ObjectsOfInterestLabels]
REGION: !Ref AWS::Region
VERSION: '0.11'
VERSION: '0.12'
Api:
EndpointConfiguration: REGIONAL
Cors:
Expand Down
11,174 changes: 7,234 additions & 3,940 deletions src/web-ui/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"react": "^16.13.1",
"react-bootstrap": "1.0.0",
"react-dom": "^16.13.1",
"react-scripts": "^3.4.1",
"react-scripts": "^4.0.0",
"react-webcam": "^5.0.2",
"uuid": "^3.3.2"
},
Expand Down
4 changes: 3 additions & 1 deletion src/web-ui/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import EngagementSummary from "./components/EngagementsSummary";
import Header from "./components/Header";
import SettingsHelp from "./components/SettingsHelp";

export default () => {
const App = () => {
const [authState, setAuthState] = useState(undefined);
const [readyToStream, setReadyToStream] = useState(false);
const [testResults, setTestResults] = useState([]);
Expand Down Expand Up @@ -122,3 +122,5 @@ export default () => {
</div>
);
};

export default App;
4 changes: 3 additions & 1 deletion src/web-ui/src/components/AddUserModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Alert, Button, Form, Modal } from "react-bootstrap";

import { isEmpty } from "../utils";

export default ({ onSave }) => {
const AddUserModal = ({ onSave }) => {
const [formState, setFormState] = useState("initial");
const [fullName, setFullName] = useState("");
const [image, setImage] = useState(undefined);
Expand Down Expand Up @@ -124,3 +124,5 @@ export default ({ onSave }) => {
</>
);
};

export default AddUserModal;
4 changes: 3 additions & 1 deletion src/web-ui/src/components/CameraHelp.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { Col, Row } from "react-bootstrap";

export default props => {
const CameraHelp = (props) => {
const currentUrl = window.location.href;
if (props.show) {
return (
Expand All @@ -19,3 +19,5 @@ export default props => {
}
return "";
};

export default CameraHelp;
4 changes: 3 additions & 1 deletion src/web-ui/src/components/EngagementsSummary.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Card } from "react-bootstrap";

import Icon from "./Icon";

export default ({ testResults }) => (
const EngagementsSummary = ({ testResults }) => (
<div className="tests-container">
{testResults.map((test, index) => (
<Card style={{ marginTop: "20px", textAlign: "left" }} key={index}>
Expand All @@ -18,3 +18,5 @@ export default ({ testResults }) => (
))}
</div>
);

export default EngagementsSummary;
4 changes: 3 additions & 1 deletion src/web-ui/src/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import RekognitionButton from "./RekognitionButton";

import "./Header.css";

export default ({ addUser, readyToStream, signedIn, toggleRekognition }) => {
const Header = ({ addUser, readyToStream, signedIn, toggleRekognition }) => {
const [authError, setAuthError] = useState(null);
const [userEmail, setUserEmail] = useState(undefined);

Expand Down Expand Up @@ -62,3 +62,5 @@ export default ({ addUser, readyToStream, signedIn, toggleRekognition }) => {
</Navbar>
);
};

export default Header;
4 changes: 3 additions & 1 deletion src/web-ui/src/components/Icon.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";

export default ({ type, size }) => {
const Icon = ({ type, size }) => {
size = size || "16";

const SVGWrapper = ({ children }) => (
Expand Down Expand Up @@ -61,3 +61,5 @@ export default ({ type, size }) => {

return "";
};

export default Icon;
4 changes: 3 additions & 1 deletion src/web-ui/src/components/RekognitionButton.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from "react";
import { Button } from "react-bootstrap";

export default ({ enabled, onClick }) => {
const RekognitionButton = ({ enabled, onClick }) => {
const [started, setStarted] = useState(false);

return (
Expand All @@ -18,3 +18,5 @@ export default ({ enabled, onClick }) => {
</Button>
);
};

export default RekognitionButton;
4 changes: 3 additions & 1 deletion src/web-ui/src/components/SettingsHelp.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { Alert, Row } from "react-bootstrap";

export default ({ show }) => {
const SettingsHelp = ({ show }) => {
if (show) {
return (
<Row>
Expand All @@ -22,3 +22,5 @@ export default ({ show }) => {
}
return "";
};

export default SettingsHelp;
4 changes: 3 additions & 1 deletion src/web-ui/src/utils/gateway.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import request from "./request";

export default {
const gateway = {
addUser(params) {
return request("/faces/index", "post", {
image: params.image,
Expand All @@ -12,3 +12,5 @@ export default {
return request("/process", "post", { image });
},
};

export default gateway;
4 changes: 3 additions & 1 deletion src/web-ui/src/utils/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ Amplify.configure({
},
});

export default (url, method, data) =>
const request = (url, method, data) =>
retryWrapper(() =>
API[method || "get"]("apiGateway", url, {
body: data || undefined,
headers: { "Content-Type": "application/json" },
})
);

export default request;

0 comments on commit 565fd32

Please sign in to comment.