Skip to content
This repository was archived by the owner on Jun 14, 2025. It is now read-only.

Commit 66f2cbd

Browse files
committed
Update SST env variables and Image tags
1 parent 9324cf3 commit 66f2cbd

File tree

6 files changed

+43
-12
lines changed

6 files changed

+43
-12
lines changed

src/components/Navbar.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useSession, signOut } from "next-auth/react";
22
import { useRouter } from "next/router";
33
import Link from "next/link";
4+
import Image from "next/image";
45
import { ThemeToggle } from "./ThemeToggle";
56

67
export default function Navbar() {
@@ -59,10 +60,12 @@ export default function Navbar() {
5960
<div className="flex items-center space-x-3">
6061
<Link href="/profile" className="flex items-center space-x-2 hover:bg-accent/50 px-3 py-2 rounded-md transition-colors">
6162
{session.user?.image && (
62-
<img
63-
className="h-8 w-8 rounded-full"
63+
<Image
64+
className="h-8 w-8 rounded-full object-cover"
6465
src={session.user.image}
6566
alt="Profile"
67+
width={32}
68+
height={32}
6669
/>
6770
)}
6871
<span className="text-sm font-medium text-foreground hidden sm:block">

src/pages/admin/users.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { useState } from "react";
22
import { useSession } from "next-auth/react";
33
import { useRouter } from "next/router";
44
import Head from "next/head";
5+
import Image from "next/image";
56
import { api } from "~/utils/api";
67
import Navbar from "~/components/Navbar";
78
import Loading from "~/components/Loading";
@@ -157,10 +158,12 @@ export default function AdminUsers() {
157158
<div className="flex-shrink-0 h-10 w-10">
158159
<div className="h-10 w-10 rounded-full bg-primary flex items-center justify-center overflow-hidden">
159160
{user.image ? (
160-
<img
161+
<Image
161162
className="h-10 w-10 rounded-full object-cover"
162163
src={user.image}
163164
alt=""
165+
width={40}
166+
height={40}
164167
/>
165168
) : (
166169
<span className="text-sm font-medium text-primary-foreground">
@@ -202,8 +205,8 @@ export default function AdminUsers() {
202205
</select>
203206
) : (
204207
<span className={`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ${user.role === "ADMIN"
205-
? "bg-purple-100 text-purple-800 dark:bg-purple-900/20 dark:text-purple-300"
206-
: "bg-blue-100 text-blue-800 dark:bg-blue-900/20 dark:text-blue-300"
208+
? "bg-purple-100 text-purple-800 dark:bg-purple-900/20 dark:text-purple-300"
209+
: "bg-blue-100 text-blue-800 dark:bg-blue-900/20 dark:text-blue-300"
207210
}`}>
208211
{user.role}
209212
</span>

src/pages/dashboard.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { useRouter } from "next/router";
33
import { useEffect } from "react";
44
import Head from "next/head";
55
import Link from "next/link";
6+
import Image from "next/image";
67
import Navbar from "~/components/Navbar";
78
import Loading from "~/components/Loading";
89

@@ -112,10 +113,12 @@ export default function Dashboard() {
112113
<div className="space-y-4">
113114
{session.user?.image && (
114115
<div className="flex justify-center">
115-
<img
116-
className="h-16 w-16 rounded-full border-2 border-border shadow-sm"
116+
<Image
117+
className="h-16 w-16 rounded-full border-2 border-border shadow-sm object-cover"
117118
src={session.user.image}
118119
alt="Profile"
120+
width={64}
121+
height={64}
119122
/>
120123
</div>
121124
)}

src/pages/profile.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { useSession } from "next-auth/react";
33
import { useRouter } from "next/router";
44
import Head from "next/head";
55
import Link from "next/link";
6+
import Image from "next/image";
67
import { api } from "~/utils/api";
78
import Navbar from "~/components/Navbar";
89
import Loading from "~/components/Loading";
@@ -131,10 +132,12 @@ export default function Profile() {
131132
<div className="relative inline-block">
132133
<div className="w-32 h-32 mx-auto bg-primary rounded-full flex items-center justify-center overflow-hidden">
133134
{profile.image ? (
134-
<img
135+
<Image
135136
src={profile.image}
136137
alt="Profile"
137138
className="w-full h-full object-cover"
139+
width={128}
140+
height={128}
138141
/>
139142
) : (
140143
<span className="text-4xl font-bold text-primary-foreground">
@@ -175,8 +178,8 @@ export default function Profile() {
175178
<p className="text-muted-foreground">{profile.email}</p>
176179
<div className="mt-2 flex items-center justify-center space-x-2">
177180
<span className={`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ${profile.role === "ADMIN"
178-
? "bg-purple-100 text-purple-800 dark:bg-purple-900/20 dark:text-purple-300"
179-
: "bg-blue-100 text-blue-800 dark:bg-blue-900/20 dark:text-blue-300"
181+
? "bg-purple-100 text-purple-800 dark:bg-purple-900/20 dark:text-purple-300"
182+
: "bg-blue-100 text-blue-800 dark:bg-blue-900/20 dark:text-blue-300"
180183
}`}>
181184
{profile.role}
182185
</span>

sst.config.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ export default $config({
2222
AUTH_SECRET: process.env.AUTH_SECRET!,
2323
NODE_ENV: "production",
2424
NEXTAUTH_URL: process.env.NEXTAUTH_URL!,
25+
SUPABASE_SERVICE_ROLE_KEY: process.env.SUPABASE_SERVICE_ROLE_KEY!,
26+
NEXT_PUBLIC_SUPABASE_URL: process.env.NEXT_PUBLIC_SUPABASE_URL!,
27+
NEXT_PUBLIC_SUPABASE_ANON_KEY:
28+
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
2529
},
2630
});
2731

@@ -30,6 +34,19 @@ export default $config({
3034
console.log("DATABASE_URL exists:", !!process.env.DATABASE_URL);
3135
console.log("AUTH_SECRET exists:", !!process.env.AUTH_SECRET);
3236
console.log("NEXTAUTH_URL:", process.env.NEXTAUTH_URL);
37+
console.log(
38+
"SUPABASE_SERVICE_ROLE_KEY exists:",
39+
!!process.env.SUPABASE_SERVICE_ROLE_KEY,
40+
);
41+
console.log(
42+
"NEXT_PUBLIC_SUPABASE_URL:",
43+
process.env.NEXT_PUBLIC_SUPABASE_URL,
44+
);
45+
console.log(
46+
"NEXT_PUBLIC_SUPABASE_ANON_KEY exists:",
47+
!!process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY,
48+
);
49+
console.log("Node Environment:", process.env.NODE_ENV);
3350
console.log("Stage:", process.env.SST_STAGE);
3451

3552
return {

tsconfig.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,11 @@
4444
"**/*.tsx",
4545
"**/*.cjs",
4646
"**/*.js",
47-
".next/types/**/*.ts"
47+
".next/types/**/*.ts",
48+
"sst.config.ts",
4849
],
4950
"exclude": [
50-
"node_modules","sst.config.ts"
51+
"node_modules",
52+
"sst.config.ts"
5153
]
5254
}

0 commit comments

Comments
 (0)