diff --git a/handler/index/index.go b/handler/index/index.go index f1838bd..4bcbdc2 100644 --- a/handler/index/index.go +++ b/handler/index/index.go @@ -1,6 +1,7 @@ package indexHandler import ( + "github.com/fossyy/filekeeper/session" "net/http" "github.com/fossyy/filekeeper/logger" @@ -14,7 +15,8 @@ func init() { } func GET(w http.ResponseWriter, r *http.Request) { - component := indexView.Main("main page") + _, userSession, _ := session.GetSession(r) + component := indexView.Main("main page", userSession) err := component.Render(r.Context(), w) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) diff --git a/public/brand.svg b/public/brand.svg new file mode 100644 index 0000000..0bdcb1c --- /dev/null +++ b/public/brand.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/view/index/index.templ b/view/index/index.templ index 18a0ab0..64c81c3 100644 --- a/view/index/index.templ +++ b/view/index/index.templ @@ -1,103 +1,202 @@ package indexView import ( + "github.com/fossyy/filekeeper/types" "github.com/fossyy/filekeeper/view/layout" ) -templ content(title string) { +templ content(title string, user types.User) { @layout.Base(title){ -
- -
-

Your files, always within reach.

-

- Store, access, and share your files from anywhere. We offer secure and reliable file storage, so you can - focus on what matters most. -

-
- +
+ if user.Authenticated { +
+
+ + + + + + + + + + + + +
+
-
-
-
- - - - -
- Secure encryption to protect your data -
-
-
- - - - -
- Easy file sharing with customizable permissions -
-
-
- - - - -
- Unlimited storage capacity for your files -
-
-
- - - - -
- Seamless collaboration with built-in productivity tools -
-
+ } else { + + Sign up + + + Sign in + + } +
+
+
+

Your files, always within reach.

+

+ Store, access, and share your files from anywhere. We offer secure and reliable file storage, so you can + focus on what matters most. +

+
+
+
+ if user.Authenticated { + + Open Dashboard + + } else { + + Get started + + }
- -
-
-
-
-

© 2023 Acme, Inc. All rights reserved.

-

Terms of Service

-

Privacy Policy

-
-
+ +
+
+
+
+
+ + + +
+

Unlimited Storage

+

+ Store as many files as you need with our generous storage limits. +

+
+
+
+ + + + +
+

Secure Encryption

+

+ Your files are encrypted with the latest security protocols to keep them safe. +

+
+
+
+ + + + + +
+

Easy Sharing

+

+ Quickly share files with friends, family, or colleagues with shareable links. +

+
+
+
+
+
+
+ + } } -templ Main(title string) { - @content(title) +templ Main(title string, user types.User) { + @content(title, user) } \ No newline at end of file diff --git a/view/user/user.templ b/view/user/user.templ index 6ae8132..91bf505 100644 --- a/view/user/user.templ +++ b/view/user/user.templ @@ -218,16 +218,12 @@ templ content(email string, username string, title string, ListSession []*sessio @@ -241,18 +237,20 @@ templ content(email string, username string, title string, ListSession []*sessio

Pro Plan

50GB of storage for $9.99/month

- +

Enterprise Plan

1TB of storage for $49.99/month

- +