diff --git a/.env.example b/.env.example deleted file mode 100644 index 8380781..0000000 --- a/.env.example +++ /dev/null @@ -1,10 +0,0 @@ -BASE_URL = http://localhost:3000 - -GOOGLE_CLIENT_ID = -GOOGLE_CLIENT_SECRET = -GOOGLE_CLIENT_EMAIL = -GOOGLE_PRIVATE_KEY = -SHEET_ID = - -MONGODB_URI = (mongodb+srv://:/ffcs-user) -// keep ffcs-user as the database name diff --git a/boneyard.config.json b/boneyard.config.json new file mode 100644 index 0000000..741a5b0 --- /dev/null +++ b/boneyard.config.json @@ -0,0 +1,26 @@ +{ + "breakpoints": [375, 768, 1280], + "out": "./src/bones", + "wait": 800, + "routes": ["/saved"], + + "color": "#e0e0e0", + "darkColor": "#2a2a2a", + "animate": "shimmer", + "shimmerColor": "#ebebeb", + "darkShimmerColor": "#333333", + "speed": "1.5s", + "shimmerAngle": 45, + + "resolveEnvVars": true, + "auth": { + "cookies": [ + { + "name": "next-auth.session-token", + "value": "env[SESSION_TOKEN]", + "domain": "localhost", + "path": "/" + } + ] + } +} diff --git a/package.json b/package.json index 03bb224..f48f8a5 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "dependencies": { "@auth/mongodb-adapter": "^3.9.1", "axios": "^1.9.0", + "boneyard-js": "^1.8.1", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "dom-to-image-more": "^3.6.0", diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 06533b7..1771d0e 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,3 +1,5 @@ +// @ts-ignore +import '../bones/registry'; import { Pangolin, Poppins, Inter } from 'next/font/google'; import './globals.css'; import SessionProviderWrapper from './SessionProvider'; diff --git a/src/app/saved/page.tsx b/src/app/saved/page.tsx index a977aac..ff2363c 100644 --- a/src/app/saved/page.tsx +++ b/src/app/saved/page.tsx @@ -29,6 +29,13 @@ export default function View() { if (status === 'loading' || size === null) return ; + // TEMP: remove after running npx boneyard-js build once + /* + if (process.env.NODE_ENV === 'development' && status !== 'authenticated') { + return size === 'mobile' ? : ; + } + */ + if (status !== 'authenticated') { return ( <> diff --git a/src/app/saved/saved-mobile.tsx b/src/app/saved/saved-mobile.tsx index c7e40d2..442d937 100644 --- a/src/app/saved/saved-mobile.tsx +++ b/src/app/saved/saved-mobile.tsx @@ -8,6 +8,7 @@ import Image from 'next/image'; import axios from 'axios'; import { PopupViewTT } from '@/components/ui/PopupMobile'; import Loader from '@/components/ui/Loader'; +import { Skeleton } from 'boneyard-js/react'; async function fetchTimetablesByOwner(owner: string) { const res = await axios.get(`/api/timetables?owner=${encodeURIComponent(owner)}`); @@ -34,6 +35,7 @@ type PopupSlot = { }; export default function SavedMobile() { + console.log('mobile rendered'); const { data: session } = useSession(); const userEmail = session?.user?.email; @@ -115,38 +117,64 @@ export default function SavedMobile() {
Saved Timetables
-
    - {timetables.map((tt, index) => ( -
  • handleView(tt)} - > - {index + 1}. - {tt.title} -
  • - ))} -
- -
-
- {loading ? null : timetables.length === 0 ? ( - Nothing To Show Here - ) : ( - End of List - )} -
-
- - {loading ? ( - - ) : timetables.length === 0 ? ( -
- No saved timetables found. -
- Create and save from the desktop website. + + {[ + { _id: '1', title: 'My Timetable 1' }, + { _id: '2', title: 'My Timetable 2' }, + { _id: '3', title: 'My Timetable 3' }, + { _id: '4', title: 'My Timetable 4' }, + { _id: '5', title: 'My Timetable 5' }, + ].map((tt, index) => ( +
  • {}} + > + {index + 1}. + {tt.title} +
  • + ))} + + } + > + {/* Real content — shown after loading */} +
      + {timetables.map((tt, index) => ( +
    • handleView(tt)} + > + {index + 1}. + {tt.title} +
    • + ))} +
    + +
    +
    + {timetables.length === 0 ? ( + Nothing To Show Here + ) : ( + End of List + )} +
    - ) : null} + + {timetables.length === 0 && ( +
    + No saved timetables found. +
    + Create and save from the desktop website. +
    + )} +