This file contains 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 aws = require("aws-sdk"); | |
const sharp = require("sharp"); | |
const s3 = new aws.S3(); | |
exports.handler = async function (event, context) { | |
console.log("Received S3 event:", JSON.stringify(event, null, 2)); | |
if (event.Records[0].eventName === "ObjectRemoved:Delete") { | |
return; | |
} | |
const bucket = event.Records[0].s3.bucket.name; |
This file contains 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"; | |
import Navbar from "./components/Navbar"; | |
import Footer from "./components/Footer"; |
This file contains 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() { | |
This file contains 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 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 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 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 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" |