/* eslint-disable import/no-unresolved */ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: MIT-0 import React, { useState } from 'react'; import { Heading, Grid, Cell, Flex, FormField, Input, Button, } from 'amazon-chime-sdk-component-library-react'; import { useTheme } from 'styled-components'; import { useAuthContext } from '../../providers/AuthProvider'; import './style.css'; const JoinChannel = () => { const { joinAnonymously } = useAuthContext(); const currentTheme = useTheme(); const [userName, setUsername] = useState(''); const onJoin = async (e) => { e.preventDefault(); await joinAnonymously(userName); }; const onUserName = (e) => { setUsername(e.target.value); }; return ( Chat App Join chat Enter your username and select Join
onUserName(e)} value={userName} type="text" showClear layout="horizontal" />
); }; export default JoinChannel;