Skip to content

Commit 1578073

Browse files
committedSep 25, 2023
Replace className with Astro.props.class
1 parent 0c65d88 commit 1578073

26 files changed

+55
-69
lines changed
 

Diff for: ‎src/components/ButtonIcon.astro

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import { cn } from "@/utils/css";
55
interface Props {
66
href: string;
77
icon: keyof typeof Icons;
8-
className?: string;
8+
class?: string;
99
}
1010
11-
const { href, icon, className = "" } = Astro.props;
11+
const { href, icon } = Astro.props;
1212
1313
const Icon = Icons[icon];
1414
---
@@ -18,12 +18,12 @@ const Icon = Icons[icon];
1818
"rounded-lg border-2 px-4 py-2 text-lg font-light sm:px-5 sm:text-2xl",
1919
"border-gray-800 bg-white hover:bg-gray-800 hover:text-gray-50",
2020
"transition-all duration-200",
21-
className,
21+
Astro.props.class,
2222
)}
2323
href={href}
2424
>
2525
<span class="flex items-center space-x-2 sm:space-x-3">
26-
<Icon className="w-6 hover:text-gray-50" />
26+
<Icon class="w-6 hover:text-gray-50" />
2727
<span><slot /></span>
2828
</span>
2929
</a>

Diff for: ‎src/components/Link.astro

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import { cn } from "@/utils/css";
44
type Props = {
55
href: string;
66
ariaLabel?: string;
7-
className?: string;
7+
class?: string;
88
};
99
10-
const { href, ariaLabel, className = "" } = Astro.props;
10+
const { href, ariaLabel } = Astro.props;
1111
---
1212

1313
<a
14-
class={cn("text-sky-500 hover:text-sky-700", className)}
14+
class={cn("text-sky-500 hover:text-sky-700", Astro.props.class)}
1515
href={href}
1616
aria-label={ariaLabel}
1717
>

Diff for: ‎src/components/icons/Chain.astro

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
import type IconProps from "@/types/IconProps";
33
44
type Props = IconProps;
5-
6-
const { className = "" } = Astro.props;
75
---
86

9-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class={className}>
7+
<svg
8+
xmlns="http://www.w3.org/2000/svg"
9+
viewBox="0 0 512 512"
10+
class={Astro.props.class}
11+
>
1012
<path
1113
fill="currentColor"
1214
d="M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"

Diff for: ‎src/components/icons/Code.astro

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@ import type IconProps from "@/types/IconProps";
33
import { cn } from "@/utils/css";
44
55
type Props = IconProps;
6-
7-
const { className = "" } = Astro.props;
86
---
97

108
<svg
119
aria-hidden="true"
1210
focusable="false"
1311
data-prefix="fas"
1412
data-icon="code"
15-
class={cn("svg-inline--fa fa-code fa-w-20", className)}
13+
class={cn("svg-inline--fa fa-code fa-w-20", Astro.props.class)}
1614
role="img"
1715
xmlns="http://www.w3.org/2000/svg"
1816
viewBox="0 0 640 512"

Diff for: ‎src/components/icons/Github.astro

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@ import type IconProps from "@/types/IconProps";
33
import { cn } from "@/utils/css";
44
55
type Props = IconProps;
6-
7-
const { className = "" } = Astro.props;
86
---
97

108
<svg
119
aria-hidden="true"
1210
focusable="false"
1311
data-prefix="fab"
1412
data-icon="github"
15-
class={cn("svg-inline--fa fa-github fa-w-16", className)}
13+
class={cn("svg-inline--fa fa-github fa-w-16", Astro.props.class)}
1614
role="img"
1715
xmlns="http://www.w3.org/2000/svg"
1816
viewBox="0 0 496 512"

Diff for: ‎src/components/icons/Link.astro

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@ import type IconProps from "@/types/IconProps";
33
import { cn } from "@/utils/css";
44
55
type Props = IconProps;
6-
7-
const { className = "" } = Astro.props;
86
---
97

108
<svg
119
aria-hidden="true"
1210
focusable="false"
1311
data-prefix="fas"
1412
data-icon="external-link-alt"
15-
class={cn("svg-inline--fa fa-external-link-alt fa-w-16", className)}
13+
class={cn("svg-inline--fa fa-external-link-alt fa-w-16", Astro.props.class)}
1614
role="img"
1715
xmlns="http://www.w3.org/2000/svg"
1816
viewBox="0 0 512 512"

Diff for: ‎src/components/icons/Linkedin.astro

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@ import type IconProps from "@/types/IconProps";
33
import { cn } from "@/utils/css";
44
55
type Props = IconProps;
6-
7-
const { className = "" } = Astro.props;
86
---
97

108
<svg
119
aria-hidden="true"
1210
focusable="false"
1311
data-prefix="fab"
1412
data-icon="linkedin-in"
15-
class={cn("svg-inline--fa fa-linkedin-in fa-w-14", className)}
13+
class={cn("svg-inline--fa fa-linkedin-in fa-w-14", Astro.props.class)}
1614
role="img"
1715
xmlns="http://www.w3.org/2000/svg"
1816
viewBox="0 0 448 512"

Diff for: ‎src/components/icons/Mail.astro

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@ import type IconProps from "@/types/IconProps";
33
import { cn } from "@/utils/css";
44
55
type Props = IconProps;
6-
7-
const { className = "" } = Astro.props;
86
---
97

108
<svg
119
aria-hidden="true"
1210
focusable="false"
1311
data-prefix="fas"
1412
data-icon="envelope"
15-
class={cn("svg-inline--fa fa-envelope fa-w-16", className)}
13+
class={cn("svg-inline--fa fa-envelope fa-w-16", Astro.props.class)}
1614
role="img"
1715
xmlns="http://www.w3.org/2000/svg"
1816
viewBox="0 0 512 512"

Diff for: ‎src/components/icons/Menu.astro

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@ import type IconProps from "@/types/IconProps";
33
import { cn } from "@/utils/css";
44
55
type Props = IconProps;
6-
7-
const { className = "" } = Astro.props;
86
---
97

108
<svg
119
aria-hidden="true"
1210
focusable="false"
1311
data-prefix="fas"
1412
data-icon="bars"
15-
class={cn("svg-inline--fa fa-bars fa-w-14", className)}
13+
class={cn("svg-inline--fa fa-bars fa-w-14", Astro.props.class)}
1614
role="img"
1715
xmlns="http://www.w3.org/2000/svg"
1816
viewBox="0 0 448 512"

Diff for: ‎src/components/icons/Rss.astro

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
import type IconProps from "@/types/IconProps";
33
44
type Props = IconProps;
5-
6-
const { className = "" } = Astro.props;
75
---
86

9-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class={className}>
7+
<svg
8+
xmlns="http://www.w3.org/2000/svg"
9+
viewBox="0 0 448 512"
10+
class={Astro.props.class}
11+
>
1012
<path
1113
fill="currentColor"
1214
d="M128.081 415.959c0 35.369-28.672 64.041-64.041 64.041S0 451.328 0 415.959s28.672-64.041 64.041-64.041 64.04 28.673 64.04 64.041zm175.66 47.25c-8.354-154.6-132.185-278.587-286.95-286.95C7.656 175.765 0 183.105 0 192.253v48.069c0 8.415 6.49 15.472 14.887 16.018 111.832 7.284 201.473 96.702 208.772 208.772.547 8.397 7.604 14.887 16.018 14.887h48.069c9.149.001 16.489-7.655 15.995-16.79zm144.249.288C439.596 229.677 251.465 40.445 16.503 32.01 7.473 31.686 0 38.981 0 48.016v48.068c0 8.625 6.835 15.645 15.453 15.999 191.179 7.839 344.627 161.316 352.465 352.465.353 8.618 7.373 15.453 15.999 15.453h48.068c9.034-.001 16.329-7.474 16.005-16.504z"

Diff for: ‎src/components/icons/Server.astro

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@ import type IconProps from "@/types/IconProps";
33
import { cn } from "@/utils/css";
44
55
type Props = IconProps;
6-
7-
const { className = "" } = Astro.props;
86
---
97

108
<svg
119
aria-hidden="true"
1210
focusable="false"
1311
data-prefix="fas"
1412
data-icon="server"
15-
class={cn("svg-inline--fa fa-server fa-w-16", className)}
13+
class={cn("svg-inline--fa fa-server fa-w-16", Astro.props.class)}
1614
role="img"
1715
xmlns="http://www.w3.org/2000/svg"
1816
viewBox="0 0 512 512"

Diff for: ‎src/components/icons/Tag.astro

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
import type IconProps from "@/types/IconProps";
33
44
type Props = IconProps;
5-
6-
const { className = "" } = Astro.props;
75
---
86

9-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class={className}>
7+
<svg
8+
xmlns="http://www.w3.org/2000/svg"
9+
viewBox="0 0 512 512"
10+
class={Astro.props.class}
11+
>
1012
<path
1113
fill="currentColor"
1214
d="M0 252.118V48C0 21.49 21.49 0 48 0h204.118a48 48 0 0 1 33.941 14.059l211.882 211.882c18.745 18.745 18.745 49.137 0 67.882L293.823 497.941c-18.745 18.745-49.137 18.745-67.882 0L14.059 286.059A48 48 0 0 1 0 252.118zM112 64c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48z"

Diff for: ‎src/components/icons/User.astro

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@ import type IconProps from "@/types/IconProps";
33
import { cn } from "@/utils/css";
44
55
type Props = IconProps;
6-
7-
const { className = "" } = Astro.props;
86
---
97

108
<svg
119
aria-hidden="true"
1210
focusable="false"
1311
data-prefix="fas"
1412
data-icon="user"
15-
class={cn("svg-inline--fa fa-user fa-w-14", className)}
13+
class={cn("svg-inline--fa fa-user fa-w-14", Astro.props.class)}
1614
role="img"
1715
xmlns="http://www.w3.org/2000/svg"
1816
viewBox="0 0 448 512"

Diff for: ‎src/features/blog/BlogAuthor.astro

+4-6
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,15 @@ import ChainIcon from "@/components/icons/Chain.astro";
55
import { cn } from "@/utils/css";
66
77
interface Props {
8-
className?: string;
8+
class?: string;
99
}
10-
11-
const { className = "" } = Astro.props;
1210
---
1311

1412
<div
1513
class={cn(
1614
"flex flex-col space-y-3",
1715
"sm:flex-row sm:items-center sm:space-x-5 sm:space-y-0",
18-
className,
16+
Astro.props.class,
1917
)}
2018
>
2119
<div class="w-28 sm:w-32">
@@ -40,8 +38,8 @@ const { className = "" } = Astro.props;
4038
</p>
4139

4240
<div class="flex">
43-
<Link href="/" className="flex space-x-1">
44-
<ChainIcon className="w-4" />
41+
<Link href="/" class="flex space-x-1">
42+
<ChainIcon class="w-4" />
4543
<span>https://iAdw.in</span>
4644
</Link>
4745
</div>

Diff for: ‎src/features/blog/BlogHeader.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ import RssIcon from "@/components/icons/Rss.astro";
77
<a href="/blog" class="font-sans text-3xl font-normal text-gray-900"> Blog</a>
88

99
<a href="/blog/rss.xml" target="_parent">
10-
<RssIcon className="mt-1 h-5" />
10+
<RssIcon class="mt-1 h-5" />
1111
</a>
1212
</Header>

Diff for: ‎src/features/blog/BlogPostEntries.astro

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import TagLinks from "@/features/blog/TagLinks.astro";
33
import { cn } from "@/utils/css";
44
55
interface Props {
6-
className?: string;
6+
class?: string;
77
posts: {
88
url: string;
99
title: string;
@@ -12,10 +12,10 @@ interface Props {
1212
}[];
1313
}
1414
15-
const { className, posts } = Astro.props;
15+
const { posts } = Astro.props;
1616
---
1717

18-
<div class={cn("flex flex-col space-y-8", className)}>
18+
<div class={cn("flex flex-col space-y-8", Astro.props.class)}>
1919
{
2020
posts.map((post) => {
2121
const { url, title, date } = post;

Diff for: ‎src/features/blog/TagLinks.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interface Props {
88
const { tags } = Astro.props;
99
---
1010

11-
<TagIcon className="mr-1 inline-block h-2.5" />
11+
<TagIcon class="mr-1 inline-block h-2.5" />
1212

1313
{
1414
tags

Diff for: ‎src/features/landing/Connect.astro

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Section from "@/features/landing/Section.astro";
44
import { connect } from "@/features/landing/data";
55
---
66

7-
<Section id="connect" className="bg-white">
7+
<Section id="connect" class="bg-white">
88
<Fragment slot="title">Connect</Fragment>
99

1010
<div class="mx-auto max-w-4xl text-center text-gray-800">
@@ -16,7 +16,7 @@ import { connect } from "@/features/landing/data";
1616
>
1717
{
1818
connect.map((item) => (
19-
<ButtonIcon href={item.url} icon={item.icon} className="block w-full">
19+
<ButtonIcon href={item.url} icon={item.icon} class="block w-full">
2020
{item.title}
2121
</ButtonIcon>
2222
))

Diff for: ‎src/features/landing/Hero.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { cn } from "@/utils/css";
1616
type="button"
1717
class="js-nav-toggle absolute right-5 top-4 w-9 p-2 md:hidden"
1818
>
19-
<MenuIcon className="w-full text-white" />
19+
<MenuIcon class="w-full text-white" />
2020
</button>
2121

2222
{/* Hero text */}

Diff for: ‎src/features/landing/Projects.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { projects } from "@/features/landing/data";
2525
<h3 class="mb-1.5 flex items-center justify-center space-x-1 text-2xl font-light md:justify-start">
2626
<span>{title}</span>
2727
<Link href={url} ariaLabel="Preview">
28-
<LinkIcon className="w-6 p-1" />
28+
<LinkIcon class="w-6 p-1" />
2929
</Link>
3030
</h3>
3131

Diff for: ‎src/features/landing/Section.astro

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import { cn } from "@/utils/css";
33
44
interface Props {
55
id: string;
6-
className?: string;
6+
class?: string;
77
}
88
9-
const { id, className = "" } = Astro.props;
9+
const { id } = Astro.props;
1010
---
1111

12-
<section id={id} class={cn("px-7 py-16 md:py-32", className)}>
12+
<section id={id} class={cn("px-7 py-16 md:py-32", Astro.props.class)}>
1313
{
1414
Astro.slots.has("title") && (
1515
<div class="mb-8 flex justify-center">
@@ -19,7 +19,7 @@ const { id, className = "" } = Astro.props;
1919
"text-center font-title text-2xl uppercase tracking-wider",
2020
"after:mx-auto after:-mt-1 after:block after:border-b-2",
2121
"after:border-black after:transition-all after:duration-300 ",
22-
className,
22+
Astro.props.class,
2323
)}
2424
>
2525
<slot name="title" />

Diff for: ‎src/features/landing/Skills.astro

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { skills } from "@/features/landing/data";
55
import { cn } from "@/utils/css";
66
---
77

8-
<Section id="skills" className="bg-white">
8+
<Section id="skills" class="bg-white">
99
<Fragment slot="title">Skills</Fragment>
1010

1111
<div
@@ -27,7 +27,7 @@ import { cn } from "@/utils/css";
2727
"border-2 border-black bg-white",
2828
)}
2929
>
30-
<SkillIcon className="h-5" />
30+
<SkillIcon class="h-5" />
3131
</div>
3232

3333
<h3 class="mb-4 mt-1 text-center font-title text-xl uppercase tracking-wider">

Diff for: ‎src/layouts/base.astro

+2-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interface Props {
1111
description?: string;
1212
image?: ImageMetadata | null;
1313
isPost?: boolean;
14-
className?: string;
14+
class?: string;
1515
}
1616
1717
const title = Astro.props.title ?? "iAdwin";
@@ -48,8 +48,6 @@ const seo = {
4848
],
4949
},
5050
};
51-
52-
const className = Astro.props.className ?? "";
5351
---
5452

5553
<html lang="en">
@@ -88,7 +86,7 @@ const className = Astro.props.className ?? "";
8886
<slot name="head" />
8987
</head>
9088

91-
<body class={cn("flex flex-col bg-gray-50 min-h-screen", className)}>
89+
<body class={cn("flex flex-col bg-gray-50 min-h-screen", Astro.props.class)}>
9290
<slot />
9391
</body>
9492
</html>

Diff for: ‎src/pages/[slug].astro

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ const { Content } = await post.render();
7676
<hr />
7777
</div>
7878

79-
<BlogAuthor className="mb-9 mt-14 font-sans text-base" />
79+
<BlogAuthor class="mb-9 mt-14 font-sans text-base" />
8080

8181
<Link
8282
href="/blog"
83-
className="font-sans !text-gray-900 underline underline-offset-2"
83+
class="font-sans !text-gray-900 underline underline-offset-2"
8484
>
8585
&larr; Back to all posts
8686
</Link>

Diff for: ‎src/pages/blog.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const posts = await getCollection(
1616
<BlogHeader />
1717

1818
<BlogPostEntries
19-
className="mx-auto mb-12 mt-4 w-full max-w-blog flex-grow px-5"
19+
class="mx-auto mb-12 mt-4 w-full max-w-blog flex-grow px-5"
2020
posts={posts
2121
.sort((a, b) => b.data.date.getTime() - a.data.date.getTime())
2222
.map((post) => ({

Diff for: ‎src/types/IconProps.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
interface IconProps {
2-
className?: string;
2+
class?: string;
33
}
44

55
export default IconProps;

0 commit comments

Comments
 (0)
Please sign in to comment.