Routing issues with new SvelteKit project

I am new to SvelteKit and teaching myself routing.

So I have a pill button called “new notebook”, when I click on it, it does not take me to the page it is supposed to take me.

This is how I have it set up. I have an sr/components/Header.svelte file where I have the following header UI with button I refer to:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code><script>
import { goto } from "$app/navigation";
</script>
<div class="sticky top-0 z-30">
<nav class="bg-white dark:bg-gray-800 shadow">
<div class="max-w-7xl mx-auto px-16">
<div class="flex items-center justify-between h-11">
<a href="/">
<h1 class="text-xl">redis-book</h1>
</a>
<div class="flex">
<div class="flex gap-4">
<button
type="button"
class="bg-gray-500 hover:bg-gray-700 disabled:bg-gray-300 py-2 px-4 flex justify-center items-center text-white transition ease-in duration-200 text-center text-base font-semibold shadow-md focus:outline-none rounded-full flex items-center align-center h-8"
on:click={() => goto("/upload-notebook")}
><span
class="text-center mr-1 material-icons"
style="font-size:20px;">add</span
>Upload Notebook</button
>
<button
type="button"
class="bg-blue-500 hover:bg-blue-700 disabled:bg-blue-300 py-2 px-4 flex justify-center items-center text-white transition ease-in duration-200 text-center text-base font-semibold shadow-md focus:outline-none rounded-full flex items-center align-center h-8"
on:click={() => goto("/new-notebook")}
><span
class="text-center mr-1 material-icons"
style="font-size:20px;">add</span
>New Notebook</button
>
</div>
</div>
</div>
</div>
</nav>
</div>
<style>
.material-icons {
font-size: 24px;
}
</style>
</code>
<code><script> import { goto } from "$app/navigation"; </script> <div class="sticky top-0 z-30"> <nav class="bg-white dark:bg-gray-800 shadow"> <div class="max-w-7xl mx-auto px-16"> <div class="flex items-center justify-between h-11"> <a href="/"> <h1 class="text-xl">redis-book</h1> </a> <div class="flex"> <div class="flex gap-4"> <button type="button" class="bg-gray-500 hover:bg-gray-700 disabled:bg-gray-300 py-2 px-4 flex justify-center items-center text-white transition ease-in duration-200 text-center text-base font-semibold shadow-md focus:outline-none rounded-full flex items-center align-center h-8" on:click={() => goto("/upload-notebook")} ><span class="text-center mr-1 material-icons" style="font-size:20px;">add</span >Upload Notebook</button > <button type="button" class="bg-blue-500 hover:bg-blue-700 disabled:bg-blue-300 py-2 px-4 flex justify-center items-center text-white transition ease-in duration-200 text-center text-base font-semibold shadow-md focus:outline-none rounded-full flex items-center align-center h-8" on:click={() => goto("/new-notebook")} ><span class="text-center mr-1 material-icons" style="font-size:20px;">add</span >New Notebook</button > </div> </div> </div> </div> </nav> </div> <style> .material-icons { font-size: 24px; } </style> </code>
<script>
  import { goto } from "$app/navigation";
</script>

<div class="sticky top-0 z-30">
  <nav class="bg-white dark:bg-gray-800 shadow">
    <div class="max-w-7xl mx-auto px-16">
      <div class="flex items-center justify-between h-11">
        <a href="/">
          <h1 class="text-xl">redis-book</h1>
        </a>
        <div class="flex">
          <div class="flex gap-4">
            <button
              type="button"
              class="bg-gray-500 hover:bg-gray-700 disabled:bg-gray-300 py-2 px-4 flex justify-center items-center text-white transition ease-in duration-200 text-center text-base font-semibold shadow-md focus:outline-none rounded-full flex items-center align-center h-8"
              on:click={() => goto("/upload-notebook")}
              ><span
                class="text-center mr-1 material-icons"
                style="font-size:20px;">add</span
              >Upload Notebook</button
            >
            <button
              type="button"
              class="bg-blue-500 hover:bg-blue-700 disabled:bg-blue-300 py-2 px-4 flex justify-center items-center text-white transition ease-in duration-200 text-center text-base font-semibold shadow-md focus:outline-none rounded-full flex items-center align-center h-8"
              on:click={() => goto("/new-notebook")}
              ><span
                class="text-center mr-1 material-icons"
                style="font-size:20px;">add</span
              >New Notebook</button
            >
          </div>
        </div>
      </div>
    </div>
  </nav>
</div>

<style>
  .material-icons {
    font-size: 24px;
  }
</style>

Below that header I render the following from the root level +page.svelte file:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code><div class="container mx-auto">
<div class="flex justify-between mt-8 mb-1">
<h1 class="text-3xl">Notebooks</h1>
</div>
<div class="text-red-400"></div>
<div class="-mx-4 sm:-mx-8 px-4 sm:px-8 py-2 overflow-x-auto">
<div>No notebooks found - create one to get started</div>
</div>
</div>
</code>
<code><div class="container mx-auto"> <div class="flex justify-between mt-8 mb-1"> <h1 class="text-3xl">Notebooks</h1> </div> <div class="text-red-400"></div> <div class="-mx-4 sm:-mx-8 px-4 sm:px-8 py-2 overflow-x-auto"> <div>No notebooks found - create one to get started</div> </div> </div> </code>
<div class="container mx-auto">
  <div class="flex justify-between mt-8 mb-1">
    <h1 class="text-3xl">Notebooks</h1>
  </div>
  <div class="text-red-400"></div>
  <div class="-mx-4 sm:-mx-8 px-4 sm:px-8 py-2 overflow-x-auto">
    <div>No notebooks found - create one to get started</div>
  </div>
</div>

I believe I have this wrong because when I click on “new notebook” it does not take me to src/routes/new-notebook/+page.svelte

But if I type in /new-notebook in the url, it does take me to the new page with new header and content, but it does not hide the old header content. Should my src/components/Header.svelte be removed from there and added to the root level +page.svelte?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật