Finished minimal profile page

This commit is contained in:
Yue Fung Lee
2023-11-30 03:01:24 -05:00
parent 9478018e19
commit 7f073e0e63
3 changed files with 21 additions and 23 deletions
+4
View File
@@ -57,6 +57,10 @@ button.green
background-color: $c-green
box-shadow: $shadow-width $c-green-shadow
button.red
background-color: $c-red
box-shadow: $shadow-width $c-red-shadow
button.white
background-color: white
color: $c-default-text
-20
View File
@@ -64,26 +64,6 @@ export function getUsername()
return db.user
}
// export function recordAudio(callback: (audio: HTMLAudioElement) => void) {
// let chunks = [] as any;
// let mediaRecorder = null as any;
// navigator.mediaDevices.getUserMedia({ audio: true }).then((stream) => {
// mediaRecorder = new MediaRecorder(stream)
// mediaRecorder.ondataavailable = (e: any) => {
// chunks.push(e.data)
// }
// mediaRecorder.onstop = (e: any) => {
// const blob = new Blob(chunks, { type: 'audio/ogg; codecs=opus' })
// chunks = []
// const audioURL = window.URL.createObjectURL(blob)
// const audio = new Audio(audioURL)
// callback(audio);
// }
// })
// }
export interface CharacterChatCreationRequest
{
character: string;
+17 -3
View File
@@ -1,11 +1,25 @@
import NavBar from "../components/NavBar"
import { getUsername, getLanguage, logout } from "../logic/sdk"
import { useNavigate } from "react-router-dom"
export default function Profile() {
const username = getUsername();
const navigate = useNavigate();
function handleLougout() {
logout();
console.log("Logged out");
navigate('/')
}
return (
<div className="flex flex-col h-screen">
<div className="flex flex-col flex-1">
<h1>Profile Page</h1>
<div className="v-layout p-10">
<div className="flex flex-col flex-1 h-full">
<h1 className="text-center">Profile</h1>
<h2 className="text-center">Username: {username}</h2>
<h2 className="text-center">Currently Learning: {getLanguage(username)}</h2>
<button className="red mt-auto mb-12" onClick={() => handleLougout()}>Logout</button>
</div>
<NavBar />
</div>