Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(astro): add support for footer override #423

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/astro/src/default/components/Footer.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<nav class="bg-tk-elements-footer-backgroundColor border-t border-tk-elements-app-borderColor flex justify-between p-4">
<div class="flex-1">
<slot name="terms" />
</div>
<div class="flex-1">
<slot name="contact-info" />
</div>
<div class="flex-1">
<slot name="copyright" />
</div>
</nav>
14 changes: 14 additions & 0 deletions packages/astro/src/default/components/FooterWrapper.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
// FooterWrapper.astro
import { Footer } from 'tutorialkit:override-components';
import Terms from './Terms.astro';
import ContactInfo from './ContactInfo.astro';

const currentYear = new Date().getFullYear();
---

<Footer>
<Terms slot="terms" />
<ContactInfo slot="contact-info" />
<p slot="copyright">© {currentYear} Your Company. All rights reserved.</p>
</Footer>
2 changes: 2 additions & 0 deletions packages/cli/tests/__snapshots__/create-tutorial.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ exports[`create and eject a project 1`] = `
"public/logo.svg",
"src",
"src/components",
"src/components/Footer.astro",
"src/components/FooterWrapper.astro",
"src/components/HeadTags.astro",
"src/components/LoginButton.tsx",
"src/components/Logo.astro",
Expand Down