Migrate to stitches 1.0.0, fix a few bugs
This commit is contained in:
parent
7e1c63d5ea
commit
fea9e727fd
9 changed files with 23 additions and 23 deletions
|
@ -23,7 +23,7 @@
|
|||
"@sentry/react": "^6.12.0",
|
||||
"@sentry/tracing": "^6.12.0",
|
||||
"@sentry/webpack-plugin": "^1.17.1",
|
||||
"@stitches/react": "^0.2.3",
|
||||
"@stitches/react": "^1.0.0",
|
||||
"@tldraw/tldraw": "^0.0.57",
|
||||
"browser-fs-access": "^0.20.4",
|
||||
"gtag": "^1.0.1",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import NextDocument, { Html, Head, Main, NextScript, DocumentContext } from 'next/document'
|
||||
import { getCssString } from 'styles'
|
||||
import { getCssText } from '-styles'
|
||||
import { GA_TRACKING_ID } from '-utils/gtag'
|
||||
|
||||
class MyDocument extends NextDocument {
|
||||
|
@ -11,7 +11,7 @@ class MyDocument extends NextDocument {
|
|||
styles: (
|
||||
<>
|
||||
{initialProps.styles}
|
||||
<style id="stitches" dangerouslySetInnerHTML={{ __html: getCssString() }} />
|
||||
<style id="stitches" dangerouslySetInnerHTML={{ __html: getCssText() }} />
|
||||
</>
|
||||
),
|
||||
}
|
||||
|
|
|
@ -18,14 +18,18 @@ export default function Auth(
|
|||
async redirect(url, baseUrl) {
|
||||
return baseUrl
|
||||
},
|
||||
async signIn(user, account, profile: any) {
|
||||
const canLogin = await isSponsoringMe(profile?.login)
|
||||
async signIn(user, account, profile) {
|
||||
const login = profile?.login as string
|
||||
|
||||
if (canLogin) {
|
||||
return canLogin
|
||||
} else {
|
||||
return '/sponsorware'
|
||||
if (login) {
|
||||
const canLogin = await isSponsoringMe(login)
|
||||
|
||||
if (canLogin) {
|
||||
return canLogin
|
||||
}
|
||||
}
|
||||
|
||||
return '/sponsorware'
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import styled from '-styles'
|
||||
import { getSession, signin, signout, useSession } from 'next-auth/client'
|
||||
import type { GetServerSideProps } from 'next'
|
||||
import Link from 'next/link'
|
||||
import React from 'react'
|
||||
|
||||
export default function Sponsorware(): JSX.Element {
|
||||
|
@ -15,8 +16,8 @@ export default function Sponsorware(): JSX.Element {
|
|||
>
|
||||
<h1>tldraw (is sponsorware)</h1>
|
||||
<p>
|
||||
Hey, thanks for visiting <a href="https://tldraw.com/">tldraw</a>, a tiny little drawing
|
||||
app by <a href="https://twitter.com/steveruizok">steveruizok</a>.
|
||||
Hey, thanks for visiting <Link href="https://tldraw.com/">tldraw</Link>, a tiny little
|
||||
drawing app by <a href="https://twitter.com/steveruizok">steveruizok</a>.
|
||||
</p>
|
||||
<video autoPlay muted playsInline onClick={(e) => e.currentTarget.play()}>
|
||||
<source src="images/hello.mp4" type="video/mp4" />
|
||||
|
@ -47,7 +48,7 @@ export default function Sponsorware(): JSX.Element {
|
|||
Signed in as {session?.user?.name} ({session?.user?.email}), but it looks like
|
||||
you're not yet a sponsor.
|
||||
<br />
|
||||
Something wrong? Try <a href="/">reloading the page</a> or DM me on{' '}
|
||||
Something wrong? Try <Link href="/">reloading the page</Link> or DM me on{' '}
|
||||
<a href="https://twitter.com/steveruizok">Twitter</a>.
|
||||
</Detail>
|
||||
</>
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
import { createCss, defaultThemeMap } from '@stitches/react'
|
||||
import { createStitches, defaultThemeMap } from '@stitches/react'
|
||||
|
||||
const { styled, css, theme, getCssString } = createCss({
|
||||
const { styled, css, createTheme, getCssText } = createStitches({
|
||||
themeMap: {
|
||||
...defaultThemeMap,
|
||||
},
|
||||
|
@ -99,7 +99,7 @@ const { styled, css, theme, getCssString } = createCss({
|
|||
},
|
||||
})
|
||||
|
||||
const dark = theme({
|
||||
const dark = createTheme({
|
||||
colors: {
|
||||
brushFill: 'rgba(180, 180, 180, .05)',
|
||||
brushStroke: 'rgba(180, 180, 180, .25)',
|
||||
|
@ -136,4 +136,4 @@ const dark = theme({
|
|||
|
||||
export default styled
|
||||
|
||||
export { css, getCssString, dark }
|
||||
export { css, getCssText, dark }
|
||||
|
|
|
@ -3196,11 +3196,6 @@
|
|||
resolved "https://registry.yarnpkg.com/@sqltools/formatter/-/formatter-1.2.3.tgz#1185726610acc37317ddab11c3c7f9066966bd20"
|
||||
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":
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@stitches/react/-/react-1.0.0.tgz#311413630d96a627ca28f44ebcc9179455cdb73a"
|
||||
|
|
Loading…
Reference in a new issue