client: disable theme transitions on change
This commit is contained in:
parent
6a4ff9c307
commit
de68796101
5 changed files with 15 additions and 4 deletions
|
@ -31,7 +31,7 @@ function MyApp({ Component, pageProps }: AppProps) {
|
||||||
<meta name="theme-color" content="#ffffff" />
|
<meta name="theme-color" content="#ffffff" />
|
||||||
<title>Drift</title>
|
<title>Drift</title>
|
||||||
</Head>
|
</Head>
|
||||||
<ThemeProvider defaultTheme="system">
|
<ThemeProvider defaultTheme="system" disableTransitionOnChange>
|
||||||
<App Component={Component} pageProps={pageProps} />
|
<App Component={Component} pageProps={pageProps} />
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -11,6 +11,10 @@ const renderMarkdown: NextApiHandler = async (req, res) => {
|
||||||
Authorization: `Bearer ${req.cookies["drift-token"]}`
|
Authorization: `Bearer ${req.cookies["drift-token"]}`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
console.log(file.status)
|
||||||
|
if (file.status !== 200) {
|
||||||
|
return res.status(404).json({ error: "File not found" })
|
||||||
|
}
|
||||||
|
|
||||||
const json = await file.json()
|
const json = await file.json()
|
||||||
const { content, title } = json
|
const { content, title } = json
|
||||||
|
|
|
@ -9,10 +9,12 @@ const getRawFile = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||||
Authorization: `Bearer ${req.cookies["drift-token"]}`
|
Authorization: `Bearer ${req.cookies["drift-token"]}`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const json = await file.json()
|
|
||||||
res.setHeader("Content-Type", "text/plain; charset=utf-8")
|
res.setHeader("Content-Type", "text/plain; charset=utf-8")
|
||||||
res.setHeader("Cache-Control", "s-maxage=86400")
|
res.setHeader("Cache-Control", "s-maxage=86400")
|
||||||
if (file.ok) {
|
if (file.ok) {
|
||||||
|
const json = await file.json()
|
||||||
|
console.log(json)
|
||||||
const data = json
|
const data = json
|
||||||
const { title, content } = data
|
const { title, content } = data
|
||||||
// serve the file raw as plain text
|
// serve the file raw as plain text
|
||||||
|
|
|
@ -16,8 +16,8 @@ article img {
|
||||||
article [id]::before {
|
article [id]::before {
|
||||||
content: "";
|
content: "";
|
||||||
display: block;
|
display: block;
|
||||||
height: 70px;
|
height: var(--gap-half);
|
||||||
margin-top: -70px;
|
margin-top: calc(var(--gap-half) * -1);
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,11 @@ files.get("/raw/:id", secretKey, async (req, res, next) => {
|
||||||
attributes: ["title", "content"],
|
attributes: ["title", "content"],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
if (!file) {
|
||||||
|
return res.status(404).json({ error: "File not found" })
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: JWT-checkraw files
|
// TODO: JWT-checkraw files
|
||||||
if (file?.post?.visibility === "private") {
|
if (file?.post?.visibility === "private") {
|
||||||
// jwt(req as UserJwtRequest, res, () => {
|
// jwt(req as UserJwtRequest, res, () => {
|
||||||
|
|
Loading…
Reference in a new issue