Skip to content

Commit 6877032

Browse files
committed
refactor(container): rename tag prop to as for consistency with Astro conventions
1 parent 02f2c2f commit 6877032

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

src/components/Container.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
interface Props {
3-
tag?: keyof Pick<HTMLElementTagNameMap, 'div' | 'section' | 'article' | 'header' | 'footer' | 'code'>;
3+
as: keyof Pick<HTMLElementTagNameMap, 'div' | 'section' | 'article' | 'header' | 'footer' | 'code'>;
44
class?: string
55
}
66
7-
const { tag: Tag = 'div', class: className } = Astro.props;
7+
const { as: Tag, class: className } = Astro.props;
88
---
99

1010
<Tag class:list={[

src/components/partials/Footer.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import Container from '@/components/Container.astro';
33
---
44

5-
<Container tag='footer' class='pt-24'>
5+
<Container as='footer' class='pt-24'>
66
<p class="text-center text-muted-foreground text-sm">
77
&copy; {new Date().getFullYear()}. Powered by <a href="https://astro.build" target="_blank" rel="noopener noreferrer">Astro</a> and CVfolio.
88
</p>

src/components/partials/Header.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const isWritingPage = pathname.startsWith('/writing');
88
99
---
1010

11-
<Container tag='header' class="w-full max-w-full flex justify-center items-center">
11+
<Container as='header' class="w-full max-w-full flex justify-center items-center">
1212
<div class="w-max fixed top-0 mt-5 bg-muted-foreground/40 backdrop-blur-md border border-border rounded-full p-1">
1313
<nav class="flex items-center">
1414
<ul class="flex items-center gap-1">

src/pages/index.astro

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ const talks = await getCollection('talks');
1818
---
1919

2020
<BaseLayout seo={entry.data.seo}>
21-
<Container tag='section' class='py-6'>
21+
<Container as='section' class='py-6'>
2222
<Author {...DEFAULT_CONFIGURATION.author} />
2323
</Container>
2424

25-
<Container tag='section' class='py-6'>
25+
<Container as='section' class='py-6'>
2626
<div class="flex flex-col gap-6">
2727
<div class="flex items-center">
2828
<span class="text-headings">About</span>
@@ -34,7 +34,7 @@ const talks = await getCollection('talks');
3434
</Container>
3535
{
3636
links.length > 0 && (
37-
<Container tag='section' class='py-8'>
37+
<Container as='section' class='py-8'>
3838
<div class="flex flex-col gap-5">
3939
<span class="text-headings">Contact</span>
4040
<ul class="flex flex-col gap-3">
@@ -62,7 +62,7 @@ const talks = await getCollection('talks');
6262
}
6363
{
6464
sortedJobs.length > 0 && (
65-
<Container tag='section' class='py-6'>
65+
<Container as='section' class='py-6'>
6666
<div class="flex flex-col gap-5">
6767
<span class="text-headings">Work Experience</span>
6868
<ul class="flex flex-col gap-8">
@@ -76,7 +76,7 @@ const talks = await getCollection('talks');
7676
}
7777
{
7878
talks.length > 0 && (
79-
<Container tag='section' class='py-6'>
79+
<Container as='section' class='py-6'>
8080
<div class="flex flex-col gap-5">
8181
<span class="text-headings">Speaking</span>
8282
<ul class="flex flex-col gap-8">

src/pages/writing/[...slug].astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const { Content } = await render(entry);
2020
---
2121

2222
<BaseLayout seo={entry.data.seo}>
23-
<Container tag='section'>
23+
<Container as='section'>
2424
<article class="flex flex-col gap-6">
2525
<div class="flex flex-col gap-2">
2626
<a href="/writing" class="transition-all text-muted-foreground hover:text-foreground pb-4 text-sm w-max">

src/pages/writing/index.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ const posts = await getCollection('posts');
1111
---
1212

1313
<BaseLayout seo={entry.data.seo}>
14-
<Container tag='section' class='py-6'>
14+
<Container as='section' class='py-6'>
1515
<Author {...DEFAULT_CONFIGURATION.author} />
1616
</Container>
17-
<Container tag='section' class='py-6'>
17+
<Container as='section' class='py-6'>
1818
<div class="flex flex-col gap-6">
1919
<span class="text-headings">Latest posts</span>
2020
<ul class="flex flex-col gap-3">

0 commit comments

Comments
 (0)