Skip to content

Commit

Permalink
Merge branch 'main' into ED1-70-fix-notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyOooh authored Mar 31, 2024
2 parents 4e8a4b0 + b30b856 commit d8f734b
Show file tree
Hide file tree
Showing 15 changed files with 66 additions and 32 deletions.
27 changes: 19 additions & 8 deletions apps/app/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,26 @@ const nextConfig = {
reactStrictMode: true,
transpilePackages: ['ui'],
experimental: {
// appDir: true,
optimizePackageImports: [
'react-icons/*',
'@hookform/resolvers',
'@reach/combobox',
'@react-google-maps/api',
'date-fns',
'firebase',
'lodash',
'react-firebase-hooks',
'react-hook-form',
'react-spinners',
'recoil',
'server-only',
'ui',
'use-places-autocomplete',
'usehooks-ts',
'yup',
],
},
images: {
// domains: [
// 'firebasestorage.googleapis.com',
// 'lh3.googleusercontent.com',
// 'localhost',
// 'storage.cloud.google.com',
// ],
remotePatterns: [
{
protocol: 'http',
Expand All @@ -28,7 +39,7 @@ const nextConfig = {
{
protocol: 'https',
hostname: 'storage.cloud.google.com',
}
},
],
},
};
Expand Down
1 change: 0 additions & 1 deletion apps/app/src/app/(combo)/(checksidebar)/LayoutProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import React from 'react';
import { useAuthState } from 'react-firebase-hooks/auth';
import { Sidebar } from '__components/Sidebar/Sidebar';
import { LoaderSpinner } from '__components/ui/LoaderSpinner';
import { auth } from '__firebase/clientApp';
import { PageWithAuthCard } from '__components/PageWithAuthCard';
Expand Down
14 changes: 10 additions & 4 deletions apps/app/src/app/(protected)/events/components/Event.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { GoogleMap, Marker, useLoadScript } from '@react-google-maps/api';
import Image from 'next/image';
import { BiPurchaseTag } from 'react-icons/bi';
import { BiEdit, BiTrash, BiBookmark, BiBookmarkHeart } from 'react-icons/bi';
import { EventTag } from 'ui';
// import { EventTag } from 'ui';

type MapOptions = google.maps.MapOptions;

Expand Down Expand Up @@ -56,18 +58,22 @@ const Event = ({ event }: any) => {
<div className='card-body'>
<div className='flex justify-between'>
<h2 className='card-title'>{event.event_header}!</h2>
<div className='badge badge-info gap-2'>
<BiPurchaseTag />
{event.event_type}
<div>
<EventTag text={event.event_type} />
</div>
</div>
<h3>
<span className='text-primary font-semibold'>{event.event_name}</span>,{' '}
{event.event_name ? (
<>
<span className='text-primary font-semibold'>{event.event_name}</span>,{' '}
</>
) : null}
<span className='text-base-content'>{location.name}</span>
</h3>
<div className='divider my-2' />
<div className='flex justify-around'>
<div className='flex flex-col'>
<p>Organizor: {event.creatorUid}</p>
<p>{event.description}</p>
<div className='flex flex-col'>
<p>{location.address}</p>
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/app/(protected)/events/create/form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const CreateEventForm = () => {
))}

<div className='w-full sticky bottom-0 p-4'>
<ActionButton text='Update' disabled={!isDirty || !isValid} loading={isSubmitting} />
<ActionButton text='Create' disabled={!isDirty || !isValid} loading={isSubmitting} />
{process.env.NODE_ENV === 'development' && (
<button
type='button'
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/app/(protected)/events/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default async function Events() {
return (
<div className='flex flex-col gap-4 w-full'>
<div className='flex justify-between'>
<h1 className='text-3xl'>Upcoming Events</h1>
<h1 className='text-3xl'>Events</h1>
<CreateEventButton />
</div>
<div className='flex flex-col'></div>
Expand Down
5 changes: 1 addition & 4 deletions apps/app/src/app/(protected)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ export default function protectedLayout({ children }: { children: React.ReactNod
return (
<PrivateRoutes>
<CurrentUserProvider>
<section className='flex'>
<Sidebar />
<PageWithAuthCard>{children}</PageWithAuthCard>
</section>
<section className='flex'><Sidebar /><PageWithAuthCard>{children}</PageWithAuthCard></section>
</CurrentUserProvider>
</PrivateRoutes>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const CheckLegal = ({ name, register, error }: Props) => {
const CheckBoxWIthText = (
<div className='flex-center text-[0.625rem] gap-2 w-full'>
<input {...register(name)} type='checkbox' className='checkbox checkbox-xs bg-white' />
<p>
<div>
<span>By signing up you agree to the </span>
<Link href={'terms-and-conditions'} className='link'>
Terms of Service
Expand All @@ -25,7 +25,7 @@ export const CheckLegal = ({ name, register, error }: Props) => {
{' '}
Privacy Statement
</Link>
</p>
</div>
</div>
);
return CheckBoxWIthText;
Expand Down
4 changes: 2 additions & 2 deletions apps/app/src/app/(public)/(auth)/signup/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import React from 'react';
function Signup() {
return (
<section className='min-h-screen flex-center bg-primary/20 text-3xl'>
<p>
<div>
Sign up as{' '}
<Link href={'/signup/freelancer'} className='link link-primary'>
freelancer?
Expand All @@ -16,7 +16,7 @@ function Signup() {
<Link href={'/signup/business'} className='link link-primary'>
Businesss?
</Link>
</p>
</div>
</section>
);
}
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/modals/auth/ResetPassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const ResetPassword = ({ toggleView }: Props) => {
<div className='flex flex-col gap-4 items-center w-full'>
<BsReddit size={'3rem'} />
{success ? (
<p>Check your email :)</p>
<p>Check your email.</p>
) : (
<>
<p className='text-sm text-center'>
Expand Down
1 change: 1 addition & 0 deletions apps/app/src/components/ui/LoaderSpinner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type Props = {};
export const LoaderSpinner = (props: Props) => {
return (
<div className='flex-center min-h-screen w-full bg-base-300 absolute z-10 top-0'>
<h1 className='text-4xl text-warning'>Loading...</h1>
<ColoredDiv
color='pink'
direction='top'
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
{"kind":"identitytoolkit#DownloadAccountResponse","users":[{"localId":"DI4Dx3YiiDonUcaz0UiiFjdCUkAU","createdAt":"1704033339723","lastLoginAt":"1707153741167","displayName":"Orange Chicken","photoUrl":"http://localhost:9199/v0/b/event-dee-staging.appspot.com/o/users%2FDI4Dx3YiiDonUcaz0UiiFjdCUkAU%2Fimages%2Fprofile?alt=media&token=aaa55962-ac74-4b1d-8045-7c688f925cc4","customAttributes":"{\"basic_info_done\":true,\"type\":\"freelancer\"}","providerUserInfo":[{"providerId":"google.com","rawId":"6233296176568572704053954672800598602635","federatedId":"6233296176568572704053954672800598602635","displayName":"Orange Chicken","email":"[email protected]","screenName":"chicken_orange"}],"validSince":"1711872929","email":"[email protected]","emailVerified":true,"disabled":false},{"localId":"XobXVTMfKX21NwEP7V5LEuuX4q8u","createdAt":"1704023132744","lastLoginAt":"1704023132744","photoUrl":"http://localhost:9199/v0/b/event-dee-staging.appspot.com/o/users%2FXobXVTMfKX21NwEP7V5LEuuX4q8u%2Fimages%2Fprofile?alt=media&token=be3f3bef-d833-4dd0-b275-11a58ec238a3","passwordHash":"fakeHash:salt=fakeSaltUu0sqgKGXdW18M52lrCJ:password=oooooo","salt":"fakeSaltUu0sqgKGXdW18M52lrCJ","passwordUpdatedAt":1711872929949,"customAttributes":"{\"basic_info_done\":true,\"type\":\"freelancer\"}","providerUserInfo":[{"providerId":"password","email":"[email protected]","federatedId":"[email protected]","rawId":"[email protected]","photoUrl":"http://localhost:9199/v0/b/event-dee-staging.appspot.com/o/users%2FXobXVTMfKX21NwEP7V5LEuuX4q8u%2Fimages%2Fprofile?alt=media&token=be3f3bef-d833-4dd0-b275-11a58ec238a3"}],"validSince":"1711872929","email":"[email protected]","emailVerified":false,"disabled":false},{"localId":"qIsokoD9bxhWt2tcFdcNpAg0DPZb","createdAt":"1704107208217","lastLoginAt":"1711872965495","photoUrl":"https://storage.cloud.google.com/event-dee-staging.appspot.com/misc/profile-photo-placeholder.jpg","passwordHash":"fakeHash:salt=fakeSalth89eFQSxrdhCytX68Nxe:password=bbbbbb","salt":"fakeSalth89eFQSxrdhCytX68Nxe","passwordUpdatedAt":1711872929949,"customAttributes":"{\"basic_info_done\":true,\"type\":\"business\"}","providerUserInfo":[{"providerId":"password","email":"[email protected]","federatedId":"[email protected]","rawId":"[email protected]","photoUrl":"https://storage.cloud.google.com/event-dee-staging.appspot.com/misc/profile-photo-placeholder.jpg"}],"validSince":"1711872929","email":"[email protected]","emailVerified":false,"disabled":false,"lastRefreshAt":"2024-03-31T08:35:24.874Z"}]}
{"kind":"identitytoolkit#DownloadAccountResponse","users":[{"localId":"DI4Dx3YiiDonUcaz0UiiFjdCUkAU","createdAt":"1704033339723","lastLoginAt":"1707153741167","displayName":"Orange Chicken","photoUrl":"http://localhost:9199/v0/b/event-dee-staging.appspot.com/o/users%2FDI4Dx3YiiDonUcaz0UiiFjdCUkAU%2Fimages%2Fprofile?alt=media&token=aaa55962-ac74-4b1d-8045-7c688f925cc4","customAttributes":"{\"basic_info_done\":true,\"type\":\"freelancer\"}","providerUserInfo":[{"providerId":"google.com","rawId":"6233296176568572704053954672800598602635","federatedId":"6233296176568572704053954672800598602635","displayName":"Orange Chicken","email":"[email protected]","screenName":"chicken_orange"}],"validSince":"1711872929","email":"[email protected]","emailVerified":true,"disabled":false},{"localId":"XobXVTMfKX21NwEP7V5LEuuX4q8u","createdAt":"1704023132744","lastLoginAt":"1704023132744","photoUrl":"http://localhost:9199/v0/b/event-dee-staging.appspot.com/o/users%2FXobXVTMfKX21NwEP7V5LEuuX4q8u%2Fimages%2Fprofile?alt=media&token=be3f3bef-d833-4dd0-b275-11a58ec238a3","passwordHash":"fakeHash:salt=fakeSaltUu0sqgKGXdW18M52lrCJ:password=oooooo","salt":"fakeSaltUu0sqgKGXdW18M52lrCJ","passwordUpdatedAt":1711872929949,"customAttributes":"{\"basic_info_done\":true,\"type\":\"freelancer\"}","providerUserInfo":[{"providerId":"password","email":"[email protected]","federatedId":"[email protected]","rawId":"[email protected]","photoUrl":"http://localhost:9199/v0/b/event-dee-staging.appspot.com/o/users%2FXobXVTMfKX21NwEP7V5LEuuX4q8u%2Fimages%2Fprofile?alt=media&token=be3f3bef-d833-4dd0-b275-11a58ec238a3"}],"validSince":"1711872929","email":"[email protected]","emailVerified":false,"disabled":false},{"localId":"qIsokoD9bxhWt2tcFdcNpAg0DPZb","createdAt":"1704107208217","lastLoginAt":"1711872965495","photoUrl":"https://storage.cloud.google.com/event-dee-staging.appspot.com/misc/profile-photo-placeholder.jpg","passwordHash":"fakeHash:salt=fakeSalth89eFQSxrdhCytX68Nxe:password=bbbbbb","salt":"fakeSalth89eFQSxrdhCytX68Nxe","passwordUpdatedAt":1711872929949,"customAttributes":"{\"basic_info_done\":true,\"type\":\"business\"}","providerUserInfo":[{"providerId":"password","email":"[email protected]","federatedId":"[email protected]","rawId":"[email protected]","photoUrl":"https://storage.cloud.google.com/event-dee-staging.appspot.com/misc/profile-photo-placeholder.jpg"}],"validSince":"1711872929","email":"[email protected]","emailVerified":false,"disabled":false,"lastRefreshAt":"2024-03-31T08:35:24.874Z"}]}

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const onCreateEvent = functions.firestore
.onCreate(async (snapshot, context) => {
try {
const event = snapshot.data();
const newNotification = createNotificationDoc(event.creatorId, 'event', 'newEvent', event);
const newNotification = createNotificationDoc(event.creatorUid, 'event', 'newEvent', event);
const res = await db.collection('notifications').add(newNotification);

/* This can be filtered, e.g. to users in the same province */
Expand Down
16 changes: 10 additions & 6 deletions packages/tailwind-config/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./app/**/*.{js,ts,jsx,tsx}',
'./pages/**/*.{js,ts,jsx,tsx}',
'./components/**/*.{js,ts,jsx,tsx}',
/* Or if using `src` directory: */
'./src/**/*.{js,ts,jsx,tsx}',
/* include packages if not transpiling - IMPORTANT for uisng ui package when transpiling it inside apps */
'../../packages/**/*.{js,ts,jsx,tsx}',
'./src/**/*.{js,ts,jsx,tsx}',
],
// content: [
// './app/**/*.{js,ts,jsx,tsx}',
// './pages/**/*.{js,ts,jsx,tsx}',
// './components/**/*.{js,ts,jsx,tsx}',
// /* Or if using `src` directory: */
// './src/**/*.{js,ts,jsx,tsx}',
// /* include packages if not transpiling - IMPORTANT for uisng ui package when transpiling it inside apps */
// '../../packages/**/*.{js,ts,jsx,tsx}',
// ],
theme: {
extend: {},
},
Expand Down
14 changes: 14 additions & 0 deletions packages/ui/src/EventTag.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { BiPurchaseTag } from 'react-icons/bi';

type Props = {
text: string;
};

export const EventTag = ({ text }: Props) => {
return (
<div className='badge badge-info gap-2'>
<BiPurchaseTag />
{text}
</div>
);
};
1 change: 1 addition & 0 deletions packages/ui/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ export * from './ColoredDiv';
export * from './ImageWithtext';
export * from './ComingSoon';
export * from './NotificationCounter';
export * from './EventTag';

export * from './form-elements';

0 comments on commit d8f734b

Please sign in to comment.