prettier sweep

i18n
mrshmllow 2 years ago committed by Michal
parent f3812219c6
commit ecad2de54a
No known key found for this signature in database
GPG Key ID: 52F8801FC912EB4F

@ -2,9 +2,9 @@ name: Lint Code
on: on:
workflow_dispatch: workflow_dispatch:
push: push:
branches: [ main ] branches: [main]
pull_request: pull_request:
branches: [ main ] branches: [main]
jobs: jobs:
lint: lint:
@ -15,9 +15,8 @@ jobs:
- name: Setup Node - name: Setup Node
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
cache: 'yarn' cache: "yarn"
- name: Install - name: Install
run: yarn install --frozen-lockfile run: yarn install --frozen-lockfile
- name: Lint - name: Lint
run: yarn lint run: yarn lint

@ -29,8 +29,9 @@ const IconLocaleSwitcher = () => {
return ( return (
<> <>
<button <button
className={`${locale !== defaultLocale ? "text-ctp-mauve" : "text-ctp-subtext1" className={`${
} mr-2 hidden items-center rounded-lg p-2.5 text-center text-sm font-medium hover:bg-ctp-mantle focus:outline-none focus:ring-4 md:inline-flex`} locale !== defaultLocale ? "text-ctp-mauve" : "text-ctp-subtext1"
} mr-2 hidden items-center rounded-lg p-2.5 text-center text-sm font-medium hover:bg-ctp-mantle focus:outline-none focus:ring-4 md:inline-flex`}
type="button" type="button"
onClick={() => { onClick={() => {
setToggled(!toggled); setToggled(!toggled);
@ -46,8 +47,9 @@ const IconLocaleSwitcher = () => {
<FontAwesomeIcon size="lg" icon={faLanguage} fixedWidth /> <FontAwesomeIcon size="lg" icon={faLanguage} fixedWidth />
</button> </button>
<div <div
className={`${!toggled ? "hidden " : "" className={`${
}z-10 absolute mt-12 w-32 rounded bg-ctp-base font-semibold shadow`} !toggled ? "hidden " : ""
}z-10 absolute mt-12 w-32 rounded bg-ctp-base font-semibold shadow`}
ref={ref} ref={ref}
onBlur={(e) => { onBlur={(e) => {
const currentTarget = e.currentTarget; const currentTarget = e.currentTarget;
@ -67,8 +69,9 @@ const IconLocaleSwitcher = () => {
{locales!.map((loc) => ( {locales!.map((loc) => (
<li key={loc}> <li key={loc}>
<button <button
className={`${locale === loc ? "text-ctp-mauve" : "" className={`${
} flex w-full items-center gap-2 py-2 px-4 hover:bg-ctp-mantle`} locale === loc ? "text-ctp-mauve" : ""
} flex w-full items-center gap-2 py-2 px-4 hover:bg-ctp-mantle`}
onClick={() => changeLocale(loc)} onClick={() => changeLocale(loc)}
> >
{localeToName.of(loc)} {localeToName.of(loc)}

@ -27,7 +27,7 @@ const NativeLocaleSwitcher = () => {
<select <select
onChange={(e) => { onChange={(e) => {
push(asPath, undefined, { locale: e.currentTarget.value }); push(asPath, undefined, { locale: e.currentTarget.value });
e.preventDefault() e.preventDefault();
}} }}
className="absolute inset-0 h-full w-full appearance-none opacity-0" className="absolute inset-0 h-full w-full appearance-none opacity-0"
> >

@ -12,8 +12,9 @@ const TreeNode: FC<{ node: ITreeItem; path: string }> = ({
<> <>
{children.length > 0 ? ( {children.length > 0 ? (
<span <span
className={`text-left ${current ? "font-semibold" : "" className={`text-left ${
} text-ctp-text`} current ? "font-semibold" : ""
} text-ctp-text`}
> >
{pretty ? pretty : value} {pretty ? pretty : value}
</span> </span>
@ -21,10 +22,11 @@ const TreeNode: FC<{ node: ITreeItem; path: string }> = ({
<span className="flex items-center gap-2"> <span className="flex items-center gap-2">
<Link href={path}> <Link href={path}>
<a <a
className={`${current className={`${
current
? "border-ctp-mauve font-semibold text-ctp-mauve" ? "border-ctp-mauve font-semibold text-ctp-mauve"
: "border-transparent font-normal text-ctp-subtext0 hover:border-ctp-surface2 hover:text-ctp-subtext1" : "border-transparent font-normal text-ctp-subtext0 hover:border-ctp-surface2 hover:text-ctp-subtext1"
} first-letter -ml-px w-full border-l pl-4 no-underline transition-colors hover:no-underline`} } first-letter -ml-px w-full border-l pl-4 no-underline transition-colors hover:no-underline`}
> >
{pretty ? pretty : value} {pretty ? pretty : value}
</a> </a>
@ -36,8 +38,9 @@ const TreeNode: FC<{ node: ITreeItem; path: string }> = ({
{children.length > 0 && ( {children.length > 0 && (
<div <div
className={`flex flex-col gap-1 ${value !== "root" ? "border-l border-ctp-surface0" : "" className={`flex flex-col gap-1 ${
}`} value !== "root" ? "border-l border-ctp-surface0" : ""
}`}
> >
{children.map((child) => ( {children.map((child) => (
<TreeNode <TreeNode

@ -34,10 +34,11 @@ const Navbar = () => {
return ( return (
<nav <nav
className={`py-2.5 ${scrollTop != 0 || toggled className={`py-2.5 ${
scrollTop != 0 || toggled
? "border-b border-ctp-mantle bg-ctp-base bg-opacity-80 backdrop-blur-md" ? "border-b border-ctp-mantle bg-ctp-base bg-opacity-80 backdrop-blur-md"
: "" : ""
} fixed top-0 left-0 z-20 w-full `} } fixed top-0 left-0 z-20 w-full `}
> >
<div className="container mx-auto flex max-w-8xl flex-wrap items-center justify-between px-4 md:px-8"> <div className="container mx-auto flex max-w-8xl flex-wrap items-center justify-between px-4 md:px-8">
<Link href="/"> <Link href="/">
@ -89,17 +90,19 @@ const Navbar = () => {
</button> </button>
</div> </div>
<div <div
className={`${!toggled ? "hidden" : "" className={`${
} w-full items-center justify-between md:visible md:order-1 md:flex md:w-auto`} !toggled ? "hidden" : ""
} w-full items-center justify-between md:visible md:order-1 md:flex md:w-auto`}
> >
<ul className="mt-4 flex flex-col gap-2 rounded-lg border border-ctp-mantle bg-ctp-base p-4 md:mt-0 md:flex-row md:gap-0 md:space-x-8 md:border-0 md:bg-inherit md:text-sm md:font-medium md:dark:bg-inherit"> <ul className="mt-4 flex flex-col gap-2 rounded-lg border border-ctp-mantle bg-ctp-base p-4 md:mt-0 md:flex-row md:gap-0 md:space-x-8 md:border-0 md:bg-inherit md:text-sm md:font-medium md:dark:bg-inherit">
<li> <li>
<Link href="/"> <Link href="/">
<a <a
className={`block rounded py-2 pr-4 pl-3 md:bg-transparent ${route === "/" className={`block rounded py-2 pr-4 pl-3 md:bg-transparent ${
route === "/"
? "bg-ctp-mauve text-ctp-base md:text-ctp-mauve" ? "bg-ctp-mauve text-ctp-base md:text-ctp-mauve"
: "text-ctp-text md:hover:text-ctp-mauve" : "text-ctp-text md:hover:text-ctp-mauve"
} no-underline md:p-0`} } no-underline md:p-0`}
> >
{common("locations.home")} {common("locations.home")}
</a> </a>
@ -120,10 +123,11 @@ const Navbar = () => {
<li> <li>
<Link href="/docs/"> <Link href="/docs/">
<a <a
className={`block rounded py-2 pr-4 pl-3 md:bg-transparent ${route.split("/")[1] === "docs" className={`block rounded py-2 pr-4 pl-3 md:bg-transparent ${
route.split("/")[1] === "docs"
? "bg-ctp-mauve text-ctp-base md:text-ctp-mauve" ? "bg-ctp-mauve text-ctp-base md:text-ctp-mauve"
: "text-ctp-text md:hover:text-ctp-mauve" : "text-ctp-text md:hover:text-ctp-mauve"
} no-underline md:p-0`} } no-underline md:p-0`}
> >
{common("locations.docs")} {common("locations.docs")}
</a> </a>

@ -108,9 +108,7 @@ const Home: NextPageWithLayout = () => {
<HomeSection className="pb-16 md:pb-28"> <HomeSection className="pb-16 md:pb-28">
<div className="basis-1/4"> <div className="basis-1/4">
<p className="mt-8 font-semibold text-ctp-red"> <p className="mt-8 font-semibold text-ctp-red">{t("amethyst.tag")}</p>
{t("amethyst.tag")}
</p>
<p className="mt-4 text-3xl font-extrabold tracking-tight text-ctp-text sm:text-4xl"> <p className="mt-4 text-3xl font-extrabold tracking-tight text-ctp-text sm:text-4xl">
{t("amethyst.title")} {t("amethyst.title")}
</p> </p>

@ -40,4 +40,3 @@
.prose > table { .prose > table {
display: table !important; display: table !important;
} }

@ -47,22 +47,22 @@ module.exports = {
"--tw-prose-th-borders": "#9ca0b0", "--tw-prose-th-borders": "#9ca0b0",
"--tw-prose-td-borders": "#9ca0b0", "--tw-prose-td-borders": "#9ca0b0",
'--tw-prose-invert-body': "#cdd6f4", "--tw-prose-invert-body": "#cdd6f4",
'--tw-prose-invert-headings': "#cdd6f4", "--tw-prose-invert-headings": "#cdd6f4",
// '--tw-prose-invert-lead': "", // '--tw-prose-invert-lead': "",
'--tw-prose-invert-links': "#cdd6f4", "--tw-prose-invert-links": "#cdd6f4",
// '--tw-prose-invert-bold': "", // '--tw-prose-invert-bold': "",
'--tw-prose-invert-counters': "#7c7f93", "--tw-prose-invert-counters": "#7c7f93",
'--tw-prose-invert-bullets': "#7c7f93", "--tw-prose-invert-bullets": "#7c7f93",
'--tw-prose-invert-hr': "#cdd6f4", "--tw-prose-invert-hr": "#cdd6f4",
'--tw-prose-invert-quotes': "#cdd6f4", "--tw-prose-invert-quotes": "#cdd6f4",
'--tw-prose-invert-quote-borders': "#6c7086", "--tw-prose-invert-quote-borders": "#6c7086",
// '--tw-prose-invert-captions': "", // '--tw-prose-invert-captions': "",
'--tw-prose-invert-code': "#cdd6f4", "--tw-prose-invert-code": "#cdd6f4",
// '--tw-prose-invert-pre-code': "", // '--tw-prose-invert-pre-code': "",
// '--tw-prose-invert-pre-bg': "", // '--tw-prose-invert-pre-bg': "",
'--tw-prose-invert-th-borders': "#6c7086", "--tw-prose-invert-th-borders": "#6c7086",
'--tw-prose-invert-td-borders': "#6c7086", "--tw-prose-invert-td-borders": "#6c7086",
}, },
}, },
}, },

Loading…
Cancel
Save