├── .eslintignore ├── src ├── react-app-env.d.ts ├── components │ ├── MediaComponents │ │ ├── types.ts │ │ ├── VideoPlayer.tsx │ │ ├── FolderList.tsx │ │ ├── DeleteFolder.tsx │ │ ├── MediaViewer.css │ │ └── CreateS3Folder.tsx │ ├── AuthComponents │ │ ├── GeneralLogin.css │ │ ├── ConformationCodeInput.tsx │ │ ├── GeneralLogin.tsx │ │ └── CompleteNewPassword.tsx │ ├── TenantAdmins │ │ ├── CreateTenantUser.css │ │ └── CreateTenantUser.tsx │ ├── GlobalAdminComponents │ │ ├── GlobalAdminTenantStyles.css │ │ ├── TenantList.tsx │ │ ├── CreateNewTenancy.tsx │ │ └── CreateTenantAdmin.tsx │ ├── HomeComponents │ │ ├── Home.css │ │ └── Home.tsx │ └── TaskComponents │ │ └── TaskShare.tsx ├── types │ ├── index.ts │ ├── queries.ts │ ├── subscriptions.ts │ ├── mutations.ts │ └── API.ts ├── setupTests.ts ├── App.test.tsx ├── index.css ├── reportWebVitals.ts ├── index.tsx ├── App.css └── App.tsx ├── public ├── robots.txt ├── manifest.json └── index.html ├── images ├── AddTask.png ├── sharebtn.png ├── ListUsersBtn.PNG ├── ChangePassword.PNG ├── InitialSiteView.png ├── rewrite_redirect.PNG ├── AmplifyCICDPipeline.png ├── MultiTenantAppLogin.png ├── GlobalAdminLandingPage.PNG ├── TenantAdminLandingPage.PNG ├── TenantUserLandingPage.PNG └── Amplify_Multi-Tenant_App.drawio.png ├── backend-resources └── cdk-ts-amplify-backend-resource │ ├── .npmignore │ ├── config │ ├── index.ts │ └── staticConfig.ts │ ├── lib │ ├── s3-constructs │ │ ├── index.ts │ │ └── s3-storage-construct.ts │ ├── appsync-construct-resources │ │ ├── index.ts │ │ ├── mapping-templates │ │ │ ├── subscription-request-mapping-template.vtl │ │ │ ├── subscription-response-mapping-template.vtl │ │ │ └── todo-query-listTodos-resolver.vtl │ │ ├── schema.graphql │ │ └── appsync-construct.ts │ ├── codecommit-constructs │ │ ├── index.ts │ │ └── create-codecommit-repo.ts │ ├── dynamodb-constructs │ │ ├── index.ts │ │ └── dynamodb-construct.ts │ ├── apigateway-adminapi-constructs │ │ └── index.ts │ ├── amplify-constructs │ │ ├── index.ts │ │ ├── amplify-create-service-role.ts │ │ └── amplify-create-app.ts │ ├── lambda-code │ │ ├── cognito-triggers │ │ │ ├── cognito-custom-messages │ │ │ │ ├── index.ts │ │ │ │ ├── custom-message-entry.ts │ │ │ │ └── custom-message.ts │ │ │ └── tokengen │ │ │ │ ├── package.json │ │ │ │ └── index.ts │ │ ├── admin-rest-api │ │ │ ├── routes │ │ │ │ ├── users │ │ │ │ │ ├── index.ts │ │ │ │ │ └── users.routes.ts │ │ │ │ └── index.ts │ │ │ ├── package.json │ │ │ ├── dynamodb_resources │ │ │ │ └── dynamodbApi.ts │ │ │ ├── middleware │ │ │ │ └── adminCheck.ts │ │ │ ├── index.ts │ │ │ └── cognito_resources │ │ │ │ └── cognitoApi.ts │ │ └── statemachine-functions │ │ │ ├── adminAddUserToGroupLambda │ │ │ ├── package.json │ │ │ └── index.ts │ │ │ ├── adminCreateUserPoolGroupLambda │ │ │ ├── package.json │ │ │ └── index.ts │ │ │ ├── adminCreateUserLambda │ │ │ ├── package.json │ │ │ ├── adminCreateUserLambdaSdkv2.ts │ │ │ └── index.ts │ │ │ └── extract-cognito-groups │ │ │ ├── package.json │ │ │ └── index.ts │ ├── cognito-constructs │ │ ├── index.ts │ │ ├── user-pool-client-construct.ts │ │ ├── user-pool-construct.ts │ │ └── identity-pool-construct.ts │ ├── statemachine-constructs │ │ ├── index.ts │ │ └── statemachine-create-dynamodb-global-secondary-indexes.ts │ └── AppStack.ts │ ├── .gitignore │ ├── jest.config.js │ ├── tsconfig.json │ ├── utils │ ├── updateConfig.ts │ └── getAmplifyOutputs.ts │ ├── test │ └── amplify-cognito-resource-ts-cdk.test.ts │ ├── bin │ └── deploy.ts │ ├── package.json │ └── cdk.json ├── CODE_OF_CONDUCT.md ├── amplify.yml ├── documents ├── TearDownInstructions.md ├── codecommit.md └── SetupInstructions.md ├── .gitlab-ci.yml ├── LICENSE ├── tsconfig.json ├── .gitignore ├── utils ├── updateEnvars.ts ├── printResources.ts └── getCdkStackOutputs.ts ├── README.md └── package.json /.eslintignore: -------------------------------------------------------------------------------- 1 | src\models 2 | amplify-codegen-temp\models 3 | -------------------------------------------------------------------------------- /src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /images/AddTask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/multitenant-application-on-aws-amplify/HEAD/images/AddTask.png -------------------------------------------------------------------------------- /images/sharebtn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/multitenant-application-on-aws-amplify/HEAD/images/sharebtn.png -------------------------------------------------------------------------------- /images/ListUsersBtn.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/multitenant-application-on-aws-amplify/HEAD/images/ListUsersBtn.PNG -------------------------------------------------------------------------------- /images/ChangePassword.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/multitenant-application-on-aws-amplify/HEAD/images/ChangePassword.PNG -------------------------------------------------------------------------------- /images/InitialSiteView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/multitenant-application-on-aws-amplify/HEAD/images/InitialSiteView.png -------------------------------------------------------------------------------- /images/rewrite_redirect.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/multitenant-application-on-aws-amplify/HEAD/images/rewrite_redirect.PNG -------------------------------------------------------------------------------- /images/AmplifyCICDPipeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/multitenant-application-on-aws-amplify/HEAD/images/AmplifyCICDPipeline.png -------------------------------------------------------------------------------- /images/MultiTenantAppLogin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/multitenant-application-on-aws-amplify/HEAD/images/MultiTenantAppLogin.png -------------------------------------------------------------------------------- /images/GlobalAdminLandingPage.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/multitenant-application-on-aws-amplify/HEAD/images/GlobalAdminLandingPage.PNG -------------------------------------------------------------------------------- /images/TenantAdminLandingPage.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/multitenant-application-on-aws-amplify/HEAD/images/TenantAdminLandingPage.PNG -------------------------------------------------------------------------------- /images/TenantUserLandingPage.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/multitenant-application-on-aws-amplify/HEAD/images/TenantUserLandingPage.PNG -------------------------------------------------------------------------------- /backend-resources/cdk-ts-amplify-backend-resource/.npmignore: -------------------------------------------------------------------------------- 1 | *.ts 2 | !*.d.ts 3 | 4 | # CDK asset staging directory 5 | .cdk.staging 6 | cdk.out 7 | -------------------------------------------------------------------------------- /images/Amplify_Multi-Tenant_App.drawio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/multitenant-application-on-aws-amplify/HEAD/images/Amplify_Multi-Tenant_App.drawio.png -------------------------------------------------------------------------------- /backend-resources/cdk-ts-amplify-backend-resource/config/index.ts: -------------------------------------------------------------------------------- 1 | /* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | SPDX-License-Identifier: MIT-0 */ 3 | 4 | export * from './staticConfig' -------------------------------------------------------------------------------- /src/components/MediaComponents/types.ts: -------------------------------------------------------------------------------- 1 | /* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | SPDX-License-Identifier: MIT-0 */ 3 | export type StorageAccessLevel = 'private' | 'public' | 'protected'; -------------------------------------------------------------------------------- /backend-resources/cdk-ts-amplify-backend-resource/lib/s3-constructs/index.ts: -------------------------------------------------------------------------------- 1 | /* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | SPDX-License-Identifier: MIT-0 */ 3 | 4 | export * from './s3-storage-construct' -------------------------------------------------------------------------------- /src/types/index.ts: -------------------------------------------------------------------------------- 1 | /* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | SPDX-License-Identifier: MIT-0 */ 3 | 4 | 5 | export * from './mutations'; 6 | export * from './queries'; 7 | export * from './subscriptions' -------------------------------------------------------------------------------- /backend-resources/cdk-ts-amplify-backend-resource/.gitignore: -------------------------------------------------------------------------------- 1 | *.js 2 | !jest.config.js 3 | *.d.ts 4 | node_modules 5 | 6 | # CDK asset staging directory 7 | .cdk.staging 8 | cdk.out 9 | 10 | config/generatedConfig.ts 11 | 12 | -------------------------------------------------------------------------------- /backend-resources/cdk-ts-amplify-backend-resource/lib/appsync-construct-resources/index.ts: -------------------------------------------------------------------------------- 1 | /* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | SPDX-License-Identifier: MIT-0 */ 3 | 4 | export * from './appsync-construct' -------------------------------------------------------------------------------- /backend-resources/cdk-ts-amplify-backend-resource/lib/codecommit-constructs/index.ts: -------------------------------------------------------------------------------- 1 | /* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | SPDX-License-Identifier: MIT-0 */ 3 | 4 | export * from './create-codecommit-repo' 5 | -------------------------------------------------------------------------------- /backend-resources/cdk-ts-amplify-backend-resource/lib/dynamodb-constructs/index.ts: -------------------------------------------------------------------------------- 1 | /* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | SPDX-License-Identifier: MIT-0 */ 3 | 4 | export * from "./dynamodb-construct"; 5 | 6 | 7 | -------------------------------------------------------------------------------- /backend-resources/cdk-ts-amplify-backend-resource/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | testEnvironment: 'node', 3 | roots: ['/test'], 4 | testMatch: ['**/*.test.ts'], 5 | transform: { 6 | '^.+\\.tsx?$': 'ts-jest' 7 | } 8 | }; 9 | -------------------------------------------------------------------------------- /backend-resources/cdk-ts-amplify-backend-resource/lib/apigateway-adminapi-constructs/index.ts: -------------------------------------------------------------------------------- 1 | /* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | SPDX-License-Identifier: MIT-0 */ 3 | 4 | export * from './amplify-admin-api-construct'; 5 | 6 | -------------------------------------------------------------------------------- /backend-resources/cdk-ts-amplify-backend-resource/lib/amplify-constructs/index.ts: -------------------------------------------------------------------------------- 1 | /* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | SPDX-License-Identifier: MIT-0 */ 3 | 4 | export * from './amplify-create-app' 5 | export * from './amplify-create-service-role' 6 | -------------------------------------------------------------------------------- /backend-resources/cdk-ts-amplify-backend-resource/lib/lambda-code/cognito-triggers/cognito-custom-messages/index.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | /* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | SPDX-License-Identifier: MIT-0 */ 4 | 5 | 6 | 7 | export * from './custom-message-entry'; 8 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | ## Code of Conduct 2 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). 3 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact 4 | opensource-codeofconduct@amazon.com with any additional questions or comments. -------------------------------------------------------------------------------- /backend-resources/cdk-ts-amplify-backend-resource/lib/cognito-constructs/index.ts: -------------------------------------------------------------------------------- 1 | /* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | SPDX-License-Identifier: MIT-0 */ 3 | 4 | export * from './identity-pool-construct'; 5 | export * from './user-pool-client-construct'; 6 | export * from './user-pool-construct'; 7 | 8 | -------------------------------------------------------------------------------- /backend-resources/cdk-ts-amplify-backend-resource/lib/statemachine-constructs/index.ts: -------------------------------------------------------------------------------- 1 | /* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | SPDX-License-Identifier: MIT-0 */ 3 | 4 | export * from "./statemachine-create-dynamodb-global-secondary-indexes"; 5 | export * from "./statemachine-create-cognito-user" 6 | export * from "./statemachine-update-amplify-app" -------------------------------------------------------------------------------- /src/setupTests.ts: -------------------------------------------------------------------------------- 1 | /* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | SPDX-License-Identifier: MIT-0 */ 3 | 4 | 5 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 6 | // allows you to do things like: 7 | // expect(element).toHaveTextContent(/react/i) 8 | // learn more: https://github.com/testing-library/jest-dom 9 | import '@testing-library/jest-dom'; 10 | -------------------------------------------------------------------------------- /backend-resources/cdk-ts-amplify-backend-resource/lib/lambda-code/cognito-triggers/tokengen/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tokengen", 3 | "version": "1.0.0", 4 | "description": "TokenGenerationLambda", 5 | "main": "index.ts", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "license": "MIT-0", 10 | "dependencies": { 11 | "@aws-sdk/client-dynamodb": "^3.188.0" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /backend-resources/cdk-ts-amplify-backend-resource/lib/lambda-code/admin-rest-api/routes/users/index.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | /* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | SPDX-License-Identifier: MIT-0 */ 4 | 5 | 6 | import { Router } from 'express'; 7 | 8 | import usersRoutes from './users.routes'; 9 | 10 | const router = Router(); 11 | 12 | router.use('/users', usersRoutes); 13 | 14 | export default router; -------------------------------------------------------------------------------- /src/App.test.tsx: -------------------------------------------------------------------------------- 1 | /* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | SPDX-License-Identifier: MIT-0 */ 3 | 4 | 5 | import React from 'react'; 6 | import { render, screen } from '@testing-library/react'; 7 | import App from './App'; 8 | 9 | test('renders learn react link', () => { 10 | render(); 11 | const linkElement = screen.getByText(/learn react/i); 12 | expect(linkElement).toBeInTheDocument(); 13 | }); 14 | -------------------------------------------------------------------------------- /backend-resources/cdk-ts-amplify-backend-resource/lib/lambda-code/admin-rest-api/routes/index.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | /* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | SPDX-License-Identifier: MIT-0 */ 4 | 5 | 6 | 7 | import { Router } from 'express'; 8 | import usersRoutes from './users'; 9 | 10 | const router: Router = Router(); 11 | 12 | 13 | router.use('/admin', usersRoutes); 14 | 15 | export default router; 16 | -------------------------------------------------------------------------------- /amplify.yml: -------------------------------------------------------------------------------- 1 | version: 1 2 | backend: 3 | phases: 4 | build: 5 | commands: 6 | - node -v 7 | - export NODE_OPTIONS=--max-old-space-size=819 8 | frontend: 9 | phases: 10 | preBuild: 11 | commands: 12 | - npm ci 13 | build: 14 | commands: 15 | - npm run build 16 | artifacts: 17 | baseDirectory: build 18 | files: 19 | - '**/*' 20 | cache: 21 | paths: 22 | - node_modules/**/* 23 | -------------------------------------------------------------------------------- /documents/TearDownInstructions.md: -------------------------------------------------------------------------------- 1 | Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | SPDX-License-Identifier: MIT-0 3 | ## Teardown Instructions : 4 | 5 | - Change Directory to CDK Backend Solution 6 | - `cd .\backend-resources\cdk-ts-amplify-backend-resource\` 7 | - `cdk destroy ` 8 | - Enter `y` to delete all resources created via the CDK solution 9 |
10 | 11 | - [Return to the Architecture](../README.md) -------------------------------------------------------------------------------- /backend-resources/cdk-ts-amplify-backend-resource/lib/lambda-code/statemachine-functions/adminAddUserToGroupLambda/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "adminaddusertogrouplambda", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "MIT-0", 12 | "dependencies": { 13 | "aws-sdk": "^2.1463.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /backend-resources/cdk-ts-amplify-backend-resource/lib/lambda-code/statemachine-functions/adminCreateUserPoolGroupLambda/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "admincreateuserpoolgrouplambda", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "MIT-0", 12 | "dependencies": { 13 | "aws-sdk": "^2.1463.0", 14 | "typescript": "^5.2.2" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /backend-resources/cdk-ts-amplify-backend-resource/lib/lambda-code/statemachine-functions/adminCreateUserLambda/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "admincreateuserlambda", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.ts", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "MIT-0", 12 | "dependencies": { 13 | "@aws-sdk/client-cognito-identity-provider": "^3.418.0", 14 | "aws-sdk": "^2.1463.0", 15 | "typescript": "^5.2.2" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/index.css: -------------------------------------------------------------------------------- 1 | /* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | SPDX-License-Identifier: MIT-0 */ 3 | 4 | 5 | body { 6 | margin: 0; 7 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 8 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 9 | sans-serif; 10 | -webkit-font-smoothing: antialiased; 11 | -moz-osx-font-smoothing: grayscale; 12 | } 13 | 14 | code { 15 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 16 | monospace; 17 | } 18 | -------------------------------------------------------------------------------- /backend-resources/cdk-ts-amplify-backend-resource/lib/lambda-code/statemachine-functions/extract-cognito-groups/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "extract-cognito-groups", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.ts", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "MIT-0", 11 | "dependencies": { 12 | "aws-jwt-verify": "^4.0.0", 13 | "aws-sdk": "^2.1463.0", 14 | "jsonwebtoken": "^9.0.1" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /src/reportWebVitals.ts: -------------------------------------------------------------------------------- 1 | /* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | SPDX-License-Identifier: MIT-0 */ 3 | 4 | 5 | import { ReportHandler } from 'web-vitals'; 6 | 7 | const reportWebVitals = (onPerfEntry?: ReportHandler) => { 8 | if (onPerfEntry && onPerfEntry instanceof Function) { 9 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 10 | getCLS(onPerfEntry); 11 | getFID(onPerfEntry); 12 | getFCP(onPerfEntry); 13 | getLCP(onPerfEntry); 14 | getTTFB(onPerfEntry); 15 | }); 16 | } 17 | }; 18 | 19 | export default reportWebVitals; 20 | -------------------------------------------------------------------------------- /src/components/AuthComponents/GeneralLogin.css: -------------------------------------------------------------------------------- 1 | /* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | SPDX-License-Identifier: MIT-0 */ 3 | 4 | form { 5 | display: flex; 6 | flex-direction: column; 7 | justify-content: center; 8 | align-items: center; 9 | height: 100vh; 10 | } 11 | 12 | .form { 13 | display: flex; 14 | flex-direction: column; 15 | justify-content: center; 16 | align-items: center; 17 | height: 100vh; 18 | } 19 | 20 | label { 21 | display: block; 22 | margin-bottom: 0.5rem; 23 | } 24 | 25 | input { 26 | display: block; 27 | margin-bottom: 1rem; 28 | padding: 0.5rem; 29 | font-size: 1rem; 30 | } 31 | -------------------------------------------------------------------------------- /src/components/MediaComponents/VideoPlayer.tsx: -------------------------------------------------------------------------------- 1 | /* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | SPDX-License-Identifier: MIT-0 */ 3 | 4 | import React, { useRef, useEffect } from 'react'; 5 | 6 | interface VideoPlayerProps { 7 | fileKey: string; 8 | fileType: string; 9 | } 10 | 11 | const VideoPlayer: React.FC = ({ fileKey }) => { 12 | const videoRef = useRef(null); 13 | 14 | useEffect(() => { 15 | const videoElement = videoRef.current; 16 | if (videoElement) { 17 | videoElement.src = fileKey; 18 | } 19 | }, [fileKey]); 20 | 21 | return