Skip to content

Commit

Permalink
chore: remove views and further changes
Browse files Browse the repository at this point in the history
  • Loading branch information
im-adithya committed Dec 27, 2023
1 parent bcb7415 commit 1d49773
Show file tree
Hide file tree
Showing 16 changed files with 96 additions and 1,019 deletions.
10 changes: 1 addition & 9 deletions echo_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ func (svc *Service) AppsListHandler(c echo.Context) error {
if err != nil {
return c.JSON(http.StatusBadRequest, ErrorResponse{
Error: true,
Code: 8,
Message: fmt.Sprintf("Bad arguments %s", err.Error()),
})
}
Expand Down Expand Up @@ -105,7 +104,6 @@ func (svc *Service) AppsShowHandler(c echo.Context) error {
if err != nil {
return c.JSON(http.StatusBadRequest, ErrorResponse{
Error: true,
Code: 8,
Message: fmt.Sprintf("Bad arguments %s", err.Error()),
})
}
Expand All @@ -117,10 +115,8 @@ func (svc *Service) AppsShowHandler(c echo.Context) error {
svc.db.Where("user_id = ? AND nostr_pubkey = ?", user.ID, c.Param("pubkey")).First(&app)

if app.NostrPubkey == "" {
// TODO: Show not found?
return c.JSON(http.StatusBadRequest, ErrorResponse{
return c.JSON(http.StatusNotFound, ErrorResponse{
Error: true,
Code: 8,
Message: "App does not exist",
})
}
Expand Down Expand Up @@ -184,7 +180,6 @@ func (svc *Service) AppsCreateHandler(c echo.Context) error {
if err != nil {
return c.JSON(http.StatusBadRequest, ErrorResponse{
Error: true,
Code: 8,
Message: fmt.Sprintf("Bad arguments %s", err.Error()),
})
}
Expand All @@ -206,7 +201,6 @@ func (svc *Service) AppsCreateHandler(c echo.Context) error {
svc.Logger.Errorf("Invalid public key format: %s", pairingPublicKey)
return c.JSON(http.StatusBadRequest, ErrorResponse{
Error: true,
Code: 8,
Message: fmt.Sprintf("Invalid public key format: %s", pairingPublicKey),
})
}
Expand All @@ -222,7 +216,6 @@ func (svc *Service) AppsCreateHandler(c echo.Context) error {
svc.Logger.Errorf("Invalid expiresAt: %s", pairingPublicKey)
return c.JSON(http.StatusBadRequest, ErrorResponse{
Error: true,
Code: 8,
Message: fmt.Sprintf("Invalid expiresAt: %v", err),
})
}
Expand Down Expand Up @@ -273,7 +266,6 @@ func (svc *Service) AppsCreateHandler(c echo.Context) error {
}).Errorf("Failed to save app: %v", err)
return c.JSON(http.StatusInternalServerError, ErrorResponse{
Error: true,
Code: 8,
Message: fmt.Sprintf("Failed to save app: %v", err),
})
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Alby - Nostr Wallet Connect</title>
<link rel="icon" href="/vite.svg" />
<link rel="icon" href="/src/assets/images/nwc-logo.svg" />
</head>
<body>
<div id="root"></div>
Expand Down
19 changes: 18 additions & 1 deletion frontend/src/assets/images/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 22 additions & 15 deletions frontend/src/screens/Login.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import nwcLogo from "../assets/images/nwc-logo.svg";
import albyHead from "../assets/images/alby-head.svg";
import { useInfo } from "../hooks/useInfo";

function Login() {
const { data: info } = useInfo();
const isAlby = info?.backendType === "ALBY";

return (
<div className="text-center pt-4">
<img
Expand All @@ -17,23 +21,26 @@ function Login() {
</h1>

<h2 className="text-md text-gray-700 dark:text-neutral-300">
Securely connect your Alby Account to Nostr clients and applications.
Securely connect your {isAlby ? "Alby Account" : "LND Wallet"} to Nostr
clients and applications.
</h2>

<p className="my-8">
<a
className=" inline-flex cursor-pointer items-center justify-center rounded-md transition-all px-10 py-4 text-black bg-gradient-to-r from-[#ffde6e] to-[#f8c455]"
href="/alby/auth"
>
<img
src={albyHead}
width="400"
height="400"
className="w-[24px] mr-2"
/>
Log in with Alby Account
</a>
</p>
{isAlby && (
<p className="my-8">
<a
className=" inline-flex cursor-pointer items-center justify-center rounded-md transition-all px-10 py-4 text-black bg-gradient-to-r from-[#ffde6e] to-[#f8c455]"
href="/alby/auth"
>
<img
src={albyHead}
width="400"
height="400"
className="w-[24px] mr-2"
/>
Log in with Alby Account
</a>
</p>
)}

<p>
<a href="/about" className="text-purple-700 dark:text-purple-400">
Expand Down
Loading

0 comments on commit 1d49773

Please sign in to comment.