Refactor App component to implement routing with svelte-spa-router, replacing static components with dynamic routes for improved navigation. Update routes for Home, About, Contact, Careers, Blog, and legal services.
This commit is contained in:
@@ -1,18 +1,37 @@
|
||||
<script lang="ts">
|
||||
import Hero from './components/Hero.svelte';
|
||||
import Services from './components/Services.svelte';
|
||||
import Testimonials from './components/Testimonials.svelte';
|
||||
import About from './components/About.svelte';
|
||||
import Contact from './components/Contact.svelte';
|
||||
import Router from 'svelte-spa-router';
|
||||
import Home from './routes/Home.svelte';
|
||||
import About from './routes/about.svelte';
|
||||
import Contact from './routes/contact.svelte';
|
||||
import Careers from './routes/careers.svelte';
|
||||
import Blog from './routes/blog.svelte';
|
||||
import Privacy from './routes/legal/privacy.svelte';
|
||||
import Terms from './routes/legal/terms.svelte';
|
||||
import Cookies from './routes/legal/cookies.svelte';
|
||||
import Migrations from './routes/services/migrations.svelte';
|
||||
import Email from './routes/services/email.svelte';
|
||||
import Security from './routes/services/security.svelte';
|
||||
import Helpdesk from './routes/services/helpdesk.svelte';
|
||||
import Footer from './components/Footer.svelte';
|
||||
|
||||
const routes = {
|
||||
'/': Home,
|
||||
'/about': About,
|
||||
'/contact': Contact,
|
||||
'/careers': Careers,
|
||||
'/blog': Blog,
|
||||
'/legal/privacy': Privacy,
|
||||
'/legal/terms': Terms,
|
||||
'/legal/cookies': Cookies,
|
||||
'/services/migrations': Migrations,
|
||||
'/services/email': Email,
|
||||
'/services/security': Security,
|
||||
'/services/helpdesk': Helpdesk
|
||||
};
|
||||
</script>
|
||||
|
||||
<main class="min-h-screen bg-white">
|
||||
<Hero />
|
||||
<Services />
|
||||
<Testimonials />
|
||||
<About />
|
||||
<Contact />
|
||||
<Router {routes} />
|
||||
<Footer />
|
||||
</main>
|
||||
|
||||
|
9
src/routes/Home.svelte
Normal file
9
src/routes/Home.svelte
Normal file
@@ -0,0 +1,9 @@
|
||||
<script lang="ts">
|
||||
import Hero from '../components/Hero.svelte';
|
||||
import Services from '../components/Services.svelte';
|
||||
import Testimonials from '../components/Testimonials.svelte';
|
||||
</script>
|
||||
|
||||
<Hero />
|
||||
<Services />
|
||||
<Testimonials />
|
Reference in New Issue
Block a user