Revert "Migrate to stitches 1.0.0, fix a few bugs"

This reverts commit fea9e727fd.
This commit is contained in:
Steve Ruiz 2021-09-04 10:15:02 +01:00
parent 24e9be73cc
commit 35253348d2
9 changed files with 23 additions and 23 deletions

View file

@ -23,7 +23,7 @@
"@sentry/react": "^6.12.0", "@sentry/react": "^6.12.0",
"@sentry/tracing": "^6.12.0", "@sentry/tracing": "^6.12.0",
"@sentry/webpack-plugin": "^1.17.1", "@sentry/webpack-plugin": "^1.17.1",
"@stitches/react": "^1.0.0", "@stitches/react": "^0.2.3",
"@tldraw/tldraw": "^0.0.57", "@tldraw/tldraw": "^0.0.57",
"browser-fs-access": "^0.20.4", "browser-fs-access": "^0.20.4",
"gtag": "^1.0.1", "gtag": "^1.0.1",

View file

@ -1,5 +1,5 @@
import NextDocument, { Html, Head, Main, NextScript, DocumentContext } from 'next/document' import NextDocument, { Html, Head, Main, NextScript, DocumentContext } from 'next/document'
import { getCssText } from '-styles' import { getCssString } from 'styles'
import { GA_TRACKING_ID } from '-utils/gtag' import { GA_TRACKING_ID } from '-utils/gtag'
class MyDocument extends NextDocument { class MyDocument extends NextDocument {
@ -11,7 +11,7 @@ class MyDocument extends NextDocument {
styles: ( styles: (
<> <>
{initialProps.styles} {initialProps.styles}
<style id="stitches" dangerouslySetInnerHTML={{ __html: getCssText() }} /> <style id="stitches" dangerouslySetInnerHTML={{ __html: getCssString() }} />
</> </>
), ),
} }

View file

@ -18,18 +18,14 @@ export default function Auth(
async redirect(url, baseUrl) { async redirect(url, baseUrl) {
return baseUrl return baseUrl
}, },
async signIn(user, account, profile) { async signIn(user, account, profile: any) {
const login = profile?.login as string const canLogin = await isSponsoringMe(profile?.login)
if (login) { if (canLogin) {
const canLogin = await isSponsoringMe(login) return canLogin
} else {
if (canLogin) { return '/sponsorware'
return canLogin
}
} }
return '/sponsorware'
}, },
}, },
}) })

View file

@ -1,7 +1,6 @@
import styled from '-styles' import styled from '-styles'
import { getSession, signin, signout, useSession } from 'next-auth/client' import { getSession, signin, signout, useSession } from 'next-auth/client'
import type { GetServerSideProps } from 'next' import type { GetServerSideProps } from 'next'
import Link from 'next/link'
import React from 'react' import React from 'react'
export default function Sponsorware(): JSX.Element { export default function Sponsorware(): JSX.Element {
@ -16,8 +15,8 @@ export default function Sponsorware(): JSX.Element {
> >
<h1>tldraw (is sponsorware)</h1> <h1>tldraw (is sponsorware)</h1>
<p> <p>
Hey, thanks for visiting <Link href="https://tldraw.com/">tldraw</Link>, a tiny little Hey, thanks for visiting <a href="https://tldraw.com/">tldraw</a>, a tiny little drawing
drawing app by <a href="https://twitter.com/steveruizok">steveruizok</a>. app by <a href="https://twitter.com/steveruizok">steveruizok</a>.
</p> </p>
<video autoPlay muted playsInline onClick={(e) => e.currentTarget.play()}> <video autoPlay muted playsInline onClick={(e) => e.currentTarget.play()}>
<source src="images/hello.mp4" type="video/mp4" /> <source src="images/hello.mp4" type="video/mp4" />
@ -48,7 +47,7 @@ export default function Sponsorware(): JSX.Element {
Signed in as {session?.user?.name} ({session?.user?.email}), but it looks like Signed in as {session?.user?.name} ({session?.user?.email}), but it looks like
you&apos;re not yet a sponsor. you&apos;re not yet a sponsor.
<br /> <br />
Something wrong? Try <Link href="/">reloading the page</Link> or DM me on{' '} Something wrong? Try <a href="/">reloading the page</a> or DM me on{' '}
<a href="https://twitter.com/steveruizok">Twitter</a>. <a href="https://twitter.com/steveruizok">Twitter</a>.
</Detail> </Detail>
</> </>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,6 @@
import { createStitches, defaultThemeMap } from '@stitches/react' import { createCss, defaultThemeMap } from '@stitches/react'
const { styled, css, createTheme, getCssText } = createStitches({ const { styled, css, theme, getCssString } = createCss({
themeMap: { themeMap: {
...defaultThemeMap, ...defaultThemeMap,
}, },
@ -99,7 +99,7 @@ const { styled, css, createTheme, getCssText } = createStitches({
}, },
}) })
const dark = createTheme({ const dark = theme({
colors: { colors: {
brushFill: 'rgba(180, 180, 180, .05)', brushFill: 'rgba(180, 180, 180, .05)',
brushStroke: 'rgba(180, 180, 180, .25)', brushStroke: 'rgba(180, 180, 180, .25)',
@ -136,4 +136,4 @@ const dark = createTheme({
export default styled export default styled
export { css, getCssText, dark } export { css, getCssString, dark }

View file

@ -3196,6 +3196,11 @@
resolved "https://registry.yarnpkg.com/@sqltools/formatter/-/formatter-1.2.3.tgz#1185726610acc37317ddab11c3c7f9066966bd20" resolved "https://registry.yarnpkg.com/@sqltools/formatter/-/formatter-1.2.3.tgz#1185726610acc37317ddab11c3c7f9066966bd20"
integrity sha512-O3uyB/JbkAEMZaP3YqyHH7TMnex7tWyCbCI4EfJdOCoN6HIhqdJBWTM6aCCiWQ/5f5wxjgU735QAIpJbjDvmzg== integrity sha512-O3uyB/JbkAEMZaP3YqyHH7TMnex7tWyCbCI4EfJdOCoN6HIhqdJBWTM6aCCiWQ/5f5wxjgU735QAIpJbjDvmzg==
"@stitches/react@^0.2.3":
version "0.2.5"
resolved "https://registry.yarnpkg.com/@stitches/react/-/react-0.2.5.tgz#ad15b4e59ac2a0679542ba002d41253244be7dab"
integrity sha512-RDVn89kW0R/M4q4TdYvsJ7nckFndzRWGGFJnEHbIH9flOpahtNdPsrxVSsZSjFpxeVqCoOxKujlQjiyRrec1VA==
"@stitches/react@^1.0.0": "@stitches/react@^1.0.0":
version "1.0.0" version "1.0.0"
resolved "https://registry.yarnpkg.com/@stitches/react/-/react-1.0.0.tgz#311413630d96a627ca28f44ebcc9179455cdb73a" resolved "https://registry.yarnpkg.com/@stitches/react/-/react-1.0.0.tgz#311413630d96a627ca28f44ebcc9179455cdb73a"