Members
# constant Axios
Axios instance with custom interceptors for handling requests and responses.
# constant customStyle
Custom style for the loading component.
# constant getAccountantData
Get Accountant Data from the given signature array.
# constant getCeoData
Get CEO Data from the given signature array.
# constant getChairmanData
Get Chairman Data from the given signature array.
# constant getDirectorData
Get Director Data from the given signature array.
# constant getGovernorData
Get Governor Data from the given signature array.
# constant getManagingDirectorData
Get Managing Director Data from the given signature array.
# constant useChangePassword
Custom hook to change the user's password.
This function makes an API call to change the user's password using an OTP code.
Example
const { mutate, isLoading, isError } = useChangePassword();
const changePasswordData = {
token: "yourAuthToken",
data: {
newPassword: "newPassword123",
confirmPassword: "newPassword123",
},
};
const handleChangePassword = async () => {
try {
await mutate(changePasswordData);
// Display success message
} catch (error) {
// Display error message
}
};
# constant useChangePassword
Custom hook to change user password.
This hook sends a password change request to the server using the provided data.
Example
// Usage of useChangePassword hook
const { mutate, isLoading, isError } = useChangePassword();
const handleChangePassword = async () => {
const passwordData = {
old_password: "old_password_here",
new_password: "new_password_here",
confirm_password: "new_password_here",
token: "user_token_here",
};
try {
await mutate(passwordData);
// Handle successful password change
} catch (error) {
// Handle password change error
}
};
# constant useForgetPassword
Custom hook to request a password reset email.
This function makes an API call to request a password reset email and sends an OTP code to the user's email address.
Example
const { mutate, isLoading, isError } = useForgetPassword();
const resetData = { email: "user@example.com" };
const handlePasswordReset = async () => {
try {
await mutate(resetData);
// Display success message
} catch (error) {
// Display error message
}
};
# constant useGetAnnouncements
Custom hook for fetching announcements.
# constant useGetBonusList
Custom hook to fetch a list of bonuses.
Example
const { data, isLoading, isError } = useGetBonusList();
if (isLoading) {
return <div>Loading...</div>;
}
if (isError) {
return <div>Error loading bonuses</div>;
}
return (
<div>
{data.map((bonus) => (
<div key={bonus.id}>{bonus.name}</div>
))}
</div>
);
# async constant useGetChats
Custom hook to send a chat message.
Example
const { mutate, isLoading, isError } = useGetChats();
const sendMessage = async (message) => {
try {
await mutate({ message });
} catch (error) {
console.error(error?.message);
}
};
# constant useGetCompanyChartData
Fetches chart data for a company's share history.
This function makes an API call to retrieve chart data for a specific company's share history.
Example
const { data, isLoading, isError } = useGetCompanyChartData();
if (isLoading) {
return <div>Loading chart data...</div>;
}
if (isError) {
return <div>Error loading chart data</div>;
}
return (
<div>
* Render chart data here
</div>
);
# constant useGetCompanyList
Custom hook to fetch a list of companies.
Example
const { data, isLoading, isError } = useGetCompanyList();
if (isLoading) {
return <div>Loading...</div>;
}
if (isError) {
return <div>Error loading companies</div>;
}
return (
<div>
{data.map((company) => (
<div key={company.id}>{company.name}</div>
))}
</div>
);
# constant useGetCompanyProjects
Custom hook to fetch a list of company projects.
Example
const { data, isLoading, isError } = useGetCompanyProjects();
if (isLoading) {
return <div>Loading...</div>;
}
if (isError) {
return <div>Error loading company projects</div>;
}
return (
<div>
{data.map((project) => (
<div key={project.id}>{project.name}</div>
))}
</div>
);
# constant useGetDocuments
Custom hook to fetch a list of documents related to shareholders.
This function makes an API call to retrieve documents associated with shareholders.
Example
const { data, isLoading, isError } = useGetDocuments();
if (isLoading) {
return <div>Loading documents...</div>;
}
if (isError) {
return <div>Error loading documents</div>;
}
return (
<div>
* Render the list of documents here
</div>
);
# constant useGetEventsList
Custom hook to fetch a list of events.
This function makes an API call to retrieve a list of events.
Example
const { data, isLoading, isError } = useGetEventsList();
if (isLoading) {
return <div>Loading events...</div>;
}
if (isError) {
return <div>Error loading events</div>;
}
return (
<div>
* Render the list of events here
</div>
);
# constant useGetInvestmentPortfolio
Custom hook to fetch investment portfolio data.
This hook fetches investment portfolio data from the server using the useQuery hook from "@tanstack/react-query."
Example
// Usage of useGetInvestmentPortfolio hook
const { data, isLoading, error } = useGetInvestmentPortfolio();
if (isLoading) {
return <p>Loading...</p>;
}
if (error) {
return <p>Error: {error.message}</p>;
}
// Render investment portfolio data
return (
<div>
<h1>Investment Portfolio</h1>
Render data here
</div>
);
# constant useGetInvoice
Custom hook to fetch an invoice by its ID.
This hook fetches an invoice by its ID from the server using the useQuery hook from "@tanstack/react-query."
Example
// Usage of useGetInvoice hook
const { data, isLoading, error } = useGetInvoice("invoice_id_here");
if (isLoading) {
return <p>Loading...</p>;
}
if (error) {
return <p>Error: {error.message}</p>;
}
// Render invoice data
return (
<div>
<h1>Invoice Details</h1>
Render data here
</div>
);
# constant useGetKarnama
Custom hook to fetch a "karnama" (assuming it's a specific entity) by its ID.
This hook fetches a "karnama" by its ID from the server using the useQuery hook from "@tanstack/react-query."
Example
// Usage of useGetKarnama hook
const { data, isLoading, error } = useGetKarnama("karnama_id_here");
if (isLoading) {
return <p>Loading...</p>;
}
if (error) {
return <p>Error: {error.message}</p>;
}
// Render "karnama" data
return (
<div>
<h1>Karnama Details</h1>
Render data here
</div>
);
# constant useGetNews
Custom hook to fetch a list of news articles.
This hook sends a request to retrieve news articles from the server.
Example
// Usage of useGetNews hook
const { data, isLoading, error } = useGetNews();
# constant useGetNotifications
Custom hook to fetch user notifications.
This hook sends a request to retrieve user notifications from the server.
Example
// Usage of useGetNotifications hook
const { data, isLoading, error } = useGetNotifications();
# constant useGetPayments
Custom hook to fetch user payments.
This hook sends a request to retrieve user payments from the server.
Example
// Usage of useGetPayments hook
const { data, isLoading, error } = useGetPayments();
# constant useGetPhoneOtp
Custom hook to request an OTP for a user's phone number.
This hook sends an OTP request to the server for phone number verification.
Example
// Usage of useGetPhoneOtp hook
const { mutate, isLoading, error } = useGetPhoneOtp();
const handleGetPhoneOtp = async (phoneNumber, token) => {
try {
await mutate({ phone_number: phoneNumber, token });
// Handle successful OTP request
} catch (error) {
// Handle OTP request error
}
};
# constant useGetReports
Custom hook to fetch company reports.
This hook sends a request to retrieve company reports from the server.
Example
// Usage of useGetReports hook
const { data, isLoading, error } = useGetReports();
# constant useGetShareCertificate
Custom hook to fetch a share certificate by ID.
This hook sends a request to retrieve a share certificate by its ID from the server.
Example
// Usage of useGetShareCertificate hook
const { data, isLoading, error } = useGetShareCertificate(123);
# constant useGetShareContracts
Custom hook to fetch share contracts.
This hook sends a request to retrieve share contracts from the server.
Example
// Usage of useGetShareContracts hook
const { data, isLoading, error } = useGetShareContracts();
# constant useGetShareHistoryList
Custom hook to fetch a list of share history.
This hook sends a request to retrieve a list of share history from the server.
Example
// Usage of useGetShareHistoryList hook
const { data, isLoading, error } = useGetShareHistoryList();
# constant useGetShareHolder
Custom hook to fetch a single share holder.
This hook sends a request to retrieve a single share holder from the server.
Example
// Usage of useGetShareHolder hook
const { data, isLoading, error } = useGetShareHolder();
# constant useGetShareHoldersList
Custom hook to fetch a list of share holders.
This hook sends a request to retrieve a list of share holders from the server.
Example
// Usage of useGetShareHoldersList hook
const { data, isLoading, error } = useGetShareHoldersList();
# constant useGetShareList
Custom hook to fetch a list of shares.
This hook sends a request to retrieve a list of shares from the server.
Example
// Usage of useGetShareList hook
const { data, isLoading, error } = useGetShareList();
# constant useGetShareTransferRequest
Custom hook to fetch a list of share transfer requests.
This hook sends a request to retrieve a list of share transfer requests from the server.
Example
// Usage of useGetShareTransferRequest hook
const { data, isLoading, error } = useGetShareTransferRequest();
# constant useGetSingleAnnouncements
Custom hook for fetching a single announcement by ID.
# constant useGetSingleNews
Custom hook to fetch a single news article by ID.
This hook sends a request to retrieve a single news article from the server by its ID.
Example
// Usage of useGetSingleNews hook
const { data, isLoading, error } = useGetSingleNews(123); // Replace 123 with the desired news article ID.
# constant useGetSingleShareTransferRequest
Custom hook to fetch a single share transfer request by ID.
This hook sends a request to retrieve a single share transfer request from the server based on its ID.
Example
// Usage of useGetSingleShareTransferRequest hook
const { data, isLoading, error } = useGetSingleShareTransferRequest("your_request_id");
# constant useGetTransactions
Custom hook to fetch user transactions.
This hook sends a request to retrieve user transactions from the server.
Example
// Usage of useGetTransactions hook
const { data, isLoading, error } = useGetTransactions();
# constant useGetUser
Custom hook to fetch user data.
This hook sends a GET request to retrieve user data from the server.
Example
// Usage of useGetUser hook
const { data, isLoading, isError, error } = useGetUser();
# constant useGetUserRoles
Custom hook to fetch user roles.
This hook sends a GET request to retrieve user roles from the server.
Example
// Usage of useGetUserRoles hook
const { data, isLoading, isError, error } = useGetUserRoles();
# constant usePaymentWithKhalti
Custom hook to make a payment with Khalti.
This hook sends a request to initiate a payment with Khalti.
Example
// Usage of usePaymentWithKhalti hook
const { mutate, isLoading, error } = usePaymentWithKhalti();
const paymentData = {
amount: "1000",
mobile: "9876543210",
purchase_order_id: "PO123",
purchase_order_name: "Sample Order",
transaction_id: "TXN001",
};
const handlePayment = () => {
mutate(paymentData);
};
# constant useRegisterEvent
Custom hook to register for an event.
This function makes an API call to register for an event.
Example
const { mutate, isLoading, isError } = useRegisterEvent();
const registrationData = { eventId: "event123", userId: "user456" };
const handleRegistration = async () => {
try {
await mutate(registrationData);
toast.success("Event registration successful");
} catch (error) {
toast.error("Event registration failed");
}
};
# constant useRegisterUser
Custom hook to register a new user.
This hook sends a POST request to register a new user on the server.
Example
// Usage of useRegisterUser hook
const { mutate, isLoading, isError, error } = useRegisterUser();
const registrationData = { ... };
mutate(registrationData);
# constant useRequestLogin
Custom hook to request user login.
This hook sends a login request to the server using the provided user data.
Example
// Usage of useRequestLogin hook
const { mutate, isLoading, isError } = useRequestLogin();
const handleLogin = async () => {
const loginData = { username: "username_here", password: "password_here" };
try {
await mutate(loginData);
// Handle successful login
} catch (error) {
// Handle login error
}
};
# constant useShareTransferRequest
Custom hook to submit a share transfer request.
This hook sends a POST request to create a share transfer request on the server.
Example
// Usage of useShareTransferRequest hook
const { mutate, isLoading, isError, error } = useShareTransferRequest();
const requestData = { ......} ;
mutate(requestData);
# constant useUpdateEmail
Custom hook to update the user's email address.
This hook sends an email update request to the server.
Example
// Usage of useUpdateEmail hook
const { mutate, isLoading, error } = useUpdateEmail();
const handleUpdateEmail = async (newEmail, token) => {
try {
await mutate({ email: newEmail, token });
// Handle successful email update
} catch (error) {
// Handle email update error
}
};
# constant useUpdatePassword
Custom hook to update the user's password for the profile section.
This hook sends a password update request to the server.
Example
// Usage of useUpdatePassword hook
const { mutate, isLoading, error } = useUpdatePassword();
const handleUpdatePassword = async (newPassword) => {
try {
await mutate({ new_password: newPassword });
// Handle successful password update
} catch (error) {
// Handle password update error
}
};
# constant useVerifyOtp
Custom hook to verify an OTP code.
This function makes an API call to verify an OTP code for password reset.
Example
const { mutate, isLoading, isError } = useVerifyOtp();
const otpData = { otpCode: "123456" };
const handleOtpVerification = async () => {
try {
await mutate(otpData);
// Display success message
} catch (error) {
// Display error message
}
};
# constant useVerifyOtpFirstUser
Custom hook to verify OTP for the first-time user.
This hook sends an OTP verification request to the server.
Example
// Usage of useVerifyOtpFirstUser hook
const { mutate, isLoading, error } = useVerifyOtpFirstUser();
const handleVerifyOtp = async (otp, token) => {
try {
await mutate({ otp, token });
// Handle successful OTP verification
} catch (error) {
// Handle OTP verification error
}
};
# constant useVerifyPayment
Custom hook to verify a Khalti payment.
This hook sends a request to verify a Khalti payment using provided details.
Example
// Usage of useVerifyPayment hook
const { mutate, isLoading, error } = useVerifyPayment();
const verificationData = {
pidx: "12345",
txnId: "TXN001",
amount: "1000",
mobile: "9876543210",
purchase_order_id: "PO123",
purchase_order_name: "Sample Order",
transaction_id: "TXN001",
};
const handleVerifyPayment = () => {
mutate(verificationData);
};
Methods
# AddFamilyForm(props) → {JSX.Element}
AddFamilyForm component allows users to add a new family member.
Parameters:
| Name | Type | Description |
|---|---|---|
props |
Object
|
The component's props. |
setShowCurrent |
function
|
Function to set the current view. |
apicall |
function
|
Function to make an API call and update data. |
- React component representing the add family member form.
JSX.Element
# AddNomineeForm(props) → {JSX.Element}
A React component for adding a nominee.
Parameters:
| Name | Type | Description |
|---|---|---|
props |
Object
|
The component's props. |
apicall |
function
|
A function to make an API call. |
setShowCurrent |
function
|
A function to set the current view. |
The rendered component.
JSX.Element
# Address(user) → {JSX.Element}
Address component displays the user's address information and provides an option to add a new address.
Parameters:
| Name | Type | Description |
|---|---|---|
user |
Object
|
The user object containing address information. |
- React component representing the user's address.
JSX.Element
# AddressAdd(props) → {JSX.Element}
AddressAdd component for adding user address information.
Parameters:
| Name | Type | Description |
|---|---|---|
props |
Object
|
The component's props. |
ToggleAddForm |
function
|
Function to toggle the address add form visibility. |
- React component for adding user address information.
JSX.Element
# AddressCard(props) → {JSX.Element}
AddressCard component for displaying user address information.
Parameters:
| Name | Type | Description |
|---|---|---|
props |
Object
|
The component's props. |
dat |
Object
|
The address data to display. |
setAddressToEdit |
function
|
Function to set the address to be edited. |
setShowEditForm |
function
|
Function to control the visibility of the edit form. |
- React component for displaying user address information.
JSX.Element
# AvatarComponent() → {JSX.Element}
AvatarComponent renders a user avatar.
- React component.
JSX.Element
# DetailsForm(props) → {JSX.Element}
DetailsForm component for displaying and editing personal information.
Parameters:
| Name | Type | Description |
|---|---|---|
props |
Object
|
The component's props. |
user |
Object
|
The user's data to display and edit. |
userroles |
Object
|
The user's roles and permissions. |
setEdit |
function
|
Function to toggle edit mode. |
apicall |
function
|
Function to trigger an API call. |
edit |
boolean
|
Flag to determine if the form is in edit mode. |
- React component.
JSX.Element
# DocumentCard(props) → {JSX.Element}
A component to display and manage shareholder verification documents.
Parameters:
| Name | Type | Description |
|---|---|---|
props |
Object
|
The component's props. |
dat |
Object
|
The document data. |
setShowCurrent |
function
|
A function to set the current view. |
setDocumentToEdit |
function
|
A function to set the document to edit. |
setDocumentToView |
function
|
A function to set the document to view. |
The rendered component.
JSX.Element
# DocumentForm(props) → {JSX.Element}
A form for capturing shareholder verification document information.
Parameters:
| Name | Type | Description |
|---|---|---|
props |
object
|
The component's props. |
prev |
function
|
The function to go back to the previous step. |
The rendered component.
JSX.Element
# EditAddressForm(props) → {JSX.Element}
EditAddressForm component for editing user address information.
Parameters:
| Name | Type | Description |
|---|---|---|
props |
Object
|
The component's props. |
address |
Object
|
The address data to edit. |
setShowAddForm |
function
|
Function to control the visibility of the add form. |
setShowEditForm |
function
|
Function to control the visibility of the edit form. |
- React component for editing user address information.
JSX.Element
# EditFamilyMember(props) → {JSX.Element}
EditFamilyMember component for editing family member information.
Parameters:
| Name | Type | Description |
|---|---|---|
props |
Object
|
The component's props. |
member |
Object
|
The family member's data to edit. |
setShowCurrent |
function
|
Function to set the current view. |
- React component.
JSX.Element
# EditVerificationDocument(props) → {JSX.Element}
A component to edit shareholder verification documents.
Parameters:
| Name | Type | Description |
|---|---|---|
props |
Object
|
The component's props. |
dat |
Object
|
The document data to edit. |
View Source pages/Dashboard/Shareholder/ShareholderVerification/EditVerificationDocument.jsx, line 15
The rendered component.
JSX.Element
# ErrorMessage(props) → {JSX.Element}
ErrorMessage component to display error messages.
Parameters:
| Name | Type | Description |
|---|---|---|
props |
Object
|
Component props. |
errorMessage |
string
|
The error message to display. |
handleErrorMessage |
function
|
Function to handle error message dismissal. |
The ErrorMessage component.
JSX.Element
# FamilyDetails() → {JSX.Element}
FamilyDetails component for managing and displaying family member information.
- React component.
JSX.Element
# FamilyMemberCard(props) → {JSX.Element}
FamilyMemberCard component for displaying family member information.
Parameters:
| Name | Type | Description |
|---|---|---|
props |
Object
|
The component's props. |
dat |
Object
|
The family member's data. |
setMemberToEdit |
function
|
Function to set the family member to edit. |
setDocumentToView |
function
|
Function to set the document to view. |
setShowCurrent |
function
|
Function to set the current view. |
- React component.
JSX.Element
# Home() → {JSX.Element}
Represents the public portal landing page including several sections
The Home component.
JSX.Element
# Loading() → {JSX.Element}
A loading component displayed while the main content is loading.
The Loading component.
JSX.Element
# LoadingAnimation() → {JSX.Element}
Loading animation component
Returns a loading animation Jsx element
JSX.Element
# LogoutModal(props) → {JSX.Element}
Component for displaying a logout confirmation modal.
Parameters:
| Name | Type | Description |
|---|---|---|
props |
object
|
Component props. |
setShowLogoutModal |
function
|
Function to toggle the logout modal. |
showLogoutMOdal |
boolean
|
Boolean indicating whether to show the logout modal. |
handleSignOUt |
function
|
Function to handle the logout action. |
- Rendered component.
JSX.Element
# MenuDropDown(props) → {JSX.Element}
Component for displaying a dropdown menu. in Navbar component.
Parameters:
| Name | Type | Description |
|---|---|---|
props |
object
|
Component props. |
userroles |
object
|
User roles and eligibility data. |
showLogoutMOdal |
boolean
|
Boolean indicating whether to show the logout modal. |
setShowLogoutModal |
function
|
Function to toggle the logout modal. |
dropDownModal |
boolean
|
Boolean indicating whether the dropdown menu is open. |
setDropDownModal |
function
|
Function to toggle the dropdown menu. |
- Rendered component.
JSX.Element
# MultiStepForm() → {JSX.Element}
A multi-step form for capturing shareholder information and documents.
The rendered component.
JSX.Element
# NomineeCard(props) → {JSX.Element}
A card component displaying nominee information.
Parameters:
| Name | Type | Description |
|---|---|---|
props |
Object
|
The component's props. |
dat |
Object
|
Nominee data to display. |
setShowCurrent |
function
|
A function to set the current view. |
setDocumentToView |
function
|
A function to set the document to view. |
The rendered component.
JSX.Element
# NomineeDetails() → {JSX.Element}
A component to manage and display nominee details.
The rendered component.
JSX.Element
# Notificaction(props) → {JSX.Element}
Component for displaying notifications.
Parameters:
| Name | Type | Description |
|---|---|---|
props |
object
|
Component props. |
setNotification |
function
|
Function to toggle the notification display. |
notification |
boolean
|
Boolean indicating whether the notification modal is displayed. |
notificationData |
array
|
Array of notification data. |
setNotifyData |
function
|
Function to update notification data. |
- Rendered component.
JSX.Element
# PrivateRoute() → {JSX.Element}
A private route component that renders its children (nested routes) if a user is authenticated. If the user is not authenticated, it redirects to the home page.
The private route component.
JSX.Element
# Protected(props) → {JSX.Element}
Represents a protected route component.
Parameters:
| Name | Type | Description |
|---|---|---|
props |
object
|
The component's props. |
Component |
React.ComponentType
|
The component to render if the user is authenticated. |
The protected route component.
JSX.Element
# PublicProtectedRoute() → {JSX.Element}
A route component that redirects authenticated users to the dashboard and displays a public navbar for unauthenticated users.
The public-protected route component.
JSX.Element
# PublicRoute() → {JSX.Element}
A route component that redirects authenticated users to the dashboard and displays a public navbar.
The public route component.
JSX.Element
# QRModal() → {JSX.Element}
A QR modal component for displaying and copying a QR code.
The rendered component.
JSX.Element
# ShareholderEditForm(props) → {JSX.Element}
ShareholderEditForm component for editing user profile information.
Parameters:
| Name | Type | Description |
|---|---|---|
props |
Object
|
The component's props. |
user |
Object
|
The user's information. |
userroles |
Object
|
The user's roles. |
setEdit |
function
|
Function to toggle edit mode. |
apicall |
function
|
Function to make an API call. |
edit |
boolean
|
Edit mode flag. |
- React component.
JSX.Element
# ShareholderForm(props) → {JSX.Element}
A component for capturing shareholder information.
Parameters:
| Name | Type | Description |
|---|---|---|
props |
object
|
The component props. |
next |
function
|
A function to proceed to the next step. |
The rendered component.
JSX.Element
# SideNavbar(props) → {JSX.Element}
A sidebar navigation component.
Parameters:
| Name | Type | Description |
|---|---|---|
props |
object
|
The component's props. |
userroles |
object
|
User role information. |
mobileMenu |
boolean
|
Whether the mobile menu is open. |
setMobileMenu |
function
|
Function to set the mobile menu state. |
The rendered component.
JSX.Element
# TabGroup(user, userroles, setEdit, apicall, edit, handleEdit) → {JSX.Element}
TabGroup component
Parameters:
| Name | Type | Description |
|---|---|---|
user |
object
|
user object |
userroles |
object
|
userroles object |
setEdit |
function
|
setEdit function |
apicall |
function
|
apicall function |
edit |
boolean
|
edit boolean |
handleEdit |
function
|
handleEdit function |
TabGroup component
JSX.Element
# TopNavbar(props) → {JSX.Element}
A top navigation bar component.
Parameters:
| Name | Type | Description |
|---|---|---|
props |
object
|
The component's props. |
user |
object
|
User information. |
userroles |
object
|
User role information. |
showLogoutMOdal |
boolean
|
Whether to show the logout modal. |
setShowLogoutModal |
function
|
Function to set the state of the logout modal. |
setMobileMenu |
function
|
Function to set the mobile menu state. |
mobileMenu |
boolean
|
Whether the mobile menu is open. |
The rendered component.
JSX.Element
# VerificationDocument() → {JSX.Element}
A component for managing shareholder verification documents.
The rendered component.
JSX.Element