Skip to content

Commit

Permalink
moved app to root instead of src to match modern next
Browse files Browse the repository at this point in the history
  • Loading branch information
CassandraGoose committed Jan 18, 2024
1 parent 62a903a commit 8983c4e
Show file tree
Hide file tree
Showing 18 changed files with 2,902 additions and 968 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends":[ "next/core-web-vitals", "prettier" ]
"extends": ["next/core-web-vitals", "prettier"]
}
82 changes: 82 additions & 0 deletions app/components/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
'use client';

import Link from 'next/link';
import Image from 'next/image';
import Avatar from '../../public/temp_profile_image.png';
import { usePathname } from 'next/navigation';

export default function Navbar() {
const currentPathname = usePathname();

const isActive = (pathname: string) => {
return currentPathname === pathname ? ' border-b border-black' : '';
};

return (
<nav className="border-black navbar border-b" data-testid="navbar">
<div className="flex-1">
<Link
href="/"
className="btn btn-ghost text-xl normal-case"
data-testid="home-link"
>
TRACK
</Link>
</div>
<div>
<ul className="borderrounded-lg flex p-4 md:mt-0 md:flex-row md:space-x-8 md:border-0 md:p-0">
<li className={isActive('/dashboard')}>
<Link
className="px-2"
href="/dashboard"
data-testid="navbar-dashboard-link"
>
Dashboard
</Link>
</li>
<li className={isActive('/pathways')}>
<Link className="px-2" href="/" data-testid="navbar-pathways-link">
Pathways
</Link>
</li>
<li className={isActive('/about')}>
<Link
className="pl-2 pr-4"
href="/"
data-testid="navbar-about-link"
>
About
</Link>
</li>
</ul>
</div>
<div className="flex-none gap-2">
<div className="dropdown dropdown-end">
<label tabIndex={0} className="avatar btn btn-circle btn-ghost">
<div className="w-10 rounded-full">
<Image
src={Avatar}
alt="default avatar blank face"
data-testid="navbar-user-avatar"
/>
</div>
</label>
<ul
tabIndex={0}
className="menu dropdown-content menu-sm z-[1] mt-3 w-52 rounded-box p-2 shadow"
>
<li>
<a className="justify-between">Profile</a>
</li>
<li>
<a>Settings</a>
</li>
<li>
<a>Logout</a>
</li>
</ul>
</div>
</div>
</nav>
);
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { notFound } from 'next/navigation';
import { getPathwayByUserId } from "../../../lib/queries";
import PathwayProgressDetails from "../../../components/PathwayProgressDetails";
import { getPathwayByUserId } from "../../lib/queries";
import PathwayProgressDetails from "../../components/PathwayProgressDetails";

export default async function Pathway({ params }: { params: { pathway: string }}) {
const pathway = params.pathway;
Expand Down
6 changes: 3 additions & 3 deletions src/app/dashboard/page.tsx → app/dashboard/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Pathway } from '../../lib/interface';
import { Pathway } from '../lib/interface';
import Link from 'next/link';
import { getPathwaysByEmail } from '../../lib/queries';
import { getPathwaysByEmail } from '../lib/queries';

export default async function Home() {
const pathways = await getPathwaysByEmail();

const chicken = '';
return (
<section className='mx-12 flex flex-col space-y-12'>
<h2 className={`text-4xl self-center mt-8 `}>
Expand Down
4 changes: 2 additions & 2 deletions src/app/layout.tsx → app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Metadata } from "next";
import Navbar from "@/components/Navbar";
import SiteFooter from "@/components/SiteFooter";
import Navbar from "@/app/components/Navbar";
import SiteFooter from "@/app/components/SiteFooter";

import "@/styles/globals.css";

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/lib/queries.ts → app/lib/queries.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import prisma from '@/lib/prisma';
import prisma from '@/app/lib/prisma';

export async function getPathwaysByEmail() {
return await prisma.person.findFirst({
Expand Down
12 changes: 6 additions & 6 deletions src/app/page.tsx → app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import Link from 'next/link';
import Image from 'next/image';
import Splash from '../../public/temp_splash.png';
import Happiness from '../../public/happiness.png';
import Community from '../../public/community.png';
import Certification from '../../public/certification.png';
import Splash2 from '../../public/temp_splash2.png';
import Video from '../../public/temp_video.png';
import Splash from '../public/temp_splash.png';
import Happiness from '../public/happiness.png';
import Community from '../public/community.png';
import Certification from '../public/certification.png';
import Splash2 from '../public/temp_splash2.png';
import Video from '../public/temp_video.png';

export default function Page() {
return (
Expand Down
7 changes: 2 additions & 5 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
staticPageGenerationTimeout: 1000,
}
const nextConfig = {};

module.exports = nextConfig
module.exports = nextConfig;
Loading

0 comments on commit 8983c4e

Please sign in to comment.