Skip to content

Commit

Permalink
feat: enhance index page with additional settings buttons and style a…
Browse files Browse the repository at this point in the history
…djustments
  • Loading branch information
prnk28 committed Dec 10, 2024
1 parent ba82d70 commit e38a045
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 217 deletions.
File renamed without changes.
15 changes: 14 additions & 1 deletion internal/gateway/handlers/index/views.templ
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,26 @@ templ InitialView() {
@layout.Root("Sonr.ID") {
@layout.Container() {
@text.Header("Sonr.ID", "The decentralized identity layer for the web.")
<div class="pt-3 flex flex-col items-center justify-center h-full">
<div class="pt-1.5 flex flex-col items-center justify-center h-full">
<sl-button hx-target="#container" hx-get="/register" hx-push-url="/register" type="button">
<sl-icon slot="prefix" library="sonr" name="sonr"></sl-icon>
Get Started
<sl-icon slot="suffix" library="sonr" name="arrow-right"></sl-icon>
</sl-button>
</div>
<div class="pt-1.5 flex flex-col items-center justify-center h-full">
<sl-button variant="default" size="small" circle>
<sl-icon name="gear" label="Settings"></sl-icon>
</sl-button>

<sl-button variant="default" size="medium" circle>
<sl-icon name="gear" label="Settings"></sl-icon>
</sl-button>

<sl-button variant="default" size="large" circle>
<sl-icon name="gear" label="Settings"></sl-icon>
</sl-button>
</div>
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/gateway/handlers/index/views_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 0 additions & 24 deletions internal/gateway/handlers/login_handler.go

This file was deleted.

File renamed without changes.
63 changes: 0 additions & 63 deletions internal/gateway/handlers/register/forms.templ
Original file line number Diff line number Diff line change
Expand Up @@ -124,66 +124,3 @@ templ formRegisterPasskey(action, method string, data RegisterPasskeyData) {
</form>
}

templ formRegisterPasskey(action, method string, data RegisterPasskeyData) {
<form action={ templ.SafeURL(action) } method={ method } id="passkey-form">
<input type="hidden" name="credential" id="credential-data" required/>
<sl-card class="card-form gap-4 max-w-lg">
<div slot="header">
<div class="w-full py-2">
@sonrProfile(data.Address, data.Name, data.Handle, data.CreationBlock)
</div>
</div>
<sl-select
label="Accounts"
value="SNR BTC ETH"
help-text="Select Blockchains to connect with your Vault"
multiple
class="custom-tag py-2"
>
@cryptoWalletOption("SNR", "Sonr", true)
@cryptoWalletOption("BTC", "Bitcoin", true)
@cryptoWalletOption("ETH", "Ethereum", true)
@cryptoWalletOption("SOL", "Solana", false)
@cryptoWalletOption("LTC", "Litecoin", false)
@cryptoWalletOption("DOGE", "Dogecoin", false)
@cryptoWalletOption("XRP", "Ripple", false)
@cryptoWalletOption("OSMO", "Osmosis", false)
@cryptoWalletOption("ATOM", "Cosmos", false)
@cryptoWalletOption("STARZ", "Stargaze", false)
@cryptoWalletOption("AKT", "Akash", false)
@cryptoWalletOption("EVMOS", "Evmos", false)
@cryptoWalletOption("FIL", "Filecoin", false)
@cryptoWalletOption("AXL", "Axelar", false)
</sl-select>
<script type="module">
const select = document.querySelector('.custom-tag');

select.getTag = (option, index) => {
// Use the same icon used in the <sl-option>
const name = option.querySelector('sl-icon[slot="prefix"]').name;

// You can return a string, a Lit Template, or an HTMLElement here
return `
<sl-tag removable>
<sl-icon name="${name}" library="crypto" style="padding-inline-end: .5rem;"></sl-icon>
${option.getTextLabel()}
</sl-tag>
`;
};
</script>
<div slot="footer" class="space-y-2">
@passkeyDropzone(data.Address, data.Handle, data.Challenge)
<sl-button href="/" style="width: 100%;" outline>
<sl-icon slot="prefix" name="x-lg"></sl-icon>
Cancel
</sl-button>
</div>
<style>
.card-form [slot='footer'] {
justify-content: space-evenly;
align-items: center;
}
</style>
</sl-card>
</form>
}
127 changes: 0 additions & 127 deletions internal/gateway/handlers/register/forms_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions internal/gateway/session/checks.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package session

import "github.com/labstack/echo/v4"

func IsUniqueHandle(c echo.Context, handle string) bool {
return true
}

func IsValidFirstName(c echo.Context, firstName string) bool {
return true
}

func IsValidLastInitial(c echo.Context, lastInitial string) bool {
return true
}

func IsHuman(c echo.Context, sum int) bool {
return true
}
1 change: 0 additions & 1 deletion internal/gateway/session/db.go

This file was deleted.

0 comments on commit e38a045

Please sign in to comment.