-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
13de524
commit 15118af
Showing
16 changed files
with
297 additions
and
329 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
API_URL="http://localhost:3001/api" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
window.env = { | ||
"API_URL": "http://localhost:3001/api" | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import axios from "axios"; | ||
|
||
const client = axios.create({ | ||
// https://api.ronanplugins.com | ||
baseURL: import.meta.env.VITE_API_URL, | ||
responseType: "json", | ||
withCredentials: true, | ||
crossdomain: true, | ||
}); | ||
|
||
export default { | ||
async loginDiscord() { | ||
// const params = new URLSearchParams({ username, password }); | ||
|
||
return client.get(`/auth/discord`); | ||
}, | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { | ||
Dialog, | ||
DialogContent, | ||
DialogDescription, | ||
DialogHeader, | ||
DialogTitle, | ||
DialogTrigger, | ||
} from "@/components/ui/dialog"; | ||
import { Button } from "../ui/button"; | ||
import api from "@/api"; | ||
|
||
export default function LoginDialog() { | ||
const loginHandler = () => { | ||
api.loginDiscord(); | ||
}; | ||
|
||
return ( | ||
<Dialog> | ||
<DialogTrigger className="font-bold">Login/Register</DialogTrigger> | ||
<DialogContent className="h-1/3"> | ||
<DialogHeader> | ||
<DialogTitle>Login/Register</DialogTitle> | ||
<DialogDescription className="flex h-full items-center"> | ||
<Button | ||
style={{ backgroundColor: "#5865F2" }} | ||
className="flex items-center w-full" | ||
variant={"default"} | ||
onClick={loginHandler} | ||
> | ||
<img className="h-6 w-6 mr-2" src="/assets/discord.svg" /> | ||
|
||
<span>Continue with Discord</span> | ||
</Button> | ||
</DialogDescription> | ||
</DialogHeader> | ||
</DialogContent> | ||
</Dialog> | ||
); | ||
} |
Oops, something went wrong.