xonecas.io
4828
Sr

stream-together / commit fc5e8e3

Start cleaning up the UI

Move the settings button so it's always visible.

sean2024-06-28 fc5e8e352ac3516d7a5fa23264619c9b08a6b1a0 parent e291b12

1 file changed

components/agora-host-video.tsx+52−53
@@ -110,7 +110,7 @@ export default function AgoraHost() {
110110 const otherHosts = useRemoteUsers();
111111
112112 return (
113- <div className="flex flex-col md:flex-row gap-8 w-full items-center">
113+ <div className="flex flex-col md:flex-row gap-8 w-full justify-center items-center">
114114 <div className="rounded-3xl overflow-hidden bg-black w-full max-w-2xl aspect-[4/3]">
115115 <LocalUser
116116 audioTrack={localMicrophoneTrack}
@@ -153,7 +153,7 @@ export default function AgoraHost() {
153153 </button>
154154 </div>
155155 ) : callStarted ? (
156- <div>Loading...</div>
156+ <div className="p-4">Loading...</div>
157157 ) : (
158158 <div className="flex flex-row justify-center gap-4">
159159 <button onClick={handleStarCall} title="Go live!">
@@ -168,63 +168,62 @@ export default function AgoraHost() {
168168 )}
169169 </div>
170170 </LocalUser>
171- </div>
171+ <Modal
172+ openButton={
173+ <button onClick={() => setShowSettingsModal(!showSettingsModal)}>
174+ <SecondaryButton>
175+ <div className="py-2 px-4 flex flex-row gap-2 items-center">
176+ <GearIcon size="2em" />
177+ <p>Settings</p>
178+ </div>
179+ </SecondaryButton>
180+ </button>
181+ }
182+ showModal={showSettingsModal}
183+ >
184+ <div className="p-4 bg-stone-800 rounded-2xl flex flex-col gap-4">
185+ <div>
186+ <h4 className="font-bold pb-4">Select your video device:</h4>
187+ {availableCameras.map((c) => {
188+ return (
189+ <label key={c.id} className="flex flex-row gap-2">
190+ <input
191+ type="radio"
192+ name="selected-camera"
193+ value={c.id}
194+ checked={c.id === selectedCameraId}
195+ onChange={(e) => {
196+ const id = e.target.value;
197+ setSelectedCameraId(id);
198+ }}
199+ />
200+ <div>{c.label}</div>
201+ </label>
202+ );
203+ })}
204+ </div>
172205
173- <Modal
174- openButton={
175- <button onClick={() => setShowSettingsModal(!showSettingsModal)}>
176- <SecondaryButton>
177- <div className="py-2 px-4 flex flex-row gap-2 items-center">
178- <GearIcon size="2em" />
179- <p>Settings</p>
206+ <div>
207+ <h4 className="font-bold pb-4">Blur your background?</h4>
208+ <div className="flex flex-row justify-start">
209+ <button onClick={handleBlurBackground}>
210+ <SecondaryButton>
211+ <p className="px-4 py-2">Toggle</p>
212+ </SecondaryButton>
213+ </button>
180214 </div>
181- </SecondaryButton>
182- </button>
183- }
184- showModal={showSettingsModal}
185- >
186- <div className="p-4 bg-stone-800 rounded-2xl flex flex-col gap-4">
187- <div>
188- <h4 className="font-bold pb-4">Select your video device:</h4>
189- {availableCameras.map((c) => {
190- return (
191- <label key={c.id} className="flex flex-row gap-2">
192- <input
193- type="radio"
194- name="selected-camera"
195- value={c.id}
196- checked={c.id === selectedCameraId}
197- onChange={(e) => {
198- const id = e.target.value;
199- setSelectedCameraId(id);
200- }}
201- />
202- <div>{c.label}</div>
203- </label>
204- );
205- })}
206- </div>
215+ </div>
207216
208- <div>
209- <h4 className="font-bold pb-4">Blur your background?</h4>
210- <div className="flex flex-row justify-start">
211- <button onClick={handleBlurBackground}>
212- <SecondaryButton>
213- <p className="px-4 py-2">Toggle</p>
214- </SecondaryButton>
217+ <div className="text-center">
218+ <button onClick={() => setShowSettingsModal(false)}>
219+ <PrimaryButton>
220+ <p className="px-4 py-2">Close</p>
221+ </PrimaryButton>
215222 </button>
216223 </div>
217224 </div>
218-
219- <div className="text-center">
220- <button onClick={() => setShowSettingsModal(false)}>
221- <PrimaryButton>
222- <p className="px-4 py-2">Close</p>
223- </PrimaryButton>
224- </button>
225- </div>
226- </div>
227- </Modal>
225+ </Modal>
226+ </div>
228227
229228 {otherHosts.map((host) => {
230229 return (