Separate navbar and footer components for reusability

This commit is contained in:
2024-05-03 10:40:54 +07:00
parent 71c1f2c56f
commit 22aa8227a4
4 changed files with 106 additions and 92 deletions

View File

@ -17,7 +17,7 @@ func init() {
func GET(w http.ResponseWriter, r *http.Request) {
userSession := r.Context().Value("user").(types.User)
component := userView.Main("User Page", userSession.Email, userSession.Username, session.GetSessions(userSession.Email))
component := userView.Main("User Page", userSession, session.GetSessions(userSession.Email))
err := component.Render(r.Context(), w)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)