Skip to content

Commit 27320c5

Browse files
deeriuioiua
andauthored
chore: upgrade to Fresh 1.6.1 and std 0.208.0 (#646)
closes #644 I see the guidelines have changed since I last contributed (thanks github!) and that caused me to look for an issue. Fortunately there was the above, but I see you want tailwind as well. I'll open this as a draft for now. --------- Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
1 parent 311e103 commit 27320c5

32 files changed

+259
-274
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ See other examples of blog post files in [/posts](/posts).
173173

174174
You can customize theme options such as spacing, color, etc. By default, Deno
175175
SaaSKit comes with `primary` and `secondary` colors predefined within
176-
`twind.config.ts`. Change these values to match your desired color scheme.
176+
`tailwind.config.ts`. Change these values to match your desired color scheme.
177177

178178
### Cover Image
179179

components/Footer.tsx

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
// Copyright 2023 the Deno authors. All rights reserved. MIT license.
2-
import {
3-
ACTIVE_LINK_STYLES,
4-
LINK_STYLES,
5-
NAV_STYLES,
6-
SITE_BAR_STYLES,
7-
SITE_NAME,
8-
} from "@/utils/constants.ts";
9-
import { cx } from "@twind/core";
2+
import { SITE_NAME } from "@/utils/constants.ts";
103
import IconBrandDiscord from "tabler_icons_tsx/brand-discord.tsx";
114
import IconBrandGithub from "tabler_icons_tsx/brand-github.tsx";
125
import IconRss from "tabler_icons_tsx/rss.tsx";
@@ -66,33 +59,31 @@ export interface FooterProps {
6659

6760
export default function Footer(props: FooterProps) {
6861
return (
69-
<footer
70-
class={`${SITE_BAR_STYLES} flex-col md:flex-row mt-8`}
71-
>
62+
<footer class="site-bar-styles flex-col md:flex-row mt-8">
7263
<p>© {SITE_NAME}</p>
73-
<nav class={NAV_STYLES}>
64+
<nav class="nav-styles">
7465
<a
7566
href="/blog"
76-
class={cx(LINK_STYLES, ACTIVE_LINK_STYLES)}
67+
class="link-styles data-[current]:!text-black data-[current]:dark:!text-white"
7768
>
7869
Blog
7970
</a>
80-
<a href="/feed" aria-label="Deno Hunt RSS Feed" class={LINK_STYLES}>
71+
<a href="/feed" aria-label="Deno Hunt RSS Feed" class="link-styles">
8172
<IconRss class="h-6 w-6" />
8273
</a>
8374
<a
8475
href="https://discord.gg/deno"
8576
target="_blank"
8677
aria-label="Deno SaaSKit on Discord"
87-
class={LINK_STYLES}
78+
class="link-styles"
8879
>
8980
<IconBrandDiscord class="h-6 w-6" />
9081
</a>
9182
<a
9283
href="https://github.com/denoland/saaskit"
9384
target="_blank"
9485
aria-label="Deno SaaSKit repo on GitHub"
95-
class={LINK_STYLES}
86+
class="link-styles"
9687
>
9788
<IconBrandGithub class="h-6 w-6" />
9889
</a>

components/Header.tsx

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
// Copyright 2023 the Deno authors. All rights reserved. MIT license.
2-
import {
3-
ACTIVE_ANCESTOR_LINK_STYLES,
4-
ACTIVE_LINK_STYLES,
5-
LINK_STYLES,
6-
SITE_BAR_STYLES,
7-
SITE_NAME,
8-
} from "@/utils/constants.ts";
2+
import { SITE_NAME } from "@/utils/constants.ts";
93
import { isStripeEnabled } from "@/utils/stripe.ts";
104
import IconX from "tabler_icons_tsx/x.tsx";
115
import IconMenu from "tabler_icons_tsx/menu-2.tsx";
12-
import { cx } from "@twind/core";
136
import { User } from "@/utils/db.ts";
147

158
export interface HeaderProps {
@@ -23,14 +16,8 @@ export interface HeaderProps {
2316
}
2417

2518
export default function Header(props: HeaderProps) {
26-
const NAV_ITEM = "text-gray-500 px-3 py-4 sm:py-2";
2719
return (
28-
<header
29-
class={cx(
30-
SITE_BAR_STYLES,
31-
"flex-col sm:flex-row",
32-
)}
33-
>
20+
<header class="site-bar-styles flex-col sm:flex-row">
3421
<input
3522
type="checkbox"
3623
id="nav-toggle"
@@ -71,19 +58,19 @@ export default function Header(props: HeaderProps) {
7158
`}
7259
</script>
7360
<nav
74-
class={"hidden flex-col gap-x-4 divide-y divide-solid sm:(flex items-center flex-row divide-y-0)"}
61+
class={"hidden flex-col gap-x-4 divide-y divide-solid sm:flex sm:items-center sm:flex-row sm:divide-y-0"}
7562
>
7663
<a
7764
href="/dashboard"
78-
class={cx(LINK_STYLES, ACTIVE_ANCESTOR_LINK_STYLES, NAV_ITEM)}
65+
class="link-styles data-[ancestor]:!text-black data-[ancestor]:dark:!text-white nav-item"
7966
>
8067
Dashboard
8168
</a>
8269
{isStripeEnabled() &&
8370
(
8471
<a
8572
href="/pricing"
86-
class={cx(LINK_STYLES, ACTIVE_LINK_STYLES, NAV_ITEM)}
73+
class="link-styles data-[current]:!text-black data-[current]:dark:!text-white nav-item"
8774
>
8875
Pricing
8976
</a>
@@ -92,16 +79,20 @@ export default function Header(props: HeaderProps) {
9279
? (
9380
<a
9481
href="/account"
95-
class={cx(LINK_STYLES, ACTIVE_LINK_STYLES, NAV_ITEM)}
82+
class="link-styles data-[current]:!text-black data-[current]:dark:!text-white nav-item"
9683
>
9784
Account
9885
</a>
9986
)
100-
: <a href="/signin" class={cx(LINK_STYLES, NAV_ITEM)}>Sign in</a>}
87+
: (
88+
<a href="/signin" class="link-styles nav-item">
89+
Sign in
90+
</a>
91+
)}
10192
<div class="rounded-lg bg-gradient-to-tr from-secondary to-primary p-px">
10293
<a
10394
href="/submit"
104-
class="text-center text-white rounded-[7px] transition duration-300 px-4 py-2 block hover:(bg-white text-black dark:(bg-gray-900 !text-white))"
95+
class="text-center text-white rounded-[7px] transition duration-300 px-4 py-2 block hover:bg-white hover:text-black hover:dark:bg-gray-900 hover:dark:!text-white"
10596
>
10697
Submit
10798
</a>

components/TabsBar.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
// Copyright 2023 the Deno authors. All rights reserved. MIT license.
2-
import { LINK_STYLES } from "@/utils/constants.ts";
3-
import { cx } from "@twind/core";
42
import { ComponentChildren } from "preact";
53

64
export interface TabItemProps {
@@ -15,13 +13,11 @@ export function TabItem(props: TabItemProps) {
1513
return (
1614
<a
1715
href={props.path}
18-
class={cx(
19-
"px-4 py-2 rounded-lg",
16+
class={`px-4 py-2 rounded-lg ${
2017
props.active
21-
? "bg-gray-100 text-black dark:(bg-gray-800 text-white)"
22-
: "",
23-
LINK_STYLES,
24-
)}
18+
? "bg-gray-100 text-black dark:bg-gray-800 dark:text-white"
19+
: ""
20+
} link-styles`}
2521
>
2622
{props.children}
2723
</a>

deno.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@
2222
"compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "preact" },
2323
"imports": {
2424
"@/": "./",
25-
"$fresh/": "https://deno.land/x/fresh@1.5.4/",
25+
"$fresh/": "https://deno.land/x/fresh@1.6.1/",
2626
"$gfm": "https://deno.land/x/gfm@0.2.5/mod.ts",
27-
"preact": "https://esm.sh/preact@10.18.1",
28-
"preact/": "https://esm.sh/preact@10.18.1/",
27+
"preact": "https://esm.sh/preact@10.19.2",
28+
"preact/": "https://esm.sh/preact@10.19.2/",
2929
"preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.2.2",
3030
"@preact/signals": "https://esm.sh/*@preact/signals@1.2.1",
3131
"@preact/signals-core": "https://esm.sh/*@preact/signals-core@1.5.0",
32-
"twind-preset-tailwind/": "https://esm.sh/@twind/preset-tailwind@1.1.4/",
33-
"twind-preset-ext": "https://esm.sh/@twind/preset-ext@1.0.7/",
34-
"std/": "https://deno.land/std@0.205.0/",
32+
"tailwindcss": "npm:tailwindcss@3.3.5",
33+
"tailwindcss/": "npm:/tailwindcss@3.3.5/",
34+
"tailwindcss/plugin": "npm:/tailwindcss@3.3.5/plugin.js",
35+
"std/": "https://deno.land/std@0.208.0/",
3536
"stripe": "npm:/stripe@13.5.0",
3637
"feed": "npm:/feed@4.2.2",
3738
"kv_oauth/": "https://deno.land/x/deno_kv_oauth@v0.9.1/",
3839
"tabler_icons_tsx/": "https://deno.land/x/tabler_icons_tsx@0.0.4/tsx/",
39-
"@twind/core": "https://esm.sh/@twind/core@1.1.3",
4040
"fresh_charts/": "https://deno.land/x/fresh_charts@0.3.1/"
4141
},
4242
"exclude": ["cov/", "_fresh/", "**/_fresh/*"],

0 commit comments

Comments
 (0)