Skip to content

Instantly share code, notes, and snippets.

@SahanAmarsha
Last active January 24, 2022 18:35
Show Gist options
  • Save SahanAmarsha/37ce8c1346405dfb59fb4bd0fcb4175f to your computer and use it in GitHub Desktop.
Save SahanAmarsha/37ce8c1346405dfb59fb4bd0fcb4175f to your computer and use it in GitHub Desktop.
App.js after adding AddCar component
import { AddCar, NavBar, NewCars } from "./ui-components";
import { Divider, withAuthenticator } from "@aws-amplify/ui-react";
import "./App.css";
// retrieving signOut function, and user data
function App({ user, signOut }) {
const navbarOverrides = {
"Flex.Flex[0].Image[0]": {
src: "https://img.icons8.com/color/50/000000/car--v1.png", // app logo
},
"Flex.Flex[2].Image[0]": {
src: user?.attributes?.profile, // passing profile image from user object
},
"Flex.Flex[2].Button[0]": {
onClick: signOut, // passing signOut function
},
};
return (
<div className="App">
<NavBar overrides={navbarOverrides} width={"100%"} />
<header className="App-header">
<AddCar style={{ textAlign: "left", margin: "1rem" }} />
<Divider />
<NewCars />
</header>
</div>
);
}
export default withAuthenticator(App);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment