Skip to content

Commit 346b3b2

Browse files
committed
fix: run lint on files touched
1 parent 74907e3 commit 346b3b2

4 files changed

Lines changed: 77 additions & 30 deletions

File tree

src/components/SiteFooter.tsx

Lines changed: 59 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { createLink } from "@tanstack/react-router";
22
import { useTranslation } from "react-i18next";
33

4+
import type { Locale } from "../lib/locale";
5+
46
import { Footer } from "../design-system/footer";
57
import { Link } from "../design-system/link";
6-
import type { Locale } from "../lib/locale";
78
import { useLocale } from "../lib/LocaleContext";
89
import { AtStoreLogo } from "./AtStoreLogo";
910

@@ -22,39 +23,80 @@ type SearchLink = {
2223
};
2324
type PlainLink = {
2425
kind: "plain";
25-
to: "/developers/atproto" | "/products/manage" | "/apps/tags" | "/apps/lexicons";
26+
to:
27+
| "/developers/atproto"
28+
| "/products/manage"
29+
| "/apps/tags"
30+
| "/apps/lexicons";
2631
tKey: string;
2732
};
2833
type FooterLinkDef = LocaleLink | SearchLink | PlainLink;
2934

30-
const LINK_GROUPS: Array<{ titleKey?: string; links: FooterLinkDef[] }> = [
35+
const LINK_GROUPS: Array<{ titleKey?: string; links: Array<FooterLinkDef> }> = [
3136
{
3237
links: [
3338
{ kind: "locale", to: "/$locale/about", tKey: "siteFooter.nav.about" },
3439
{ kind: "locale", to: "/$locale", tKey: "siteFooter.nav.home" },
35-
{ kind: "search", to: "/search", search: { sort: "popular" }, tKey: "siteFooter.nav.search" },
36-
{ kind: "plain", to: "/developers/atproto", tKey: "siteFooter.nav.developerApi" },
37-
{ kind: "plain", to: "/products/manage", tKey: "siteFooter.nav.manageListings" },
40+
{
41+
kind: "search",
42+
to: "/search",
43+
search: { sort: "popular" },
44+
tKey: "siteFooter.nav.search",
45+
},
46+
{
47+
kind: "plain",
48+
to: "/developers/atproto",
49+
tKey: "siteFooter.nav.developerApi",
50+
},
51+
{
52+
kind: "plain",
53+
to: "/products/manage",
54+
tKey: "siteFooter.nav.manageListings",
55+
},
3856
],
3957
},
4058
{
4159
titleKey: "siteFooter.apps.groupTitle",
4260
links: [
43-
{ kind: "search", to: "/apps/all", search: { sort: "popular" }, tKey: "siteFooter.apps.allApps" },
61+
{
62+
kind: "search",
63+
to: "/apps/all",
64+
search: { sort: "popular" },
65+
tKey: "siteFooter.apps.allApps",
66+
},
4467
{ kind: "plain", to: "/apps/tags", tKey: "siteFooter.apps.categories" },
45-
{ kind: "plain", to: "/apps/lexicons", tKey: "siteFooter.apps.sharedData" },
68+
{
69+
kind: "plain",
70+
to: "/apps/lexicons",
71+
tKey: "siteFooter.apps.sharedData",
72+
},
4673
],
4774
},
4875
];
4976

5077
function renderLink(link: FooterLinkDef, locale: Locale, label: string) {
5178
switch (link.kind) {
52-
case "locale":
53-
return <FooterLink key={link.to} to={link.to} params={{ locale }}>{label}</FooterLink>;
54-
case "search":
55-
return <FooterLink key={link.to} to={link.to} search={link.search}>{label}</FooterLink>;
56-
case "plain":
57-
return <FooterLink key={link.to} to={link.to}>{label}</FooterLink>;
79+
case "locale": {
80+
return (
81+
<FooterLink key={link.to} to={link.to} params={{ locale }}>
82+
{label}
83+
</FooterLink>
84+
);
85+
}
86+
case "search": {
87+
return (
88+
<FooterLink key={link.to} to={link.to} search={link.search}>
89+
{label}
90+
</FooterLink>
91+
);
92+
}
93+
case "plain": {
94+
return (
95+
<FooterLink key={link.to} to={link.to}>
96+
{label}
97+
</FooterLink>
98+
);
99+
}
58100
}
59101
}
60102

@@ -74,7 +116,9 @@ export function SiteFooter() {
74116
key={i}
75117
title={group.titleKey ? t(group.titleKey as never) : undefined}
76118
>
77-
{group.links.map((link) => renderLink(link, locale, t(link.tKey as never)))}
119+
{group.links.map((link) =>
120+
renderLink(link, locale, t(link.tKey as never)),
121+
)}
78122
</Footer.NavGroup>
79123
))}
80124
</Footer.NavSection>

src/components/SiteHeader.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ export function SiteHeader() {
4545

4646
return (
4747
<Navbar hideHamburgerButton={true}>
48-
<NavbarLogoLink to="/$locale" params={{ locale }} style={styles.logoContent} hasUnderline={false}>
48+
<NavbarLogoLink
49+
to="/$locale"
50+
params={{ locale }}
51+
style={styles.logoContent}
52+
hasUnderline={false}
53+
>
4954
<AtStoreLogo variant="navbar" />
5055
</NavbarLogoLink>
5156

src/routes/$locale.index.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,16 @@ const styles = stylex.create({
109109
transitionTimingFunction: "ease-in-out",
110110
height: "100%",
111111

112-
":hover::before": {
113-
opacity: 1,
114-
},
115112
"::before": {
116113
inset: 0,
117114
borderRadius: radius.lg,
118115
cornerShape: "squircle",
119116
boxShadow: shadow.lg,
120117
content: "''",
121-
opacity: 0,
118+
opacity: {
119+
default: 0,
120+
":hover": 1,
121+
},
122122
position: "absolute",
123123
transitionDuration: animationDuration.slow,
124124
transitionProperty: "opacity",
@@ -172,16 +172,16 @@ const styles = stylex.create({
172172
boxShadow: shadow.md,
173173
position: "relative",
174174

175-
":hover::before": {
176-
opacity: 1,
177-
},
178175
"::before": {
179176
inset: 0,
180177
borderRadius: radius.lg,
181178
cornerShape: "squircle",
182179
boxShadow: shadow.lg,
183180
content: "''",
184-
opacity: 0,
181+
opacity: {
182+
default: 0,
183+
":hover": 1,
184+
},
185185
position: "absolute",
186186
transitionDuration: animationDuration.default,
187187
transitionProperty: "opacity",
@@ -281,15 +281,15 @@ const styles = stylex.create({
281281
paddingRight: horizontalSpace["2xl"],
282282
paddingTop: verticalSpace["2xl"],
283283

284-
":hover::after": {
285-
opacity: 1,
286-
},
287284
"::after": {
288285
inset: 0,
289286
borderRadius: radius.md,
290287
boxShadow: shadow.lg,
291288
content: "''",
292-
opacity: 0,
289+
opacity: {
290+
default: 0,
291+
":hover": 1,
292+
},
293293
position: "absolute",
294294
transitionDuration: animationDuration.slow,
295295
transitionProperty: "opacity",

src/routes/$locale.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ export const Route = createFileRoute("/$locale")({
3131
href: restOfPath + location.searchStr,
3232
});
3333
}
34-
35-
3634
},
3735
component: LocaleRoute,
3836
});

0 commit comments

Comments
 (0)