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

[Re-Enginrring] withdraw page #2506

Open
wants to merge 40 commits into
base: update/vendor-dashboard-structure
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
6f87e5c
Adding withdraw page.
Aunshon Nov 28, 2024
36ead68
wi
Aunshon Nov 29, 2024
b9d6396
Balance and payment methods done
Aunshon Dec 3, 2024
03deadd
List page done.
Aunshon Dec 3, 2024
9efd408
List and pagination done.
Aunshon Dec 3, 2024
1eddedb
Merge branch 'refs/heads/develop' into update/vendor-dashboard-struct…
Aunshon Dec 6, 2024
ae579a4
Added slot fill in PaymentDetails.tsx
Aunshon Dec 24, 2024
f177dae
feat: introduce dataviews from dokan free.
MdAsifHossainNadim Dec 31, 2024
eefed6b
feat: introduce dataviews from dokan free.
MdAsifHossainNadim Jan 1, 2025
29c723d
revert: add dokan category comission js.
MdAsifHossainNadim Jan 1, 2025
b423324
update: remove category commission js updates.
MdAsifHossainNadim Jan 1, 2025
5e00deb
remove: revert component package js file.
MdAsifHossainNadim Jan 1, 2025
cb605ad
remove: dokan sidebar class from data view table.
MdAsifHossainNadim Jan 1, 2025
a3852e8
enhance: update dataviews doc.
MdAsifHossainNadim Jan 1, 2025
4915962
update: filter naming convension for dataviews property.
MdAsifHossainNadim Jan 2, 2025
f3d3cc2
remove: module federation node package from json file.
MdAsifHossainNadim Jan 2, 2025
0f89a6b
remove: example dataviews table usage component.
MdAsifHossainNadim Jan 2, 2025
c8bb6e1
remove: example dataviews table usage component.
MdAsifHossainNadim Jan 2, 2025
ec87691
update: button class name for color scheme customizer.
MdAsifHossainNadim Jan 3, 2025
68c108c
update: split webpack entries, use change-case for namespace cases, h…
MdAsifHossainNadim Jan 6, 2025
36d3b9a
Merge branch 'update/vendor-dashboard-structure' into enhance/introdu…
MdAsifHossainNadim Jan 6, 2025
13c5d87
Merge branch 'refs/heads/update/vendor-dashboard-structure' into upda…
Aunshon Jan 7, 2025
34d7e08
Merge remote-tracking branch 'refs/remotes/origin/enhance/introduce-d…
Aunshon Jan 7, 2025
f1dd3df
update: introduce utilities directory, make exporter from dokan free …
MdAsifHossainNadim Jan 7, 2025
b2e4e6c
Merge branch 'refs/heads/enhance/introduce-dataviews-from-dokan-free'…
Aunshon Jan 7, 2025
cca9989
update: routing folder naming convesional stuff.
MdAsifHossainNadim Jan 8, 2025
6d2d608
update: add component and utilities accessor doc for dokan free.
MdAsifHossainNadim Jan 8, 2025
9b5f66a
Integrate wp data view.
Aunshon Jan 8, 2025
a8fb22b
Add router param
Aunshon Jan 14, 2025
c84d06d
Merge branch 'refs/heads/update/vendor-dashboard-structure' into enha…
MdAsifHossainNadim Jan 14, 2025
30232b8
Merge branch 'refs/heads/update/vendor-dashboard-structure' into upda…
Aunshon Jan 14, 2025
d524e67
fix: add file exists check before register components scripts.
MdAsifHossainNadim Jan 14, 2025
d6d63ed
revert: remove default config from webpack entries.
MdAsifHossainNadim Jan 14, 2025
4a33fdd
Add support for template fo dokan status.
Aunshon Jan 14, 2025
d10ebfe
Merge branch 'update/vendor-dashboard-structure' into update/vendor-d…
Aunshon Jan 15, 2025
75f6738
Merge branch 'update/vendor-dashboard-structure' into update/vendor-d…
Aunshon Jan 15, 2025
df7a677
Dokan currency localize data added
Aunshon Jan 15, 2025
c12dd7b
Merge branch 'refs/heads/update/vendor-dashboard-structure' into enha…
MdAsifHossainNadim Jan 15, 2025
485d2f8
Rename directory
Aunshon Jan 15, 2025
20e9b83
Merge branch 'enhance/introduce-dataviews-from-dokan-free' into updat…
Aunshon Jan 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions docs/frontend/components.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Dokan Components

## Overview

`Dokan` provides a set of reusable `components` that can be used across both `Free` and `Pro` versions. This documentation explains how to properly set up and use these `components` in your project.

## Important Dependencies

For both `Dokan Free and Pro` versions, we must register the `dokan-react-components` dependency when using `global` components.

### Implementation Example

```php
// Register scripts with dokan-react-components dependency
$script_assets = 'add_your_script_assets_path_here';

if (file_exists($script_assets)) {
$vendor_asset = require $script_assets;
$version = $vendor_asset['version'] ?? '';

// Add dokan-react-components as a dependency
$component_handle = 'dokan-react-components';
$dependencies = $vendor_asset['dependencies'] ?? [];
$dependencies[] = $component_handle;

// Register Script
wp_register_script(
'handler-name',
'path_to_your_script_file',
$dependencies,
$version,
true
);

// Register Style
wp_register_style(
'handler-name',
'path_to_your_style_file',
[ $component_handle ],
$version
);
}
```

## Component Access

### Pro Version

In `Dokan Pro`, components can be imported directly from `@dokan/components`:

```js
import { DataViews, useWindowDimensions } from '@dokan/components';
```

For external `plugins`, we must include the `dokan-react-components` as scripts dependency and the `@dokan/components` should be introduced as an external resource configuration to resolve the path via `webpack`:

```js
externals: {
'@dokan/components': 'dokan.components',
...
},
```

## Adding Global Components

### File Structure

```
|____ src/
| |___ components/
| | |___ index.tsx # Main export file
| | |___ DataViews/ # Existing component
| | |___ YourComponent/ # Your new component directory
| | | |___ index.tsx
| | | |___ style.scss
| | |
| | |___ Other Files
| |
| |___ Other Files
|
|____ Other Files
```

**Finally,** we need to export the new `component` from the `src/components/index.tsx` file. Then, we can import the new component from `@dokan/components` in `dokan pro` version.

```ts
export { default as DataViews } from './dataviews/DataViewTable';
export { default as ComponentName } from './YourComponent';
```
Loading
Loading