Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moderator UI #54

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Moderator UI #54

wants to merge 14 commits into from

Conversation

Missyandrea
Copy link

The Moderator Flow design has been added

All Users page
All_users

Accepted users page
Accepted_users

Accepted Users details
Accepted_userscard

Farmer documents page
farmersdocs

Farmer documents details
farmersdocscard

Certificates page
certificates

@Missyandrea Missyandrea requested a review from abu-hasib January 13, 2024 17:41
@Missyandrea Missyandrea requested review from mihrab34 and removed request for abu-hasib May 3, 2024 08:52
@mihrab34
Copy link
Contributor

mihrab34 commented May 4, 2024

@Missyandrea can you resolve the merge conflicts you have in your pr

Copy link
Contributor

@mihrab34 mihrab34 left a comment

Choose a reason for hiding this comment

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

the moderator structure under the pages folder can be improved as well so it's easier to navigate as there's no link to check accepted_users except I change the URL directly.
What do you think about this structure ? ChatGpt helped with structure btw :)

pages/
├── moderator/
│ ├── index.tsx (Main moderator panel component)
│ ├── users/
│ │ ├── index.tsx (Users section component)
│ │ ├── new_user.tsx (New user component)
│ │ ├── accepted_users/
│ │ │ └── index.tsx (Accepted users component)
│ ├── farmers_documents/
│ │ ├── index.tsx (Farmers' documents section component)
│ │ └── farmers_documents.tsx (Farmers' documents component)
│ ├── certificates/
│ │ ├── index.tsx (Certificates section component)
│ │

document1: string | null
document2: string | null
}

Copy link
Contributor

Choose a reason for hiding this comment

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

It's a good practice to centralize reusable types/interfaces in a shared location rather than duplicating them across multiple components so it can be easily maintained. You can create a separate file ( types.ts) in the lib folder and export the Farmer interface from there.

types.ts
export interface Farmer {
  id: number;
  name: string;
  email: string;
  time: string;
  status: string;
  certificate: string | null;
  code: number | null;
  document1: string | null;
  document2: string | null;
}

<div className="flex items-center">
<CloseCircleOutline />
<p className="ms-2 text-sm">Reject</p>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

The approve and reject buttons can be a component that you can re-use here and the new farmers table

},
]

const [revealButtons, setRevealButtons] = useState(false)
Copy link
Contributor

Choose a reason for hiding this comment

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

and maybe a type check for the revealButton state as well

const [revealButtons, setRevealButtons] = useState<boolean>(false)

setCurrentPage(selectedPage.selected)
}

const handleButtons = (farmer: Farmer) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

and the handleButtons could be a custom function or hook that can be used both on newfarmerstable and here

@mihrab34
Copy link
Contributor

mihrab34 commented May 4, 2024

Oh, I also noticed from the design that this UI is just a wireframe, I'm not sure if it has been approved for development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants