@monarkmarkets/marketplace 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +134 -0
- package/package.json +55 -0
package/README.md
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Marketplace
|
|
2
|
+
|
|
3
|
+
A collection of React components for displaying a marketplace of pre-IPO companies and SPVs with pagination and loading states.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
For local development:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Step 1: Link the package
|
|
11
|
+
cd primary-offering-demo/packages/marketplace
|
|
12
|
+
npm link
|
|
13
|
+
|
|
14
|
+
# Step 2: Use the linked package in your React app
|
|
15
|
+
cd primary-offering-demo/questionnaire/client
|
|
16
|
+
npm link ../../packages/marketplace
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Components
|
|
20
|
+
|
|
21
|
+
### IoITable
|
|
22
|
+
|
|
23
|
+
A table component that displays a list of pre-IPO companies with pagination and loading states.
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
import { IoITable } from 'marketplace';
|
|
27
|
+
|
|
28
|
+
<IoITable
|
|
29
|
+
companies={preIPOCompanies}
|
|
30
|
+
investorId={state?.investorId}
|
|
31
|
+
onButtonClick={handleButtonClick}
|
|
32
|
+
buttonText="Submit IOI"
|
|
33
|
+
currentPage={currentPage}
|
|
34
|
+
totalPages={totalPages}
|
|
35
|
+
onPageChange={handlePageChange}
|
|
36
|
+
isLoading={isTableLoading}
|
|
37
|
+
/>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### PrimaryTable
|
|
41
|
+
|
|
42
|
+
A table component that displays a list of SPV offerings with loading states.
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
import { PrimaryTable } from 'marketplace';
|
|
46
|
+
|
|
47
|
+
<PrimaryTable
|
|
48
|
+
companies={spvCompanies}
|
|
49
|
+
investorId={state?.investorId}
|
|
50
|
+
onButtonClick={handleSpvButtonClick}
|
|
51
|
+
buttonText="Invest"
|
|
52
|
+
isLoading={spvIsLoading}
|
|
53
|
+
/>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### TableHeader
|
|
57
|
+
|
|
58
|
+
A component that renders the header row for both the `IoITable` and `PrimaryTable` components.
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
import { TableHeader } from 'marketplace';
|
|
62
|
+
|
|
63
|
+
<TableHeader />
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### TableRow
|
|
67
|
+
|
|
68
|
+
A component that renders a row in either the `IoITable` or `PrimaryTable` component.
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
// For IoITable
|
|
72
|
+
<TableRow
|
|
73
|
+
ColumnOne={{
|
|
74
|
+
preIPOCompany: company,
|
|
75
|
+
name: company.name || ''
|
|
76
|
+
}}
|
|
77
|
+
ColumnTwo={(company) => formatLargeNumber(company.preIPOCompany.totalFunding || 0)}
|
|
78
|
+
ColumnThree={(company) =>
|
|
79
|
+
company.preIPOCompany.lastFundingSeries
|
|
80
|
+
? `${company.preIPOCompany.lastFundingSeries}`
|
|
81
|
+
: 'Unknown'
|
|
82
|
+
}
|
|
83
|
+
ColumnFour={(company) =>
|
|
84
|
+
company.preIPOCompany.lastSharePrice
|
|
85
|
+
? `$${company.preIPOCompany.lastSharePrice.toFixed(2)}`
|
|
86
|
+
: 'Not Available'
|
|
87
|
+
}
|
|
88
|
+
buttonText="Submit IOI"
|
|
89
|
+
investorId={investorId}
|
|
90
|
+
tableType="private"
|
|
91
|
+
onButtonClick={handleButtonClick}
|
|
92
|
+
/>
|
|
93
|
+
|
|
94
|
+
// For PrimaryTable
|
|
95
|
+
<TableRow
|
|
96
|
+
ColumnOne={{
|
|
97
|
+
preIPOCompanySpv: spv,
|
|
98
|
+
name: spv.name || ''
|
|
99
|
+
}}
|
|
100
|
+
ColumnTwo={(company) => formatCurrency(company.preIPOCompanySpv.totalAllocation)}
|
|
101
|
+
ColumnThree={(company) => formatCurrency(company.preIPOCompanySpv.minCommitmentAmount)}
|
|
102
|
+
ColumnFour={(company) => formatCurrency(company.preIPOCompanySpv.investorPricePerShare)}
|
|
103
|
+
buttonText="Invest"
|
|
104
|
+
investorId={investorId}
|
|
105
|
+
onButtonClick={handleSpvButtonClick}
|
|
106
|
+
/>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Pagination
|
|
110
|
+
|
|
111
|
+
A component that renders pagination controls for the `IoITable` component.
|
|
112
|
+
|
|
113
|
+
```tsx
|
|
114
|
+
import { Pagination } from 'marketplace';
|
|
115
|
+
|
|
116
|
+
<Pagination
|
|
117
|
+
currentPage={currentPage}
|
|
118
|
+
totalPages={totalPages}
|
|
119
|
+
onPageChange={handlePageChange}
|
|
120
|
+
/>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Types
|
|
124
|
+
|
|
125
|
+
The package includes TypeScript definitions for all components and their props. Key interfaces include:
|
|
126
|
+
|
|
127
|
+
- `TableProps` - Props for the IoITable component
|
|
128
|
+
- `SpvTableProps` - Props for the PrimaryTable component
|
|
129
|
+
- `RowProps` - Props for IoITable rows
|
|
130
|
+
- `SpvRowProps` - Props for PrimaryTable rows
|
|
131
|
+
- `PaginationProps` - Props for the Pagination component
|
|
132
|
+
- `LogoAndCountryProps` - Props for company logo and location details
|
|
133
|
+
|
|
134
|
+
For detailed type information, please refer to the types.ts file in the package.
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@monarkmarkets/marketplace",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Marketplace component for Monark Markets",
|
|
5
|
+
"keywords": ["marketplace", "finance", "trading", "react-component"],
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"module": "dist/index.esm.js",
|
|
8
|
+
"types": "dist/types/index.d.ts",
|
|
9
|
+
"type": "module",
|
|
10
|
+
"sideEffects": false,
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/monark-markets/primary-offerings.git",
|
|
15
|
+
"directory": "primary-offering-demo/packages/marketplace"
|
|
16
|
+
},
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"import": "./dist/index.esm.js",
|
|
20
|
+
"require": "./dist/index.js",
|
|
21
|
+
"types": "./dist/types/index.d.ts"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist"
|
|
26
|
+
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "rollup -c",
|
|
29
|
+
"clean": "rimraf dist",
|
|
30
|
+
"prebuild": "npm run clean"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"react": "^18.0.0",
|
|
34
|
+
"react-dom": "^18.0.0"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@babel/core": "^7.26.8",
|
|
40
|
+
"@babel/preset-react": "^7.26.3",
|
|
41
|
+
"@babel/preset-typescript": "^7.26.0",
|
|
42
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
43
|
+
"@rollup/plugin-commonjs": "^28.0.2",
|
|
44
|
+
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
45
|
+
"@rollup/plugin-typescript": "^12.1.2",
|
|
46
|
+
"@types/lodash": "^4.17.14",
|
|
47
|
+
"@types/react": "^19.0.0",
|
|
48
|
+
"@types/react-dom": "^19.0.0",
|
|
49
|
+
"lodash": "^4.17.21",
|
|
50
|
+
"rimraf": "^6.0.1",
|
|
51
|
+
"rollup": "^4.30.1",
|
|
52
|
+
"tslib": "^2.6.2",
|
|
53
|
+
"typescript": "^5.7.3"
|
|
54
|
+
}
|
|
55
|
+
}
|