Skip to content

Commit 05b8093

Browse files
authored
Fix settings overflow when update banner is visible (#90)
1 parent 2e67de4 commit 05b8093

File tree

2 files changed

+56
-52
lines changed

2 files changed

+56
-52
lines changed

apps/desktop/src/views/settings/account.tsx

Lines changed: 56 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ import type { VoiceUser } from "@/types";
2626

2727
export const Developer = () => {
2828
const platformInfo = usePlatformInfo();
29-
const [showOnlyTalkingUsers, setShowOnlyTalkingUsers] = useState(Config.get("showOnlyTalkingUsers")!);
30-
3129
return (
3230
<>
3331
<div className="flex flex-col gap-2">
@@ -51,49 +49,57 @@ export const Developer = () => {
5149
Open Config Dir
5250
</Button>
5351
</div>
52+
</div>
53+
</>
54+
);
55+
};
56+
export const AppInfo = () => {
57+
const [showOnlyTalkingUsers, setShowOnlyTalkingUsers] = useState(Config.get("showOnlyTalkingUsers")!);
58+
const platformInfo = usePlatformInfo();
5459

55-
<div className="flex items-center pb-2">
56-
<Checkbox
57-
id="notification"
58-
checked={showOnlyTalkingUsers}
59-
onCheckedChange={async () => {
60-
const newBool = !showOnlyTalkingUsers;
61-
setShowOnlyTalkingUsers(newBool);
62-
Config.set("showOnlyTalkingUsers", newBool);
63-
64-
// let the main app know the updated config
65-
// TODO: is there a more efficient way to do this rather than sending the whole config?
66-
await emit("config_update", Config.getConfig());
67-
}}
68-
/>
69-
<label
70-
htmlFor="notification"
71-
className="ml-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
72-
>
73-
Only show users who are speaking
74-
</label>
60+
return (
61+
<div>
62+
<div className="flex items-center pb-2">
63+
<Checkbox
64+
id="notification"
65+
checked={showOnlyTalkingUsers}
66+
onCheckedChange={async () => {
67+
const newBool = !showOnlyTalkingUsers;
68+
setShowOnlyTalkingUsers(newBool);
69+
Config.set("showOnlyTalkingUsers", newBool);
70+
71+
// let the main app know the updated config
72+
// TODO: is there a more efficient way to do this rather than sending the whole config?
73+
await emit("config_update", Config.getConfig());
74+
}}
75+
/>
76+
<label
77+
htmlFor="notification"
78+
className="ml-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
79+
>
80+
Only show users who are speaking
81+
</label>
82+
</div>
83+
<div className="flex items-center gap-2 pb-4 text-zinc-400">
84+
<div>
85+
<p className="text-sm">
86+
<strong>OS</strong> {platformInfo.os} {platformInfo.kernalVersion} {platformInfo.arch}
87+
</p>
7588
</div>
76-
<div className="flex items-center text-zinc-400 gap-2 pb-4">
77-
<div>
78-
<p className="text-sm">
79-
<strong>OS</strong> {platformInfo.os} {platformInfo.kernalVersion} {platformInfo.arch}
80-
</p>
81-
</div>
82-
<span className="text-xs">/</span>
83-
<div>
84-
<p className="text-sm">
85-
<strong>Tauri</strong> {platformInfo.tauriVersion}
86-
</p>
87-
</div>
88-
<span className="text-sm">/</span>
89-
<div>
90-
<p className="text-sm">
91-
<strong>App</strong> {platformInfo.appVersion}
92-
</p>
93-
</div>
89+
<span className="text-xs">/</span>
90+
<div>
91+
<p className="text-sm">
92+
<strong>Tauri</strong> {platformInfo.tauriVersion}
93+
</p>
94+
</div>
95+
<span className="text-sm">/</span>
96+
<div>
97+
<p className="text-sm">
98+
<strong>App</strong> {platformInfo.appVersion}
99+
</p>
94100
</div>
95101
</div>
96-
</>
102+
</div>
97103
);
98104
};
99105

@@ -128,22 +134,21 @@ export const Account = () => {
128134
window.removeEventListener("storage", onStorageChange);
129135
};
130136
}, []);
131-
132137
const avatarUrl = `https://cdn.discordapp.com/avatars/${user?.id}/${user?.avatar}.png`;
133138
return (
134139
<div>
135140
<div className="h-[282px]">
136141
<div className="flex items-center mb-2">
137142
{user?.id && (
138-
<Avatar className="mr-3 w-16 h-16">
143+
<Avatar className="w-16 h-16 mr-3">
139144
<AvatarImage src={avatarUrl} />
140145
<AvatarFallback>U</AvatarFallback>
141146
</Avatar>
142147
)}
143148
<div>
144149
{user?.id ? (
145150
<div>
146-
<p className="mb-3 mt-3 font-bold">
151+
<p className="mt-3 mb-3 font-bold">
147152
{user?.global_name} ({user?.id})
148153
</p>
149154
</div>
@@ -161,7 +166,7 @@ export const Account = () => {
161166
</div>
162167
</div>
163168

164-
<div className="flex gap-4 pb-4">
169+
<div className="flex flex-row gap-4 pb-4">
165170
<div>
166171
<Dialog
167172
onOpenChange={e => {
@@ -188,8 +193,8 @@ export const Account = () => {
188193
}}
189194
>
190195
<DialogHeader>
191-
<DialogTitle className="text-xl mb-4 text-white">Logout</DialogTitle>
192-
<DialogDescription className="text-xl mb-4 text-white">
196+
<DialogTitle className="mb-4 text-xl text-white">Logout</DialogTitle>
197+
<DialogDescription className="mb-4 text-xl text-white">
193198
Are you sure you want to log out of Overlayed?
194199
</DialogDescription>
195200
</DialogHeader>
@@ -224,8 +229,8 @@ export const Account = () => {
224229
}}
225230
>
226231
<DialogHeader>
227-
<DialogTitle className="text-xl mb-4 text-white">Quit Overlayed</DialogTitle>
228-
<DialogDescription className="text-xl mb-4 text-white">
232+
<DialogTitle className="mb-4 text-xl text-white">Quit Overlayed</DialogTitle>
233+
<DialogDescription className="mb-4 text-xl text-white">
229234
Are you sure you want to quit the Overlayed app?
230235
</DialogDescription>
231236
</DialogHeader>
@@ -240,8 +245,9 @@ export const Account = () => {
240245
</form>
241246
</DialogContent>
242247
</Dialog>
248+
<Developer />
243249
</div>
244-
<Developer />
250+
<AppInfo />
245251
</div>
246252
</div>
247253
);

apps/desktop/src/views/settings/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export const SettingsView = ({
2323
<TabsTrigger value="account">General</TabsTrigger>
2424
<TabsTrigger value="join-history">Join History</TabsTrigger>
2525
</TabsList>
26-
2726
{update.isAvailable && <Updater update={update} />}
2827
<div className="p-4 pt-0">
2928
<TabsContent tabIndex={-1} value="account">
@@ -35,7 +34,6 @@ export const SettingsView = ({
3534
</div>
3635
</TabsContent>
3736
</div>
38-
3937
<div className="h-10 pl-4 absolute bottom-0 w-full bg-zinc-800 text-gray-400 flex items-center">
4038
<p>
4139
Found a bug? Please report them on the{" "}

0 commit comments

Comments
 (0)