This file contains hidden or 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
| const submitHandler = async (event) => { | |
| event.preventDefault(); | |
| const currentUser = await Auth.currentAuthenticatedUser(); | |
| try { | |
| const result = await API.graphql({ | |
| query: createUser, | |
| variables: { | |
| input: { | |
| id: currentUser.attributes.sub, | |
| firstName: firstName, |
This file contains hidden or 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
| import { getUser } from "../src/graphql/queries"; | |
| import {withSSRContext} from "aws-amplify"; | |
| export async function getServerSideProps({ req, res }) { | |
| const { Auth, API } = withSSRContext({ req }); | |
| try { | |
| const user = await Auth.currentAuthenticatedUser(); | |
| const response = await API.graphql({ | |
| query: getUser, | |
| variables: { id: user.attributes.sub }, | |
| }); |
This file contains hidden or 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
| import React from 'react'; | |
| import ReactDOM from 'react-dom'; | |
| import './index.css'; | |
| import App from './App'; | |
| import Amplify from 'aws-amplify'; | |
| import "@aws-amplify/ui-react/styles.css"; | |
| import {AmplifyProvider} from "@aws-amplify/ui-react"; | |
| import awsConfig from './aws-exports'; | |
| Amplify.configure(awsConfig); |
This file contains hidden or 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
| import logo from './logo.svg'; | |
| import './App.css'; | |
| import {NavBar} from "./ui-components"; | |
| function App() { | |
| return ( | |
| <div className="App"> | |
| <NavBar/> | |
| <header className="App-header"> | |
| <h1>Car Rental App</h1> |
This file contains hidden or 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
| import { NavBar } from "./ui-components"; | |
| import "./App.css"; | |
| function App() { | |
| 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: "https://www.bootdey.com/app/webroot/img/Content/avatar/avatar1.png", // profile image |
This file contains hidden or 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
| import { NavBar, NewCars } from "./ui-components"; | |
| import "./App.css"; | |
| function App() { | |
| 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: "https://www.bootdey.com/app/webroot/img/Content/avatar/avatar1.png", // profile image |
This file contains hidden or 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
| import { NavBar, NewCars } from "./ui-components"; | |
| import {withAuthenticator } from '@aws-amplify/ui-react'; | |
| import "./App.css"; | |
| function App() { | |
| 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]": { |
This file contains hidden or 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
| import { NavBar, NewCars } from "./ui-components"; | |
| import { 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 |
This file contains hidden or 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
| 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 |
This file contains hidden or 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
| const [name, setName] = useState(""); | |
| const [price, setPrice] = useState(""); | |
| const [description, setDescription] = useState(""); | |
| const [imageUrl, setImageUrl] = useState(""); | |
| const addCarOverrides = { | |
| "Flex.Flex[0].Flex[1].TextField[0]": { | |
| onChange: (event) => { | |
| setName(event.target.value); |