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 { DataStore } from "@aws-amplify/datastore"; | |
import { Car } from "./models"; | |
... | |
const saveCar = async () => { | |
try { | |
await DataStore.save( | |
new Car({ | |
name: name, |
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 { DataStore } from "@aws-amplify/datastore"; | |
import { Car } from "./models"; | |
import { useState } from "react"; | |
import "./App.css"; | |
// retrieving signOut function, and user data | |
function App({ user, signOut }) { | |
const [name, setName] = useState(""); |
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 { Box, CssBaseline, Paper, Typography } from "@mui/material"; | |
function App() { | |
return ( | |
<div> | |
<CssBaseline /> | |
<Box | |
height="100vh" | |
display="flex" |
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
// define theme | |
const theme = createTheme({ | |
palette: { | |
primary: { | |
light: '#63b8ff', | |
main: '#0989e3', | |
dark: '#005db0', | |
contrastText: '#000', | |
}, | |
secondary: { |
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 { | |
Box, | |
CssBaseline, | |
Paper, | |
ThemeProvider, | |
Typography, | |
} from "@mui/material"; | |
import { createTheme } from "@mui/material/styles"; |
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
// src/pages/Home.tsx | |
import React, {ReactElement, FC} from "react"; | |
import {Box, Typography} from "@mui/material"; | |
const Home: FC<any> = (): ReactElement => { | |
return ( | |
<Box sx={{ | |
flexGrow: 1, | |
backgroundColor: 'whitesmoke', |
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
// src/routes.ts | |
// pages | |
import Home from "./pages/Home"; | |
import About from "./pages/About"; | |
import Products from "./pages/Products"; | |
// other | |
import {FC} from "react"; |
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
// src/App.tsx | |
import React from "react"; | |
import { Box, CssBaseline, ThemeProvider } from "@mui/material"; | |
import { createTheme } from "@mui/material/styles"; | |
import { BrowserRouter as Router, Routes, Route } from "react-router-dom"; | |
import { routes as appRoutes } from "./routes"; | |
function App() { | |