mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-03 09:51:39 +00:00
refactor: rename layout component to root
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
package layout
|
||||
|
||||
// Layout is a component that renders the general layout of the application
|
||||
templ Root(title string, remote bool) {
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
@Styles()
|
||||
@Htmx()
|
||||
@Alpine()
|
||||
@WebAwesome()
|
||||
<meta charset="UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<title>{ title }</title>
|
||||
<!-- Sets the status bar style to transparent -->
|
||||
<meta name="apple-mobile-web-app-capable" content="yes"/>
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
|
||||
<link rel="icon" type="image/png" href="https://cdn.sonr.id/favicon.png"/>
|
||||
</head>
|
||||
<body class="flex items-center justify-center h-full bg-neutral-50 lg:p-24 md:16 p-4">
|
||||
@Toaster() {
|
||||
<main class="flex-row items-center justify-center mx-auto w-fit max-w-screen-sm gap-y-3">
|
||||
{ children... }
|
||||
</main>
|
||||
}
|
||||
</body>
|
||||
</html>
|
||||
}
|
||||
|
||||
// LayoutNoBody is a component that renders the general layout of the application without the body tag
|
||||
templ NoBody(title string, remote bool) {
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
@Styles()
|
||||
@Htmx()
|
||||
@Alpine()
|
||||
@WebAwesome()
|
||||
<meta charset="UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<title>{ title }</title>
|
||||
<link rel="icon" type="image/png" href="https://cdn.sonr.id/favicon.png"/>
|
||||
<!-- Sets the status bar style to transparent -->
|
||||
<meta name="apple-mobile-web-app-capable" content="yes"/>
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
|
||||
</head>
|
||||
<main class="grow">
|
||||
<body class="font-inter antialiased bg-white text-zinc-900 tracking-tight">
|
||||
@Toaster() {
|
||||
<div class="flex flex-col min-h-screen overflow-hidden supports-[overflow:clip]:overflow-clip">
|
||||
{ children... }
|
||||
</div>
|
||||
}
|
||||
</body>
|
||||
</main>
|
||||
</html>
|
||||
}
|
||||
Reference in New Issue
Block a user