diff --git a/frontend/react-material-admin/public/favicon.ico b/frontend/react-material-admin/public/favicon.ico old mode 100755 new mode 100644 index a11777cc..f3dc2cd0 Binary files a/frontend/react-material-admin/public/favicon.ico and b/frontend/react-material-admin/public/favicon.ico differ diff --git a/frontend/react-material-admin/public/index.html b/frontend/react-material-admin/public/index.html index 3b3fd08c..fb030ab7 100755 --- a/frontend/react-material-admin/public/index.html +++ b/frontend/react-material-admin/public/index.html @@ -22,9 +22,9 @@ work correctly both with client-side routing and a non-root public URL. Learn how to configure a non-root public URL by running `npm run build`. --> - React Material Admin - - + Squeak Node + + diff --git a/frontend/react-material-admin/public/manifest.json b/frontend/react-material-admin/public/manifest.json index d734829f..9504bbf4 100755 --- a/frontend/react-material-admin/public/manifest.json +++ b/frontend/react-material-admin/public/manifest.json @@ -1,6 +1,6 @@ { - "short_name": "React Material Admin", - "name": "React Material Admin is a React Template built with Material-UI", + "short_name": "Squeak Node", + "name": "Squeak Node is a frontend for accessing a squeak node", "icons": [ { "src": "favicon.ico", diff --git a/frontend/react-material-admin/src/pages/profile/Profile.js b/frontend/react-material-admin/src/pages/profile/Profile.js index 4111d7ce..f534207f 100644 --- a/frontend/react-material-admin/src/pages/profile/Profile.js +++ b/frontend/react-material-admin/src/pages/profile/Profile.js @@ -40,18 +40,25 @@ export default function ProfilePage() { },[]); function NoProfileContent() { - return

No profile loaded...

; + return ( +

+ No profile loaded +

+ ) } function ProfileContent() { - return

{squeakProfile.getProfileName()}

; + return ( +

+ Profile name: {squeakProfile.getProfileName()} +

+ ) } return ( <>
- Hello! {squeakProfile ? ProfileContent() : NoProfileContent() diff --git a/frontend/react-material-admin/src/pages/squeakaddress/SqueakAddress.js b/frontend/react-material-admin/src/pages/squeakaddress/SqueakAddress.js index 2dabc531..48ff667e 100644 --- a/frontend/react-material-admin/src/pages/squeakaddress/SqueakAddress.js +++ b/frontend/react-material-admin/src/pages/squeakaddress/SqueakAddress.js @@ -1,6 +1,7 @@ import React, { useState, useEffect } from 'react'; import { useParams } from 'react-router-dom'; -import { Grid } from "@material-ui/core"; +import {useHistory} from "react-router-dom"; +import { Grid, Button } from "@material-ui/core"; // styles import useStyles from "./styles"; @@ -22,6 +23,7 @@ export default function SqueakAddressPage() { const { id } = useParams(); const [squeaks, setSqueaks] = useState([]); const [squeakProfile, setSqueakProfile] = useState(null); + const history = useHistory(); const getSqueaks = () => { console.log("called getSqueaks"); @@ -45,10 +47,15 @@ export default function SqueakAddressPage() { client.getSqueakProfileByAddress(getSqueakProfileByAddressRequest, {}, (err, response) => { console.log(response); - console.log(response.getSqueakProfile()); + console.log("Got squeak profile: " + response.getSqueakProfile()); setSqueakProfile(response.getSqueakProfile()); }); }; + + const goToCreateProfilePage = (profileId) => { + history.push("/app/profile/" + profileId); + }; + useEffect(()=>{ getSqueaks() },[]); @@ -56,12 +63,34 @@ export default function SqueakAddressPage() { getSqueakProfile() },[]); + function NoProfileContent() { + return ( +
+ No profile loaded +
+ ) + } + + function ProfileContent() { + return ( +
+ Profile: + +
+ ) + } + return ( <> + {squeakProfile + ? ProfileContent() + : NoProfileContent() + }
- Hello! - Number of squeaks for address: {squeaks.length} + Number of squeaks for address: {squeaks.length}
);