Skip to content

Commit

Permalink
Merge pull request #70 from AndyOooh/ED1-56-crate-error-pages
Browse files Browse the repository at this point in the history
Ed1 56 crate error pages
  • Loading branch information
AndyOooh authored Jan 28, 2024
2 parents 0374962 + 373feca commit 4196789
Show file tree
Hide file tree
Showing 18 changed files with 136 additions and 40 deletions.
4 changes: 2 additions & 2 deletions apps/app/src/app/(combo)/(legal)/privacy-policy/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import { privacyPolicy } from './privacyPolicy';
import { Metadata } from 'next';
import type { Metadata } from 'next';

export const metadata: Metadata = {
title: 'Event Dee - Privacy Policy',
title: 'Privacy Policy',
};

export default function PrivacyPolicy() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import { termsAndConditions } from './termsAndConditions';
import { Metadata } from 'next';
import type { Metadata } from 'next';

export const metadata: Metadata = {
title: 'Event Dee - terms and conditions',
title: 'Terms & Conditions',
};

export default function TermsAndCoonditions() {
Expand Down
4 changes: 2 additions & 2 deletions apps/app/src/app/(protected)/events/create/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Metadata } from 'next';
import type { Metadata } from 'next';
import { CreateEventForm } from './form';

export const metadata: Metadata = {
title: 'Event Dee - Create Event',
title: 'Create Event',
};

export default function CreateEvent() {
Expand Down
4 changes: 2 additions & 2 deletions apps/app/src/app/(protected)/events/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Metadata } from 'next';
import type { Metadata } from 'next';

export const metadata: Metadata = {
title: 'Event Dee - Events',
title: 'Events',
};

export default function EventsLayout({ children }: { children: React.ReactNode }) {
Expand Down
4 changes: 2 additions & 2 deletions apps/app/src/app/(protected)/profile/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { PhotoForm } from './components/photo-form';
import { EditProfileForm } from './components/form';
import { Metadata } from 'next';
import type { Metadata } from 'next';

export const metadata: Metadata = {
title: 'Event Dee - Profile',
title: 'Profile',
};

/*
Expand Down
4 changes: 2 additions & 2 deletions apps/app/src/app/(protected)/search/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Metadata } from 'next';
import type { Metadata } from 'next';
import React from 'react';

export const metadata: Metadata = {
title: 'Event Dee - Search',
title: 'Search',
};

export default function SearchPage() {
Expand Down
4 changes: 2 additions & 2 deletions apps/app/src/app/(protected)/settings/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';
import { ChangePasswordForm } from './components/change-pw-form';
import { DeleteAccountForm } from './components/delete-acc-form';
import { Metadata } from 'next';
import type { Metadata } from 'next';

export const metadata: Metadata = {
title: 'Event Dee - Settings',
title: 'Settings',
};

export default function SettingsPage() {
Expand Down
12 changes: 7 additions & 5 deletions apps/app/src/app/(protected)/test-emulator/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* Might have to make this a client comp */
import { createDocument } from '__firebase/utilities';

export default function TestEmulatorPage() {
Expand All @@ -11,11 +12,12 @@ export default function TestEmulatorPage() {
return (
<div className='flex flex-col gap-4 w-full'>
<h1 className='text-3xl'>Test Emulator Page</h1>
{process.env.NEXT_PUBLIC_EMULATORS_ON === 'true' && (
<button className='btn' onClick={submitHandler}>
Test Emulator
</button>
)}
{process.env.NEXT_PUBLIC_EMULATORS_ON === 'true' &&
process.env.NODE_ENV === 'development' && (
<button className='btn' onClick={submitHandler}>
Test Emulator
</button>
)}
</div>
);
}
4 changes: 2 additions & 2 deletions apps/app/src/app/(public)/(auth)/login/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import LoginLeft from './left/LoginLeft';
import LoginRight from './LoginRight';
import { DividedPage } from '../components/DividedPage';
import { Metadata } from 'next';
import type { Metadata } from 'next';

export const metadata: Metadata = {
title: 'Event Dee - Login',
title: 'Login',
};

function Login() {
Expand Down
6 changes: 5 additions & 1 deletion apps/app/src/app/(public)/(auth)/signup/business/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { Metadata } from 'next';
import type { Metadata } from 'next';
import { SignupBusinessLeft } from './SignupBusinessLeft/SignupBusinessLeft';
import { SignupBusinessRight } from './SignupBusinessRight/SignupBusinessRight';

export const metadata: Metadata = {
title: 'Sign-up - Business',
};

function SignupBusiness() {
return (
// <DividedPage left={<SignupMemberLeft />} right={<SignupMemberRight />} leftColor='secondary' />
Expand Down
5 changes: 5 additions & 0 deletions apps/app/src/app/(public)/(auth)/signup/freelancer/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { SignupMemberLeft } from './signup-member-left/SignupMemberLeft';
import { SignupMemberRight } from './signup-member-right/SignupMemberRight';
import { DividedPage } from '../../components/DividedPage';
import type { Metadata } from 'next';

export const metadata: Metadata = {
title: 'Sign-up - Freelancer',
};

function SignupFreelancer() {
return (
Expand Down
9 changes: 9 additions & 0 deletions apps/app/src/app/(public)/(auth)/signup/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { Metadata } from 'next';

export const metadata: Metadata = {
title: 'Sign-up',
};

export default function SignupLayout({ children }: { children: React.ReactNode }) {
return <>{children}</>;
}
5 changes: 0 additions & 5 deletions apps/app/src/app/(public)/(auth)/signup/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import { Metadata } from 'next';
import Link from 'next/link';
import React from 'react';

export const metadata: Metadata = {
title: 'Event Dee - Signup',
};

// Th9is page could ask if user wants to signuo as freelancer or company and procide links. Or it ciuld be deleted.

function Signup() {
Expand Down
29 changes: 29 additions & 0 deletions apps/app/src/app/error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
'use client'; // Error components must be Client Components

import { useEffect } from 'react';

export default function Error({
error,
reset,
}: {
error: Error & { digest?: string };
reset: () => void;
}) {
useEffect(() => {
// Log the error to an error reporting service
console.error(error);
}, [error]);

return (
<div>
<h2>Something went wrong - Andy - check error.tsx file!</h2>
<button
onClick={
// Attempt to recover by trying to re-render the segment
() => reset()
}>
Try again
</button>
</div>
);
}
2 changes: 1 addition & 1 deletion apps/app/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Varela } from 'next/font/google';

import { RecoilProvider } from '../components/RecoilProvider';
import '../styles/globals.scss';
import { Metadata } from 'next';
import type { Metadata } from 'next';

const varela = Varela({
weight: ['400'],
Expand Down
51 changes: 51 additions & 0 deletions apps/app/src/app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import type { Metadata } from 'next';
import Link from 'next/link';
import { ColoredDiv } from 'ui';

export const metadata: Metadata = {
title: '404 - Not Found',
};

export default function NotFound() {
return (
<div className='flex-center min-h-screen w-full bg-base-300 absolute z-10 top-0'>
<div className='flex flex-col gap-6 items-center justify-center'>
<h2 className='text-4xl'>404 Not Found</h2>
<p className='text-xl'>We are sorry but the requested page could not be found.</p>
<Link href='/' className='btn btn-neutral'>
Return Home
</Link>
</div>
<ColoredDiv
color='pink'
direction='top'
height={12}
width={28}
rotateZ={45}
className='absolute z-20 right-[5%] top-1/4'
/>
<ColoredDiv
color='blue'
direction='bottom'
height={15}
width={15}
className='absolute z-20 left-12 top-[20%] rounded-full'
/>
<ColoredDiv
color='purple'
direction='bottom'
height={10}
width={16}
className='absolute z-20 bottom-1/4 left-1/4'
/>
<ColoredDiv
color='orange'
direction='top'
height={32}
width={10}
rotateZ={15}
className='absolute z-20 bottom-8 right-1/4'
/>
</div>
);
}
23 changes: 12 additions & 11 deletions apps/app/src/components/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,18 @@ export const Sidebar = () => {
<span className='title'>{item.title}</span>
</a>
))}
{process.env.NEXT_PUBLIC_EMULATORS_ON === 'true' && (
<a
key={'emulator-test'}
href={'/emulator-test'}
className='text-xs pl-2 mb-2 hover:scale-110 hover:font-semibold'>
<span className=''>
<BiTestTube size={iconSize} />
</span>
<span className='title'>Emulator Test</span>
</a>
)}
{process.env.NEXT_PUBLIC_EMULATORS_ON === 'true' &&
process.env.NODE_ENV === 'development' && (
<a
key={'emulator-test'}
href={'/emulator-test'}
className='text-xs pl-2 mb-2 hover:scale-110 hover:font-semibold'>
<span className=''>
<BiTestTube size={iconSize} />
</span>
<span className='title'>Emulator Test</span>
</a>
)}
</li>
</ul>
</aside>
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/firebase/clientApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const getCloudFunction = (functionName: string) => {
return returnedFunction;
};

if (process.env.NEXT_PUBLIC_EMULATORS_ON === 'true') {
if (process.env.NEXT_PUBLIC_EMULATORS_ON === 'true' && process.env.NODE_ENV === 'development') {
connectAuthEmulator(auth, 'http://localhost:9099');
connectFirestoreEmulator(db, 'localhost', 8080);
connectStorageEmulator(storage, 'localhost', 9199);
Expand Down

1 comment on commit 4196789

@vercel
Copy link

@vercel vercel bot commented on 4196789 Jan 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

dev-event-dee2 – ./apps/app

dev-event-dee2-andyoooh.vercel.app
dev-event-dee2-git-main-andyoooh.vercel.app
dev-event-dee2.vercel.app

Please sign in to comment.