-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from Jackson-Vieira/feature/set-output-device
feature: select output device
- Loading branch information
Showing
19 changed files
with
601 additions
and
375 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,21 @@ | ||
'use server' | ||
"use server" | ||
|
||
import { redirect } from 'next/navigation' | ||
import { redirect } from "next/navigation" | ||
|
||
import { createClient } from '@/lib/supabase/server' | ||
import { createClient } from "@/lib/supabase/server" | ||
|
||
export async function sendFeedback(formData: FormData) { | ||
const supabase = createClient() | ||
|
||
const data = { | ||
twitter: formData.get('twitter') as string, | ||
content: formData.get('feedback') as string, | ||
twitter: formData.get("twitter") as string, | ||
content: formData.get("feedback") as string, | ||
} | ||
|
||
if(data.twitter || data.content) { | ||
const { error } = await supabase.from('feedbacks').insert(data) | ||
if (data.twitter || data.content) { | ||
const { error } = await supabase.from("feedbacks").insert(data) | ||
console.error("Fail to insert feedback", error) | ||
} | ||
|
||
|
||
redirect('/room/queue') | ||
redirect("/room/queue") | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,52 @@ | ||
import { Button } from "@/components/ui/button"; | ||
import { Card, CardContent } from "@/components/ui/card"; | ||
import { Input } from "@/components/ui/input"; | ||
import { Label } from "@/components/ui/label"; | ||
import { Textarea } from "@/components/ui/textarea"; | ||
import Link from "next/link"; | ||
import React from "react"; | ||
import { sendFeedback } from "./actions"; | ||
import { Button } from "@/components/ui/button" | ||
import { Card, CardContent } from "@/components/ui/card" | ||
import { Input } from "@/components/ui/input" | ||
import { Label } from "@/components/ui/label" | ||
import { Textarea } from "@/components/ui/textarea" | ||
import Link from "next/link" | ||
import React from "react" | ||
import { sendFeedback } from "./actions" | ||
|
||
export default function Page(): JSX.Element { | ||
return ( | ||
<section className="container z-20 mt-24 flex h-full flex-col items-center"> | ||
<h2 className="text-slate-6 w-full text-center text-[3rem] leading-10">How was your experience practicing english?</h2> | ||
<div className="mb-8 mt-4 w-full text-center text-slate-400">Share with us any feedback, problems, issues, ideas, or feature request.</div> | ||
<h2 className="text-slate-6 w-full text-center text-[3rem] leading-10"> | ||
How was your experience practicing english? | ||
</h2> | ||
<div className="mb-8 mt-4 w-full text-center text-slate-400"> | ||
Share with us any feedback, problems, issues, ideas, or feature request. | ||
</div> | ||
<Card className="border-slate-6 bg-slate-5 flex w-full flex-col items-center rounded-3xl border-x-0 border-b-0 border-t p-5 md:w-2/3"> | ||
<CardContent className="w-full"> | ||
<form className="flex w-full flex-col items-start gap-4 "> | ||
<div className="flex w-full flex-col items-baseline gap-2 sm:flex-row"> | ||
<Label className="w-16">Twitter</Label> | ||
<Input id="twitter" name="twitter" className="max-w-xs" placeholder="@brunocroh" /> | ||
<Input | ||
id="twitter" | ||
name="twitter" | ||
className="max-w-xs" | ||
placeholder="@brunocroh" | ||
/> | ||
</div> | ||
<div className="flex w-full flex-col items-baseline gap-2 sm:flex-row"> | ||
<Label className="w-16">Feedback</Label> | ||
<Textarea id="feedback" name="feedback" placeholder="Write here your feedback." /> | ||
<Textarea | ||
id="feedback" | ||
name="feedback" | ||
placeholder="Write here your feedback." | ||
/> | ||
</div> | ||
<div className="flex flex-col gap-4 self-end sm:flex-row"> | ||
<Link href="/room/queue"> | ||
<Button variant="outline">Not now, go back to practicing</Button> | ||
<Button variant="outline"> | ||
Not now, go back to practicing | ||
</Button> | ||
</Link> | ||
<Button formAction={sendFeedback}>Send</Button> | ||
</div> | ||
</form> | ||
</CardContent> | ||
</Card> | ||
</section> | ||
); | ||
) | ||
} |
Oops, something went wrong.