Skip to content

Commit

Permalink
Add quit buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
Hacksore committed Jul 3, 2024
1 parent 5d70750 commit dfb6420
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 10 deletions.
2 changes: 1 addition & 1 deletion apps/desktop/src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
}

ul {
list-style: circle;
list-style: inside;
}

.nice-scroll::-webkit-scrollbar {
Expand Down
13 changes: 11 additions & 2 deletions apps/desktop/src/views/error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Link } from "react-router-dom";
import { Button } from "@/components/ui/button";
import { useSetWindowSize } from "../hooks/use-set-size";
import { useAppStore } from "../store";
import { exit } from "@tauri-apps/api/process";

export const ErrorView = () => {
useSetWindowSize({ width: 400, height: 600 });
Expand All @@ -26,10 +27,18 @@ export const ErrorView = () => {
<p className="py-8">Please try restarting discord then try again</p>
</div>
)}
<div className="pt-8 text-2xl flex items-center justify-center">
<div className="pt-8 text-2xl flex flex-col gap-4 items-center justify-center">
<Link to="/">
<Button>Login to Discord</Button>
<Button>Connect to Discord</Button>
</Link>
<Button
variant="ghost"
onClick={async () => {
await exit();
}}
>
Quit Overlayed
</Button>
</div>
</div>
);
Expand Down
25 changes: 18 additions & 7 deletions apps/desktop/src/views/main.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useAppStore } from "../store";
import { useEffect } from "react";
import { Button } from "@/components/ui/button";
import { exit } from "@tauri-apps/api/process";

export const MainView = () => {
const { resetErrors } = useAppStore();
Expand All @@ -13,24 +14,25 @@ export const MainView = () => {
<div className="h-screen p-2 bg-zinc-900">
<div className="pt-1 mb-3 font-bold text-2xl text-center">
<p className="mb-2">Authorize Discord</p>
<ul className="text-sm text-center">
<li className="text-zinc-400">
<p>Overlayed is not affiliated with Discord. Discord is a trademark of Discord Inc.</p>
</li>
</ul>
<p className="text-sm text-center text-zinc-400">
Overlayed is not affiliated with Discord. Discord is a trademark of Discord Inc.
</p>
<ul className="flex flex-col pl-10 gap-4 p-4 mt-6 text-xl text-left">
<li>
<p className="leading-8">Discord should have opened a popup</p>
</li>
<li>
<p className="leading-8">Click &quot;Authorize&quot; within discord</p>
<p className="leading-8">Click &quot;Authorize&quot; within Discord</p>
</li>
<li>
<p className="leading-8">Join a voice channel</p>
</li>
<li>
<p className="leading-8">Enjoy 🥳</p>
</li>
</ul>

<div className="pt-8 text-2xl flex items-center justify-center">
<div className="pt-8 text-2xl flex flex-col gap-4 items-center justify-center">
<Button
onClick={() => {
// TODO: this is a hack, it should be handled better
Expand All @@ -39,6 +41,15 @@ export const MainView = () => {
>
Try Again
</Button>

<Button
variant="ghost"
onClick={async () => {
await exit();
}}
>
Quit Overlayed
</Button>
</div>
</div>
</div>
Expand Down

0 comments on commit dfb6420

Please sign in to comment.