Skip to content

Commit

Permalink
Minor issue fixes & readme updated
Browse files Browse the repository at this point in the history
  • Loading branch information
pokhrelashok committed Nov 29, 2023
1 parent d024d6f commit c8ea723
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 13 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@ All the data is stored locally and there are no api calls happening except the o

## Screenshots

![Main Menu](/screenshots/shot-1.png)
![Manage Users](/screenshots/shot-2.png)
![View Open Shares](/screenshots/shot-4.png)
![Check Share Results](/screenshots/shot-3.png)
![Main Menu](/screenshots/1.png)
_Main Menu_
![Manage Users](/screenshots/2.png)
_Manage Users_
![User Checkup](/screenshots/3.png)
_Check for User issues (demat expired, password expired)_
![User Portfolio](/screenshots/4.png)
_User Portfolio_
![Open Shares](/screenshots/6.png)
_Check Open Shares & Apply_
![Check Result](/screenshots/5.png)
_Check Application Result_
15 changes: 12 additions & 3 deletions app/users/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,30 @@
import { useParams, useSearchParams } from "next/navigation";
import Wrapper from "../../_components/Wrapper";
import useInvoke from "@/hooks/useInvoke";
import { useEffect } from "react";
import { Portfolio } from "@/types";
import { useEffect, useMemo } from "react";
import { Portfolio, User, UserDetails } from "@/types";
import { formatPrice } from "@/utils/price";
import SectionLoading from "@/app/_components/SectionLoading";

function UserDetailsPage() {
const params = useParams();
const id = params.id;
const { data, handle } = useInvoke<Portfolio>("get_user_portfolio");
const { data: users } = useInvoke<User[]>("get_users", [], true);
useEffect(() => {
handle({ id });
}, [handle, id]);

const details = useMemo(() => {
return users.find((u) => u.id == id);
}, [users, id]);

return (
<Wrapper className="!py-0" showBack={true} title="User Details">
<Wrapper
className="!py-0"
showBack={true}
title={`${details ? details.name : "User"} Portfolio`}
>
{data ? (
<table className="min-w-full bg-white border border-gray-300 z-[1111111]">
<thead>
Expand Down
7 changes: 1 addition & 6 deletions app/users/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,9 @@ import { Dialog, Transition } from "@headlessui/react";
import toast from "react-hot-toast";
import Wrapper from "../_components/Wrapper";
import Button from "../_components/Button";
import { Capital, User } from "../../types";
import { Capital, User, UserDetails } from "../../types";
import LoadingSpinner from "../_components/LoadingSpinner";

type UserDetails = {
details: User;
banks: Capital[];
};

const HIDDEN_FIELDS = ["id", "name", "bank", "dpcode"];

function ManageUsers() {
Expand Down
Binary file added screenshots/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed screenshots/shot-1.png
Binary file not shown.
Binary file removed screenshots/shot-2.png
Binary file not shown.
Binary file removed screenshots/shot-3.png
Binary file not shown.
Binary file removed screenshots/shot-4.png
Binary file not shown.
5 changes: 5 additions & 0 deletions types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,8 @@ export type PortfolioItem = {
valueOfLastTransPrice: string;
valueOfPrevClosingPrice: string;
};

export type UserDetails = {
details: User;
banks: Capital[];
};

0 comments on commit c8ea723

Please sign in to comment.