DrewHack
TTCTheo's Typesafe Cult
•Created by DrewHack on 8/22/2023 in #questions
Pretty Basic (I think) React / Tailwind / Next question
Hi everyone, I have tailwind UI and I'm trying to implement a theming system similar to : https://www.skies.dev/tailwind-themes
- I'm sure something I'm missing is basic react functionality but I've not been able to find the right answer and I'm sorry to just brain dump here but I've kind of reached an impasse (and don't have a lot of friends familiar enough with React to help...)
- His basic tutorial works great, however I'm trying to expand on that.
- The Basics, I'm using React, Next.JS (App Directory), Tailwind UI
- - I've defined my theme colors in global.css and their associated variables
- - In layout.tsx I declare the themes (as colors) and define color as setColor
- - page.tsx calls the component
<Sidebar />
which is not really just a sidebar but also a navbar (from TailwindUI)
- - Inside Sidebar I have the following menu drop down to select the themes
- - I tried this with both a links and the RadioGroup (since it was what skies used in his demo) but part of the problem is that color and setColor are not defined, I can redeclare them but I feel like that doesn't work since it's not mutating the original property
- - My GOAL here isn't JUST to get this working but to also understand why it's either NOT working or what I'm overlooking, I've been googling this for about a week and been given a couple of suggestions of entirely different ways to handle this but I feel like I'm missing a basic thing here... maybe not... and though I want to get this done, it's not an urgent item but I also want to learn9 replies
TTCTheo's Typesafe Cult
•Created by DrewHack on 7/10/2023 in #questions
Trying to setup NextAuth with middleware.tsx file - login is happening but always returns to login
Trying to setup NextAuth with middleware.tsx file - login is happening and session is created in database but page never returns to page that is behind matcher.
Middleware.tsx File is:
import { withAuth } from "next-auth/middleware";
export default withAuth({
secret: process.env.SECRET,
});
export const config = {
matcher: ["/dashboard"]
}
I've also tried:
export { default } from "next-auth/middleware"
export const config = {
matcher: ["/dashboard"]
}
Without middleware file App Directory redirection is working fine
9 replies