Skip to content

Commit

Permalink
Roll out 1.4.1 (#177)
Browse files Browse the repository at this point in the history
* Feature/config email testing on local environment (#138)

* Remove (#92)

Co-authored-by: Pjaijai <[email protected]>

* [#137] Config email testing on local environment

* Fix .env variable name

---------

Co-authored-by: Pjaijai <[email protected]>
Co-authored-by: Pjaijai <[email protected]>

* Feature/revamp card (#135)

* Feature/update backend setup on developer md (#104)

* Ignore local IDE config

* Update backend setup guidelines on developer.md

* Add supabase config guidelines

* Fix md syntax

* add CORS to edge func depending on the staging env

* add reply-to header to both contact email (#109)

* Feature/refactor search hook (#96)

* Refactor search hook in referral page

* Refactor referee search hook

* Remove useless import

* Refactor referee post

* Refactor referrer post search hook

* Remmove uesless import

* Change to error toast (#106)

Co-authored-by: Pjaijai <[email protected]>

---------

Co-authored-by: Pjaijai <[email protected]>

* create new card component for referrer and referee; update card skeleton; add missing modules in tailwind

* add referral post card; update referral post pages

* update contact toUuid; minor ui fix

* add items-center to info display

* Show edit button on profile page if logged-in user is profile user

* Fix build error

* Fix typos

* Import as module path

* Module import

* Using Link instead of onurlclick

* Fix import

* Remove id slug user page

* Remove showEditButton props

---------

Co-authored-by: Lulu <[email protected]>
Co-authored-by: Thomas Yau <[email protected]>
Co-authored-by: Thomas Yau <[email protected]>
Co-authored-by: Pjaijai <[email protected]>
Co-authored-by: Pjaijai <[email protected]>
Co-authored-by: Lulu Tung <[email protected]>

* Refactor/fix all formart problem (#142)

* Fix doc

* Fix format

---------

Co-authored-by: Pjaijai <[email protected]>

* Refactor/fixing site config and using common layout (#172)

* Rename search page layout to common page layout

* refactor common layout

* Using common layout

* Remove margin top in create post template

---------

Co-authored-by: Pjaijai <[email protected]>

* version bump (#175)

Co-authored-by: Pjaijai <[email protected]>

* Feature/contributors page (#174)

* fix file name

---------

Co-authored-by: Lulu <[email protected]>
Co-authored-by: Pjaijai <[email protected]>
Co-authored-by: marukosy124 <[email protected]>
Co-authored-by: Thomas Yau <[email protected]>
Co-authored-by: Thomas Yau <[email protected]>
Co-authored-by: Lulu Tung <[email protected]>
  • Loading branch information
7 people authored Oct 26, 2023
1 parent 50dc364 commit 4d96dd5
Show file tree
Hide file tree
Showing 24 changed files with 349 additions and 80 deletions.
19 changes: 10 additions & 9 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,24 +90,25 @@ For accurate information, please check supabase local dev doc here[https://supab
6. Every time you make changes to Supabase functions, run `supabase functions deploy --project-ref [your-supabase-project-id]`.

## Frontend Development

- Environment
- NodeJS 18.0.0 - 20.5.1
- NPM 9.0.0 - 10.0.0

### To start a local development server

1. Navigate to the 'client' directory\
```bash
cd client
```
```bash
cd client
```
1. Install dependencies\
```bash
npm install
```
```bash
npm install
```
1. Start the development server
```bash
npm run preview
```
```bash
npm run preview
```
1. View the website at [http://localhost:3000](http://localhost:3000)

### Creating branch
Expand Down
7 changes: 5 additions & 2 deletions client/app/auth/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
import React from "react"
import AuthPageTemplate from "@/modules/auth/template"

import { siteConfig } from "@/config/site"
import CommonPageLayout from "@/components/layouts/common"

const AuthPage = () => {
return (
<div className="mt-20 flex items-center justify-center">
<CommonPageLayout>
<AuthPageTemplate />
</div>
</CommonPageLayout>
)
}

Expand Down
15 changes: 15 additions & 0 deletions client/app/contributors/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from "react"
import ContributorsPageTemplate from "@/modules/contributors/template"

import { siteConfig } from "@/config/site"
import CommonPageLayout from "@/components/layouts/common"

const ContributorsPage = () => {
return (
<CommonPageLayout title={siteConfig.page.contributors.name}>
<ContributorsPageTemplate />
</CommonPageLayout>
)
}

export default ContributorsPage
4 changes: 2 additions & 2 deletions client/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ export default function IndexPage() {
</div>
<div className={"flex flex-wrap gap-4"}>
<Link
href={siteConfig.page.about.href}
href={siteConfig.page.contributors.href}
className={buttonVariants({
variant: isUserSignIn ? "default" : "outline",
})}
>
了解更多
{siteConfig.page.contributors.name}
</Link>

<Link
Expand Down
9 changes: 8 additions & 1 deletion client/app/post/create/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@
import React from "react"
import CreatePostTemplate from "@/modules/post/create/template"

import { siteConfig } from "@/config/site"
import CommonPageLayout from "@/components/layouts/common"

const CreatePostPage = () => {
return <CreatePostTemplate />
return (
<CommonPageLayout title={siteConfig.page.createPost.name}>
<CreatePostTemplate />
</CommonPageLayout>
)
}

export default CreatePostPage
7 changes: 4 additions & 3 deletions client/app/post/referee/page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import React from "react"
import RefereePostPageTemplate from "@/modules/post/referee/template"

import SearchPageLayout from "@/components/layouts/search-page"
import { siteConfig } from "@/config/site"
import CommonPageLayout from "@/components/layouts/common"

const RefereePostPage = () => {
return (
<SearchPageLayout title="人搵工">
<CommonPageLayout title={siteConfig.page.refereePost.name}>
<RefereePostPageTemplate />
</SearchPageLayout>
</CommonPageLayout>
)
}

Expand Down
7 changes: 4 additions & 3 deletions client/app/post/referer/page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import React from "react"
import RefererPostPageTemplate from "@/modules/post/referer/template"

import SearchPageLayout from "@/components/layouts/search-page"
import { siteConfig } from "@/config/site"
import CommonPageLayout from "@/components/layouts/common"

const RefererPostPage = () => {
return (
<SearchPageLayout title="工搵人">
<CommonPageLayout title={siteConfig.page.referrerPost.name}>
<RefererPostPageTemplate />
</SearchPageLayout>
</CommonPageLayout>
)
}

Expand Down
5 changes: 3 additions & 2 deletions client/app/profile/[userUuid]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { siteConfig } from "@/config/site"
import useGetUserprofile from "@/hooks/api/user/get-user-profile"
import useUserStore from "@/hooks/state/user/store"
import { Icons } from "@/components/icons"
import CommonPageLayout from "@/components/layouts/common"

const Page = ({ params }: { params: { userUuid: string } }) => {
const { userUuid } = params
Expand Down Expand Up @@ -39,7 +40,7 @@ const Page = ({ params }: { params: { userUuid: string } }) => {
)
if (!isLoading && profile)
return (
<div className="mt-8 h-full w-full ">
<CommonPageLayout title={siteConfig.page.profile.name}>
{!isEditMode && (
<ViewProfileTemplate
photoUrl={profile.avatar_url || undefined}
Expand Down Expand Up @@ -79,7 +80,7 @@ const Page = ({ params }: { params: { userUuid: string } }) => {
setIsEditMode={setIsEditMode}
/>
)}
</div>
</CommonPageLayout>
)
}

Expand Down
7 changes: 4 additions & 3 deletions client/app/referee/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import React from "react"
import { NextPage } from "next"
import RefereePageTemplate from "@/modules/referral/referee/template"

import SearchPageLayout from "@/components/layouts/search-page"
import { siteConfig } from "@/config/site"
import CommonPageLayout from "@/components/layouts/common"

const RefereePage: NextPage = () => {
return (
<SearchPageLayout title="受薦人">
<CommonPageLayout title={siteConfig.page.referee.name}>
<RefereePageTemplate />
</SearchPageLayout>
</CommonPageLayout>
)
}

Expand Down
7 changes: 4 additions & 3 deletions client/app/referer/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import React from "react"
import { NextPage } from "next"
import RefererPageTemplate from "@/modules/referral/referer/template"

import SearchPageLayout from "@/components/layouts/search-page"
import { siteConfig } from "@/config/site"
import CommonPageLayout from "@/components/layouts/common"

const RefererPage: NextPage = () => {
return (
<SearchPageLayout title="推薦人">
<CommonPageLayout title={siteConfig.page.referrer.name}>
<RefererPageTemplate />
</SearchPageLayout>
</CommonPageLayout>
)
}

Expand Down
75 changes: 48 additions & 27 deletions client/components/customized-ui/footer/nav.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client"

import React from "react"
import Link from "next/link"

Expand All @@ -6,33 +8,52 @@ import { Icons } from "@/components/icons"

const NavFooter = () => {
return (
<footer className="mt-12 flex flex-col items-center justify-end gap-2 border-t-2 p-2 md:flex-row">
<div className="flex flex-row items-center gap-1 text-sm text-muted-foreground ">
<a href="mailto:[email protected]">
<Icons.mail />
</a>

<Link
className="text-sm text-muted-foreground"
href={siteConfig.links.github}
target="_blank"
rel="noreferrer"
>
<Icons.github />
</Link>

<Link
className="text-sm text-muted-foreground"
href={siteConfig.page.privacyPolicy.href}
>
Privacy Policy
</Link>
<Link
className="text-sm text-muted-foreground"
href={siteConfig.page.termsAndConditions.href}
>
Terms and Conditions
</Link>
<footer className="mt-12 flex flex-col items-center justify-center gap-2 border-t-2 p-2 md:flex-row ">
<div className="flex flex-col items-center gap-1 text-sm text-muted-foreground ">
<div className="flex flex-row gap-2">
<a href="mailto:[email protected]">
<Icons.mail />
</a>

<Link
className="text-sm text-muted-foreground"
href={siteConfig.links.github}
target="_blank"
rel="noreferrer"
>
<Icons.github />
</Link>
</div>

<div className="flex flex-col gap-2 md:flex-row">
<Link
className="text-center text-sm text-muted-foreground"
href={siteConfig.page.privacyPolicy.href}
>
Privacy Policy
</Link>

<Link
className="text-center text-sm text-muted-foreground"
href={siteConfig.page.termsAndConditions.href}
>
Terms and Conditions
</Link>

<Link
className="text-center text-sm text-muted-foreground"
href={siteConfig.page.about.href}
>
{siteConfig.page.about.name}
</Link>

<Link
className="text-center text-sm text-muted-foreground"
href={siteConfig.page.contributors.href}
>
{siteConfig.page.contributors.name}
</Link>
</div>
</div>
</footer>
)
Expand Down
4 changes: 4 additions & 0 deletions client/components/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import {
ChevronDownIcon,
Github,
Instagram,
Laptop,
Link,
Linkedin,
Loader,
LucideProps,
Mail,
Expand All @@ -32,6 +34,7 @@ export const Icons = {
twitter: Twitter,
user: User,
link: Link,
laptop: Laptop,
mail: Mail,
pencil: Pencil,
loader: Loader,
Expand All @@ -41,6 +44,7 @@ export const Icons = {
checkCircle: CheckCircle2,
instagram: Instagram,
github: Github,
linkedin: Linkedin,
rotateRight: RotateCcw,
slidersHorizontal: SlidersHorizontal,
logo: (props: LucideProps) => (
Expand Down
18 changes: 18 additions & 0 deletions client/components/layouts/common.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React, { PropsWithChildren } from "react"

interface CommonPageLayout {
title?: string
}
const CommonPageLayout: React.FunctionComponent<
PropsWithChildren<CommonPageLayout>
> = ({ title, children }) => {
return (
<div className="mt-4 h-full w-full">
{title && <h1 className=" text-center text-2xl font-bold">{title}</h1>}

{children}
</div>
)
}

export default CommonPageLayout
17 changes: 0 additions & 17 deletions client/components/layouts/search-page.tsx

This file was deleted.

16 changes: 10 additions & 6 deletions client/config/site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,27 @@ export const siteConfig = {
href: "/auth",
},
referrer: {
name: "referrer",
name: "推薦人",
href: "/referer",
},
referee: {
name: "referee",
name: "受薦人",
href: "/referee",
},
createPost: {
name: "createPost",
name: "貼街招",
href: "/post/create",
},
referrerPost: {
name: "createPost",
name: "工搵人",
href: "/post/referer",
},
refereePost: {
name: "createPost",
name: "人搵工",
href: "/post/referee",
},
about: {
name: "about",
name: "關於本平台",
href: "/about",
},
privacyPolicy: {
Expand All @@ -48,6 +48,10 @@ export const siteConfig = {
name: "termsAndConditions",
href: "/terms-and-conditions",
},
contributors: {
name: "貢獻者名單",
href: "/contributors",
},
},
links: {
instagram: "https://instagram.com/referalah?igshid=NGVhN2U2NjQ0Yg==",
Expand Down
Loading

0 comments on commit 4d96dd5

Please sign in to comment.