├── .changeset
├── README.md
├── config.json
└── thick-dots-dress.md
├── .editorconfig
├── .eslintrc.cjs
├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
└── workflows
│ ├── chromatic.yml
│ ├── commitlint.yml
│ ├── release.yml
│ └── test.yml
├── .gitignore
├── .husky
├── commit-msg
└── pre-commit
├── .prettierignore
├── .prettierrc
├── .storybook
├── main.ts
├── manager.ts
├── preview.tsx
└── theme.ts
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── SECURITY.md
├── commitlint.config.cjs
├── index.html
├── package.json
├── public
├── _redirects
├── favicon.ico
├── firebase-messaging-sw.js
├── get-started.png
├── grid-3d.jpg
├── grid.jpg
├── landing-frame.jpg
├── landing-frame.png
├── logo-no-background.png
├── me.jpg
├── mocks
│ ├── AuctionCreators.json
│ ├── BiddingTopSellers.json
│ ├── BiddingTransactions.json
│ ├── CampaignAds.json
│ ├── Campaigns.json
│ ├── ChannelUsers.json
│ ├── Clients.json
│ ├── CommunityGroups.json
│ ├── CompanyUsers.json
│ ├── CountryOrders.json
│ ├── Courses.json
│ ├── DeliveryAnalytics.json
│ ├── Employees.json
│ ├── Exams.json
│ ├── Faqs.json
│ ├── License.json
│ ├── LiveAuction.json
│ ├── Notifications.json
│ ├── Pricing.json
│ ├── Projects.json
│ ├── RecentOrders.json
│ ├── RecommendedCourses.json
│ ├── ScheduledPosts.json
│ ├── SessionActivity.json
│ ├── SocialComments.json
│ ├── SocialMedia.json
│ ├── StudyStatistics.json
│ ├── TasksList.json
│ ├── TimelineActivity.json
│ ├── TopCategories.json
│ ├── TopProducts.json
│ ├── TopSeller.json
│ ├── TruckDeliveries.json
│ ├── TruckDeliveryRequest.json
│ └── Trucks.json
├── showcase
│ ├── auth
│ │ ├── login.png
│ │ ├── password-reset.png
│ │ ├── register.png
│ │ └── welcome.png
│ ├── corporate
│ │ ├── pricing.png
│ │ └── team.png
│ ├── dashboard
│ │ ├── bidding.png
│ │ ├── default.png
│ │ ├── ecommerce.png
│ │ ├── learning.png
│ │ ├── logistics.png
│ │ ├── marketing.png
│ │ ├── projects.png
│ │ └── social.png
│ ├── errors
│ │ └── 400.png
│ └── profile
│ │ └── details.png
└── vite.svg
├── src
├── App.css
├── App.tsx
├── assets
│ └── react.svg
├── components
│ ├── BackBtn
│ │ ├── BackBtn.stories.tsx
│ │ └── BackBtn.tsx
│ ├── Card
│ │ ├── Card.stories.tsx
│ │ ├── Card.tsx
│ │ └── styles.css
│ ├── ContactForm
│ │ ├── ContactForm.stories.tsx
│ │ └── ContactForm.tsx
│ ├── Container
│ │ ├── Container.tsx
│ │ └── index.ts
│ ├── EmployeeCard
│ │ ├── EmployeeCard.stories.tsx
│ │ └── EmployeeCard.tsx
│ ├── FaqCollapse
│ │ └── FaqCollapse.tsx
│ ├── Flex
│ │ └── Flex.tsx
│ ├── Loader
│ │ ├── Loader.stories.tsx
│ │ ├── Loader.tsx
│ │ └── styles.css
│ ├── Logo
│ │ ├── Logo.stories.tsx
│ │ ├── Logo.tsx
│ │ └── styles.css
│ ├── MoreMenu
│ │ ├── MoreMenu.stories.tsx
│ │ └── MoreMenu.tsx
│ ├── NotificationsCard
│ │ ├── Notifications.stories.tsx
│ │ ├── NotificationsCard.tsx
│ │ └── styles.css
│ ├── NotificationsItem
│ │ ├── NotificationsItem.stories.tsx
│ │ └── NotificationsItem.tsx
│ ├── Nprogress
│ │ ├── Bar.tsx
│ │ ├── Container.tsx
│ │ ├── Progress.tsx
│ │ ├── Spinner.tsx
│ │ ├── index.ts
│ │ └── spinner.css
│ ├── PageHeader
│ │ ├── PageHeader.stories.tsx
│ │ ├── PageHeader.tsx
│ │ └── styles.css
│ ├── PricingTable
│ │ ├── PricingTable.stories.tsx
│ │ └── PricingTable.tsx
│ ├── RefreshBtn
│ │ ├── RefreshBtn.stories.tsx
│ │ └── RefreshBtn.tsx
│ ├── SitemapCard
│ │ ├── SitemapCard.stories.tsx
│ │ ├── SitemapCard.tsx
│ │ └── styles.css
│ ├── SocialMediaCard
│ │ ├── SocialMediaCard.stories.tsx
│ │ └── SocialMediaCard.tsx
│ ├── TimelineCard
│ │ ├── TimelineCard.stories.tsx
│ │ └── TimelineCard.tsx
│ ├── UserAvatar
│ │ ├── UserAvatar.stories.tsx
│ │ └── UserAvatar.tsx
│ ├── corporate
│ │ └── BlogsListCard
│ │ │ ├── BlogListCard.stories.tsx
│ │ │ ├── BlogsListCard.tsx
│ │ │ └── styles.css
│ ├── dashboard
│ │ ├── bidding
│ │ │ ├── AuctionCarousel
│ │ │ │ ├── AuctionCarousel.stories.tsx
│ │ │ │ ├── AuctionCarousel.tsx
│ │ │ │ └── styles.css
│ │ │ ├── CategoriesCard
│ │ │ │ ├── Categories.stories.tsx
│ │ │ │ ├── CategoriesCard.tsx
│ │ │ │ └── styles.css
│ │ │ ├── CreatorsCard
│ │ │ │ ├── CreatorsCard.stories.tsx
│ │ │ │ ├── CreatorsCard.tsx
│ │ │ │ └── styles.css
│ │ │ ├── TopItemsCard
│ │ │ │ ├── TopItems.stories.tsx
│ │ │ │ └── TopItems.tsx
│ │ │ ├── TransactionsCard
│ │ │ │ ├── TransactionsCard.stories.tsx
│ │ │ │ └── TransactionsCard.tsx
│ │ │ └── index.ts
│ │ ├── default
│ │ │ ├── CampaignsCard
│ │ │ │ ├── CampaignsCard.stories.tsx
│ │ │ │ └── CampaignsCard.tsx
│ │ │ ├── EarningsCard
│ │ │ │ ├── EarningsCard.stories.tsx
│ │ │ │ └── EarningsCard.tsx
│ │ │ ├── GetStartedCard
│ │ │ │ ├── GetStartedCard.stories.tsx
│ │ │ │ └── GetStartedCard.tsx
│ │ │ ├── LatestOrdersCard
│ │ │ │ ├── LatestOrdersCard.stories.tsx
│ │ │ │ └── LatestOrdersCard.tsx
│ │ │ ├── OrdersChart
│ │ │ │ ├── OrdersChart.stories.tsx
│ │ │ │ └── OrdersChart.tsx
│ │ │ ├── RecentUsersCard
│ │ │ │ ├── RecentUsersCard.stories.tsx
│ │ │ │ └── RecentUsersCard.tsx
│ │ │ ├── SubscribersChart
│ │ │ │ ├── SubscribersChart.stories.tsx
│ │ │ │ └── SubscribersChart.tsx
│ │ │ ├── TasksChartCard
│ │ │ │ ├── TasksChart.stories.tsx
│ │ │ │ └── TasksChartCard.tsx
│ │ │ ├── TasksListCard
│ │ │ │ ├── TasksList.stories.tsx
│ │ │ │ ├── TasksListCard.tsx
│ │ │ │ └── styles.css
│ │ │ ├── WeeklyActivityCard
│ │ │ │ ├── WeeklyActivityCard.stories.tsx
│ │ │ │ └── WeeklyActivityCard.tsx
│ │ │ └── index.ts
│ │ ├── ecommerce
│ │ │ ├── CustomerReviewsCard
│ │ │ │ ├── CustomerReviewsCard.stories.tsx
│ │ │ │ └── CustomerReviewsCard.tsx
│ │ │ └── index.ts
│ │ ├── index.ts
│ │ ├── learning
│ │ │ ├── CommunityGroupsCard
│ │ │ │ ├── CommunityGroupCard.tsx
│ │ │ │ ├── CommunityGroupsCard.stories.tsx
│ │ │ │ └── styles.css
│ │ │ ├── CoursesCard
│ │ │ │ ├── CoursesCard.stories.tsx
│ │ │ │ └── CoursesCard.tsx
│ │ │ ├── CoursesCarousel
│ │ │ │ ├── CoursesCaroursel.stories.tsx
│ │ │ │ ├── CoursesCarousel.tsx
│ │ │ │ └── styles.css
│ │ │ ├── ExamsCard
│ │ │ │ ├── ExamsCard.stories.tsx
│ │ │ │ ├── ExamsCard.tsx
│ │ │ │ └── styles.css
│ │ │ ├── ProgressCard
│ │ │ │ ├── ProgressCard.stories.tsx
│ │ │ │ └── ProgressCard.tsx
│ │ │ ├── StatsCard
│ │ │ │ ├── StatsCard.stories.tsx
│ │ │ │ └── StatsCard.tsx
│ │ │ ├── StudyStatisticsCard
│ │ │ │ ├── StudyStatisticsCard.tsx
│ │ │ │ └── StudyStatisticssCard.stories.tsx
│ │ │ └── index.ts
│ │ ├── logistics
│ │ │ ├── DailyPlanCard
│ │ │ │ ├── DailyPlanCard.stories.tsx
│ │ │ │ └── DailyPlanCard.tsx
│ │ │ ├── DeliveryAnalyticsCard
│ │ │ │ ├── DeliveryAnalyticsCard.stories.tsx
│ │ │ │ └── DeliveryAnalyticsCard.tsx
│ │ │ ├── DeliveryRequestCard
│ │ │ │ ├── DeliveryRequestCard.stories.tsx
│ │ │ │ ├── DeliveryRequestCard.tsx
│ │ │ │ └── styles.css
│ │ │ ├── DeliveryTableCard
│ │ │ │ ├── DeliveryTableCard.stories.tsx
│ │ │ │ └── DeliveryTableCard.tsx
│ │ │ ├── StatsCard
│ │ │ │ ├── StatsCard.stories.tsx
│ │ │ │ └── StatsCard.tsx
│ │ │ ├── TrucksListCard
│ │ │ │ ├── TruckListCard.stories.tsx
│ │ │ │ ├── TruckListCard.tsx
│ │ │ │ └── styles.css
│ │ │ └── index.ts
│ │ ├── marketing
│ │ │ ├── AudienceLocationChart
│ │ │ │ ├── AudienceLocationChart.stories.tsx
│ │ │ │ └── AudienceLocationChart.tsx
│ │ │ ├── CampaignsActivity
│ │ │ │ ├── CampaignsActivity.stories.tsx
│ │ │ │ └── CampaignsActivity.tsx
│ │ │ ├── CampaignsAdsCard
│ │ │ │ ├── CampaignAdsCard.stories.tsx
│ │ │ │ └── CampaignsAdsCard.tsx
│ │ │ ├── SocialStatsCard
│ │ │ │ ├── SocialStatsCard.stories.tsx
│ │ │ │ └── SocialStatsCard.tsx
│ │ │ ├── StatsCard
│ │ │ │ ├── StatsCard.stories.tsx
│ │ │ │ └── StatsCard.tsx
│ │ │ ├── VisitorsChartCard
│ │ │ │ ├── VisitorsChartCard.stories.tsx
│ │ │ │ └── VisitorsChartCard.tsx
│ │ │ └── index.ts
│ │ ├── projects
│ │ │ ├── ClientsTable
│ │ │ │ ├── ClientsTable.stories.tsx
│ │ │ │ └── ClientsTable.tsx
│ │ │ ├── ProjectsCountCard
│ │ │ │ ├── ProjectsCountCard.stories.tsx
│ │ │ │ ├── ProjectsCountCard.tsx
│ │ │ │ └── styles.scss
│ │ │ ├── ProjectsTables
│ │ │ │ ├── ProjectsTable.stories.tsx
│ │ │ │ └── ProjectsTable.tsx
│ │ │ └── index.ts
│ │ ├── shared
│ │ │ ├── PostsCard
│ │ │ │ ├── PostsCard.stories.tsx
│ │ │ │ ├── PostsCard.tsx
│ │ │ │ └── styles.css
│ │ │ ├── ProjectsCard
│ │ │ │ ├── ProjectsCard.stories.tsx
│ │ │ │ ├── ProjectsCard.tsx
│ │ │ │ └── styles.css
│ │ │ ├── RevenueCard
│ │ │ │ ├── RevenueCard.stories.tsx
│ │ │ │ └── RevenueCard.tsx
│ │ │ └── index.ts
│ │ └── social
│ │ │ ├── CommentsCard
│ │ │ ├── CommentsCard.stories.tsx
│ │ │ ├── CommentsCard.tsx
│ │ │ └── styles.css
│ │ │ ├── DevicesCardChart
│ │ │ ├── DevicesCardChart.stories.tsx
│ │ │ └── DevicesCardChart.tsx
│ │ │ ├── FollowersChart
│ │ │ ├── FollowersChart.stories.tsx
│ │ │ └── FollowersChart.tsx
│ │ │ ├── LikesChart
│ │ │ ├── LikesChart.stories.tsx
│ │ │ └── LikesChart.tsx
│ │ │ ├── MilestonesCard
│ │ │ ├── MilestonesCard.stories.tsx
│ │ │ ├── MilestonesCard.tsx
│ │ │ └── styles.css
│ │ │ ├── SocialStatsCard
│ │ │ ├── SocialStatsCard.stories.tsx
│ │ │ └── SocialStatsCard.tsx
│ │ │ └── index.ts
│ └── index.ts
├── constants
│ ├── index.ts
│ └── routes.ts
├── context
│ ├── index.ts
│ └── styles.tsx
├── firebase
│ └── firebaseConfig.ts
├── hooks
│ ├── index.ts
│ ├── useFetchData.tsx
│ └── usePageContext.tsx
├── index.css
├── layouts
│ ├── app
│ │ ├── App.tsx
│ │ ├── FooterNav.tsx
│ │ ├── HeaderNav.tsx
│ │ ├── SideNav.tsx
│ │ └── index.ts
│ ├── corporate
│ │ └── index.tsx
│ ├── dashboards
│ │ └── index.tsx
│ ├── guest
│ │ └── Guest.tsx
│ ├── index.ts
│ └── userAccount
│ │ ├── index.tsx
│ │ └── styles.css
├── main.tsx
├── pages
│ ├── About.tsx
│ ├── Home.tsx
│ ├── Sitemap.tsx
│ ├── authentication
│ │ ├── AccountDeactivate.tsx
│ │ ├── PasswordReset.tsx
│ │ ├── SignIn.tsx
│ │ ├── SignUp.tsx
│ │ ├── VerifyEmail.tsx
│ │ ├── Welcome.tsx
│ │ └── index.ts
│ ├── corporate
│ │ ├── About.tsx
│ │ ├── Contact.tsx
│ │ ├── Faqs.tsx
│ │ ├── Licence.tsx
│ │ ├── Pricing.tsx
│ │ ├── Team.tsx
│ │ └── index.ts
│ ├── dashboards
│ │ ├── Bidding.tsx
│ │ ├── Default.tsx
│ │ ├── Ecommerce.tsx
│ │ ├── Learning.tsx
│ │ ├── Logistics.tsx
│ │ ├── Marketing.tsx
│ │ ├── Projects.tsx
│ │ ├── Social.tsx
│ │ └── index.ts
│ ├── errors
│ │ ├── Error.tsx
│ │ ├── Error400.tsx
│ │ ├── Error403.tsx
│ │ ├── Error404.tsx
│ │ ├── Error500.tsx
│ │ ├── Error503.tsx
│ │ └── index.ts
│ ├── index.ts
│ └── userAccount
│ │ ├── Actions.tsx
│ │ ├── Activity.tsx
│ │ ├── Details.tsx
│ │ ├── Feedback.tsx
│ │ ├── Help.tsx
│ │ ├── Information.tsx
│ │ ├── Preferences.tsx
│ │ ├── Security.tsx
│ │ └── index.ts
├── redux
│ ├── store.ts
│ └── theme
│ │ └── themeSlice.ts
├── routes
│ └── routes.tsx
├── stories
│ ├── Configure.mdx
│ └── assets
│ │ ├── accessibility.png
│ │ ├── accessibility.svg
│ │ ├── addon-library.png
│ │ ├── assets.png
│ │ ├── context.png
│ │ ├── discord.svg
│ │ ├── docs.png
│ │ ├── figma-plugin.png
│ │ ├── github.svg
│ │ ├── share.png
│ │ ├── styling.png
│ │ ├── testing.png
│ │ ├── theming.png
│ │ ├── tutorials.svg
│ │ └── youtube.svg
├── types
│ ├── bidding.ts
│ ├── campaigns.ts
│ ├── clients.ts
│ ├── comments.ts
│ ├── dashboard.ts
│ ├── employee.ts
│ ├── faq.ts
│ ├── index.ts
│ ├── learnings.ts
│ ├── logistics.ts
│ ├── notifications.ts
│ ├── posts.ts
│ ├── pricing.ts
│ ├── projects.ts
│ ├── session.ts
│ └── timeline.ts
├── utils
│ └── index.ts
└── vite-env.d.ts
├── tsconfig.json
├── tsconfig.node.json
├── vite.config.ts
└── yarn.lock
/.changeset/README.md:
--------------------------------------------------------------------------------
1 | # Changesets
2 |
3 | Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4 | with multi-package repos, or single-package repos to help you version and publish your code. You can
5 | find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6 |
7 | We have a quick list of common questions to get you started engaging with this project in
8 | [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
9 |
--------------------------------------------------------------------------------
/.changeset/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
3 | "changelog": "@changesets/cli/changelog",
4 | "commit": false,
5 | "fixed": [],
6 | "linked": [],
7 | "access": "restricted",
8 | "baseBranch": "main",
9 | "updateInternalDependencies": "patch",
10 | "ignore": []
11 | }
12 |
--------------------------------------------------------------------------------
/.changeset/thick-dots-dress.md:
--------------------------------------------------------------------------------
1 | ---
2 | "antd-multi-dashboard": patch
3 | ---
4 |
5 | ### Added
6 | - feat(ui): added support for dark mode.
7 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root=true
2 |
3 | [*]
4 | indent_style = space
5 | indent_size = 2
6 | charset = utf-8
7 | trim_trailing_whitespace = false
8 | insert_final_newline = true
9 | end_of_line = lf
10 | tab_width = 2
--------------------------------------------------------------------------------
/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: { browser: true, es2020: true },
4 | extends: [
5 | 'eslint:recommended',
6 | 'plugin:@typescript-eslint/recommended',
7 | 'plugin:react-hooks/recommended',
8 | 'plugin:storybook/recommended',
9 | ],
10 | ignorePatterns: ['dist', '.eslintrc.cjs'],
11 | parser: '@typescript-eslint/parser',
12 | plugins: ['react-refresh'],
13 | rules: {
14 | 'react-refresh/only-export-components': [
15 | 'warn',
16 | { allowConstantExport: true },
17 | ],
18 | },
19 | };
20 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 | ---
8 |
9 | **Describe the bug**
10 | A clear and concise description of what the bug is.
11 |
12 | **To Reproduce**
13 | Steps to reproduce the behavior:
14 |
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Desktop (please complete the following information):**
27 |
28 | - OS: [e.g. iOS]
29 | - Browser [e.g. chrome, safari]
30 | - Version [e.g. 22]
31 |
32 | **Smartphone (please complete the following information):**
33 |
34 | - Device: [e.g. iPhone6]
35 | - OS: [e.g. iOS8.1]
36 | - Browser [e.g. stock browser, safari]
37 | - Version [e.g. 22]
38 |
39 | **Additional context**
40 | Add any other context about the problem here.
41 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 | ---
8 |
9 | **Is your feature request related to a problem? Please describe.**
10 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
11 |
12 | **Describe the solution you'd like**
13 | A clear and concise description of what you want to happen.
14 |
15 | **Describe alternatives you've considered**
16 | A clear and concise description of any alternative solutions or features you've considered.
17 |
18 | **Additional context**
19 | Add any other context or screenshots about the feature request here.
20 |
--------------------------------------------------------------------------------
/.github/workflows/chromatic.yml:
--------------------------------------------------------------------------------
1 | # Workflow name
2 | name: 'Chromatic Deployment'
3 |
4 | # Event for the workflow
5 | on:
6 | push:
7 | branches: [main]
8 | pull_request:
9 | branches: [main]
10 |
11 | # List of jobs
12 | jobs:
13 | chromatic-deployment:
14 | # Operating System
15 | runs-on: ubuntu-latest
16 | # Job steps
17 | steps:
18 | - uses: actions/checkout@v1
19 | - run: yarn
20 | #👇 Adds Chromatic as a step in the workflow
21 | - name: Publish to Chromatic
22 | uses: chromaui/action@v1
23 | # Options required for Chromatic's GitHub Action
24 | with:
25 | #👇 Chromatic projectToken, see https://storybook.js.org/tutorials/intro-to-storybook/react/en/deploy/ to obtain it
26 | projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
27 |
--------------------------------------------------------------------------------
/.github/workflows/commitlint.yml:
--------------------------------------------------------------------------------
1 | name: Lint Commit Messages
2 | on: [pull_request, push]
3 |
4 | jobs:
5 | commitlint:
6 | runs-on: ubuntu-latest
7 | steps:
8 | - uses: actions/checkout@v2
9 | with:
10 | fetch-depth: 0
11 | - uses: wagoid/commitlint-github-action@v4
12 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: 'Changeset Release'
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 |
8 | concurrency: ${{ github.workflow }}-${{ github.ref }}
9 |
10 | jobs:
11 | release:
12 | name: Release
13 | runs-on: ubuntu-latest
14 | steps:
15 | - name: Checkout Repo
16 | uses: actions/checkout@v3
17 |
18 | - name: Setup Node.js 18
19 | uses: actions/setup-node@v3
20 | with:
21 | node-version: 18
22 |
23 | - name: Install Dependencies
24 | run: yarn
25 |
26 | - name: Create Release Pull Request
27 | uses: changesets/action@v1
28 | env:
29 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30 |
--------------------------------------------------------------------------------
/.github/workflows/test.yml:
--------------------------------------------------------------------------------
1 | # This workflow will do a clean install of dependencies, optionally build, and run tests
2 | # across different versions of node.
3 | name: Test
4 | on:
5 | push:
6 | branches:
7 | - '**' # make it run on any branch
8 | - '!main' # but exclude the 'main' and 'master' branches
9 | - '!master'
10 | pull_request:
11 | branches:
12 | - '**'
13 | - '!main'
14 | - '!master'
15 | jobs:
16 | build:
17 | runs-on: ubuntu-latest
18 | strategy:
19 | matrix:
20 | node-version:
21 | - '16.x'
22 | - '18.x' # whichever node versions you support
23 | steps:
24 | - uses: actions/checkout@v3
25 |
26 | - name: Use Node.js ${{ matrix.node-version }}
27 | uses: actions/setup-node@v3
28 | with:
29 | node-version: ${{ matrix.node-version }}
30 |
31 | - name: Clean install dependencies
32 | run: yarn install --frozen-lockfile
33 |
34 | - name: Build application
35 | run: yarn run build
36 |
37 | - name: Test
38 | run: yarn test
39 |
--------------------------------------------------------------------------------
/.husky/commit-msg:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 | . "$(dirname -- "$0")/_/husky.sh"
3 |
4 | pnpm exec commitlint --edit $1
5 |
--------------------------------------------------------------------------------
/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 | . "$(dirname -- "$0")/_/husky.sh"
3 |
4 | npx lint-staged
5 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | # Ignore artifacts:
2 | build
3 | coverage
4 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "semi": true,
3 | "trailingComma": "es5",
4 | "singleQuote": true
5 | }
6 |
--------------------------------------------------------------------------------
/.storybook/main.ts:
--------------------------------------------------------------------------------
1 | import type { StorybookConfig } from '@storybook/react-vite';
2 |
3 | const config: StorybookConfig = {
4 | stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
5 | addons: [
6 | '@storybook/addon-links',
7 | '@storybook/addon-essentials',
8 | '@storybook/addon-onboarding',
9 | '@storybook/addon-interactions',
10 | 'storybook-addon-react-router-v6',
11 | ],
12 | framework: {
13 | name: '@storybook/react-vite',
14 | options: {},
15 | },
16 | docs: {
17 | autodocs: 'tag',
18 | },
19 | };
20 | export default config;
21 |
--------------------------------------------------------------------------------
/.storybook/manager.ts:
--------------------------------------------------------------------------------
1 | // .storybook/manager.js
2 |
3 | import { addons } from '@storybook/manager-api';
4 | import yourTheme from './theme';
5 |
6 | addons.setConfig({
7 | theme: yourTheme,
8 | });
9 |
--------------------------------------------------------------------------------
/.storybook/preview.tsx:
--------------------------------------------------------------------------------
1 | import type { Preview } from '@storybook/react';
2 | import { themes } from '@storybook/theming';
3 | import { StylesContext } from '../src/context';
4 | import '../src/App.css';
5 |
6 | export const withStylesProvider = (Story: any) => {
7 | return (
8 |
9 | {/* 👇 Decorators in Storybook also accept a function. Replace with Story() to enable it */}
10 |
11 |
12 | );
13 | };
14 |
15 | const preview: Preview = {
16 | parameters: {
17 | actions: { argTypesRegex: '^on[A-Z].*' },
18 | controls: {
19 | matchers: {
20 | color: /(background|color)$/i,
21 | date: /Date$/i,
22 | },
23 | },
24 | docs: {
25 | theme: themes.normal,
26 | },
27 | decorators: [],
28 | },
29 | };
30 |
31 | export default preview;
32 |
--------------------------------------------------------------------------------
/.storybook/theme.ts:
--------------------------------------------------------------------------------
1 | // .storybook/YourTheme.js
2 |
3 | import { create } from '@storybook/theming/create';
4 |
5 | export default create({
6 | base: 'light',
7 | brandTitle: 'Antd Dashboard',
8 | brandUrl: 'https://antd-multipurpose-dashboard.netlify.app/',
9 | brandTarget: '_blank',
10 |
11 | //
12 | colorPrimary: '#2378c3',
13 | });
14 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 Kelvin Kiprop
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Security Policy
2 |
3 | ## Supported Versions
4 |
5 | Use this section to tell people about which versions of your project are
6 | currently being supported with security updates.
7 |
8 | | Version | Supported |
9 | | ------- | ------------------ |
10 | | 5.1.x | :white_check_mark: |
11 | | 5.0.x | :x: |
12 | | 4.0.x | :white_check_mark: |
13 | | < 4.0 | :x: |
14 |
15 | ## Reporting a Vulnerability
16 |
17 | Use this section to tell people how to report a vulnerability.
18 |
19 | Tell them where to go, how often they can expect to get an update on a
20 | reported vulnerability, what to expect if the vulnerability is accepted or
21 | declined, etc.
22 |
--------------------------------------------------------------------------------
/commitlint.config.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | extends: ['@commitlint/config-conventional'],
3 | };
4 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Multi dashboard template with React and Ant Design v5 - AntD Dashboard by
9 | Design Sparx
10 |
11 |
15 |
19 |
20 |
21 |
25 |
29 |
30 |
34 |
35 |
36 |
37 |
38 |
39 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/public/_redirects:
--------------------------------------------------------------------------------
1 | /* /index.html 200
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/public/favicon.ico
--------------------------------------------------------------------------------
/public/firebase-messaging-sw.js:
--------------------------------------------------------------------------------
1 | // Scripts for firebase and firebase messaging
2 | importScripts('https://www.gstatic.com/firebasejs/8.10.0/firebase-app.js');
3 | importScripts(
4 | 'https://www.gstatic.com/firebasejs/8.10.0/firebase-messaging.js'
5 | );
6 |
7 | const {
8 | VITE_APP_API_KEY,
9 | VITE_APP_AUTH_DOMAIN,
10 | VITE_APP_PROJECT_ID,
11 | VITE_APP_STORAGE_BUCKET,
12 | VITE_APP_MESSENGER_SENDER_ID,
13 | VITE_APP_APP_ID,
14 | VITE_APP_MEASUREMENT_ID,
15 | } = import.meta.env;
16 |
17 | // Initialize the Firebase app in the service worker
18 | // "Default" Firebase configuration (prevents errors)
19 | const firebaseConfig = {
20 | apiKey: VITE_APP_API_KEY,
21 | authDomain: VITE_APP_AUTH_DOMAIN,
22 | projectId: VITE_APP_PROJECT_ID,
23 | storageBucket: VITE_APP_STORAGE_BUCKET,
24 | messagingSenderId: VITE_APP_MESSENGER_SENDER_ID,
25 | appId: VITE_APP_APP_ID,
26 | measurementId: VITE_APP_MEASUREMENT_ID,
27 | };
28 |
29 | firebase.initializeApp(firebaseConfig);
30 |
31 | // Retrieve firebase messaging
32 | const messaging = firebase.messaging();
33 |
34 | messaging.onBackgroundMessage((payload) => {
35 | const notificationTitle = payload.notification.title;
36 | const notificationOptions = {
37 | body: payload.notification.body,
38 | icon: payload.notification.image,
39 | };
40 |
41 | self.registration.showNotification(notificationTitle, notificationOptions);
42 | });
43 |
--------------------------------------------------------------------------------
/public/get-started.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/public/get-started.png
--------------------------------------------------------------------------------
/public/grid-3d.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/public/grid-3d.jpg
--------------------------------------------------------------------------------
/public/grid.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/public/grid.jpg
--------------------------------------------------------------------------------
/public/landing-frame.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/public/landing-frame.jpg
--------------------------------------------------------------------------------
/public/landing-frame.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/public/landing-frame.png
--------------------------------------------------------------------------------
/public/logo-no-background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/public/logo-no-background.png
--------------------------------------------------------------------------------
/public/me.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/public/me.jpg
--------------------------------------------------------------------------------
/public/mocks/CompanyUsers.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "id": "b0f2aedf-1b50-43f0-8483-4be8081ac8fe",
4 | "company": "Thoughtmix",
5 | "users": 3882,
6 | "percentage": 76
7 | },
8 | {
9 | "id": "78608897-fd0c-468f-839a-8ecf1c41738f",
10 | "company": "Realcube",
11 | "users": 5794,
12 | "percentage": 1
13 | },
14 | {
15 | "id": "c3cb9000-bd85-432e-953d-eeae66824ff6",
16 | "company": "Eamia",
17 | "users": 9308,
18 | "percentage": 74
19 | },
20 | {
21 | "id": "35233364-55f8-44fc-a814-d21f653858e3",
22 | "company": "Talane",
23 | "users": 6889,
24 | "percentage": 75
25 | },
26 | {
27 | "id": "0d4d8e60-0a4a-4581-93ed-8b3de4e4e5b5",
28 | "company": "Browseblab",
29 | "users": 5832,
30 | "percentage": 74
31 | }
32 | ]
33 |
--------------------------------------------------------------------------------
/public/mocks/License.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "title": "free",
4 | "description": "The Free Plan grants the user a non-exclusive, non-transferable license to use the dashboard template for personal or non-commercial purposes. Users are allowed to modify the template to suit their needs. However, this license does not permit the user to sublicense, sell, or distribute the template or any derivative works. The Free Plan also includes basic support via email. The license is valid as long as the user adheres to the terms of service."
5 | },
6 | {
7 | "title": "pro",
8 | "description": "The Pro Plan includes a non-exclusive, non-transferable license that allows the user to use the dashboard template for commercial purposes. Users can modify, customize, and create derivative works based on the template. The license permits the user to sublicense the template to clients or end-users. It also includes priority email support and grants access to premium features such as data export/import and the premium templates library. The license is valid for the subscribed period (monthly or annually) and automatically renews unless canceled."
9 | },
10 | {
11 | "title": "enterprise",
12 | "description": "The Enterprise Plan provides a comprehensive, non-exclusive, non-transferable license for large-scale commercial use. This license grants the user unlimited flexibility to modify, customize, and create derivative works from the dashboard template. Users can sublicense the template, access premium support with a dedicated account manager, and utilize advanced features like API access and integration support. The license includes 24/7 priority support and ensures the highest level of data security and compliance. The license is valid for the subscribed period (monthly or annually) and automatically renews unless canceled."
13 | }
14 | ]
15 |
--------------------------------------------------------------------------------
/public/mocks/Pricing.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "plan": "free",
4 | "monthly": 0,
5 | "annually": 0,
6 | "savings_caption": "Save 0%",
7 | "features": [
8 | "Basic Dashboard Templates",
9 | "Limited Widgets and Customization Options",
10 | "Email Support"
11 | ],
12 | "color": "purple"
13 | },
14 | {
15 | "plan": "pro",
16 | "monthly": 9.99,
17 | "annually": 99.99,
18 | "savings_caption": "Save 17%",
19 | "features": [
20 | "Advanced Dashboard Templates",
21 | "Rich Widgets and Customization Options",
22 | "Priority Email Support",
23 | "Data Export and Import",
24 | "Access to Premium Templates Library"
25 | ],
26 | "color": "maroon",
27 | "preferred": true
28 | },
29 | {
30 | "plan": "enterprise",
31 | "monthly": 29.99,
32 | "annually": 299.99,
33 | "savings_caption": "Save 17%",
34 | "features": [
35 | "Enterprise-grade Dashboard Templates",
36 | "Unlimited Widgets and Customization Options",
37 | "24/7 Priority Support",
38 | "Dedicated Account Manager",
39 | "Advanced Data Security and Compliance",
40 | "API Access and Integration Support"
41 | ],
42 | "color": "cyan"
43 | }
44 | ]
45 |
--------------------------------------------------------------------------------
/public/mocks/SocialMedia.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "id": "b1f76a05-31fb-4a57-8a21-068a3d991f07",
4 | "followers": 11374,
5 | "following": 53756,
6 | "posts": 98954,
7 | "likes": 98992,
8 | "comments": 41318,
9 | "engagement_rate": 3413.93,
10 | "title": "facebook"
11 | },
12 | {
13 | "id": "72a2e948-e2e1-45e4-a628-c437c821b9d1",
14 | "followers": 45020,
15 | "following": 79850,
16 | "posts": 90705,
17 | "likes": 40821,
18 | "comments": 14429,
19 | "engagement_rate": 7672.22,
20 | "title": "twitter"
21 | },
22 | {
23 | "id": "f81fec68-7563-49f0-91e8-fb6d6abcb55a",
24 | "followers": 63178,
25 | "following": 17828,
26 | "posts": 10536,
27 | "likes": 6096,
28 | "comments": 43156,
29 | "engagement_rate": 4048.96,
30 | "title": "instagram"
31 | },
32 | {
33 | "id": "81a2f401-532c-40d4-aea0-bcd8785b9565",
34 | "followers": 39246,
35 | "following": 81326,
36 | "posts": 76684,
37 | "likes": 42046,
38 | "comments": 89698,
39 | "engagement_rate": 3957.44,
40 | "title": "linkedin"
41 | },
42 | {
43 | "id": "90c309ee-bb8e-480e-a62e-4dd266d720b4",
44 | "followers": 40597,
45 | "following": 83724,
46 | "posts": 67809,
47 | "likes": 40509,
48 | "comments": 93344,
49 | "engagement_rate": 9625.38,
50 | "title": "youtube"
51 | }
52 | ]
53 |
--------------------------------------------------------------------------------
/public/showcase/auth/login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/public/showcase/auth/login.png
--------------------------------------------------------------------------------
/public/showcase/auth/password-reset.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/public/showcase/auth/password-reset.png
--------------------------------------------------------------------------------
/public/showcase/auth/register.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/public/showcase/auth/register.png
--------------------------------------------------------------------------------
/public/showcase/auth/welcome.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/public/showcase/auth/welcome.png
--------------------------------------------------------------------------------
/public/showcase/corporate/pricing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/public/showcase/corporate/pricing.png
--------------------------------------------------------------------------------
/public/showcase/corporate/team.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/public/showcase/corporate/team.png
--------------------------------------------------------------------------------
/public/showcase/dashboard/bidding.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/public/showcase/dashboard/bidding.png
--------------------------------------------------------------------------------
/public/showcase/dashboard/default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/public/showcase/dashboard/default.png
--------------------------------------------------------------------------------
/public/showcase/dashboard/ecommerce.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/public/showcase/dashboard/ecommerce.png
--------------------------------------------------------------------------------
/public/showcase/dashboard/learning.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/public/showcase/dashboard/learning.png
--------------------------------------------------------------------------------
/public/showcase/dashboard/logistics.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/public/showcase/dashboard/logistics.png
--------------------------------------------------------------------------------
/public/showcase/dashboard/marketing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/public/showcase/dashboard/marketing.png
--------------------------------------------------------------------------------
/public/showcase/dashboard/projects.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/public/showcase/dashboard/projects.png
--------------------------------------------------------------------------------
/public/showcase/dashboard/social.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/public/showcase/dashboard/social.png
--------------------------------------------------------------------------------
/public/showcase/errors/400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/public/showcase/errors/400.png
--------------------------------------------------------------------------------
/public/showcase/profile/details.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/public/showcase/profile/details.png
--------------------------------------------------------------------------------
/public/vite.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/components/BackBtn/BackBtn.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import { withRouter } from 'storybook-addon-react-router-v6';
3 |
4 | import { BackBtn } from './BackBtn.tsx';
5 |
6 | // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
7 | const meta = {
8 | title: 'Components/Back button',
9 | component: BackBtn,
10 | parameters: {
11 | // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
12 | layout: 'centered',
13 | },
14 | // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
15 | tags: ['autodocs'],
16 | // More on argTypes: https://storybook.js.org/docs/react/api/argtypes
17 | decorators: [withRouter],
18 | } satisfies Meta;
19 |
20 | export default meta;
21 | type Story = StoryObj;
22 |
23 | // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
24 | export const Default: Story = {
25 | args: {
26 | type: 'default',
27 | },
28 | };
29 |
30 | export const WithIcon: Story = {
31 | args: {
32 | wIcon: true,
33 | },
34 | };
35 |
36 | export const IconOnly: Story = {
37 | args: {
38 | iconOnly: true,
39 | },
40 | };
41 |
--------------------------------------------------------------------------------
/src/components/BackBtn/BackBtn.tsx:
--------------------------------------------------------------------------------
1 | import { useNavigate } from 'react-router-dom';
2 | import { Button, ButtonProps, Tooltip } from 'antd';
3 | import { LeftOutlined } from '@ant-design/icons';
4 |
5 | type Props = {
6 | wIcon?: boolean;
7 | iconOnly?: boolean;
8 | } & ButtonProps;
9 |
10 | export const BackBtn = ({ wIcon, iconOnly, ...others }: Props) => {
11 | const navigate = useNavigate();
12 |
13 | return (
14 |
15 | : null}
17 | onClick={() => navigate(-1)}
18 | {...others}
19 | >
20 | {!iconOnly && 'Go back'}
21 |
22 |
23 | );
24 | };
25 |
--------------------------------------------------------------------------------
/src/components/Card/Card.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { Card } from './Card';
4 |
5 | // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
6 | const meta = {
7 | title: 'Components/Card',
8 | component: Card,
9 | parameters: {
10 | // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
11 | layout: 'centered',
12 | },
13 | // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
14 | tags: ['autodocs'],
15 | // More on argTypes: https://storybook.js.org/docs/react/api/argtypes
16 | } satisfies Meta;
17 |
18 | export default meta;
19 | type Story = StoryObj;
20 |
21 | // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
22 | export const Default: Story = {
23 | args: {
24 | children: 'This is a card',
25 | },
26 | };
27 |
--------------------------------------------------------------------------------
/src/components/Card/Card.tsx:
--------------------------------------------------------------------------------
1 | import { Card as AntdCard, CardProps } from 'antd';
2 | import { ReactNode } from 'react';
3 |
4 | import './styles.css';
5 |
6 | type Props = { children: ReactNode } & CardProps;
7 |
8 | export const Card = ({ children, ...others }: Props) => {
9 | return (
10 |
11 | {children}
12 |
13 | );
14 | };
15 |
--------------------------------------------------------------------------------
/src/components/Card/styles.css:
--------------------------------------------------------------------------------
1 | /* Glassmorphism card effect */
2 | .card {
3 | /*backdrop-filter: blur(16px) saturate(180%);*/
4 | /*-webkit-backdrop-filter: blur(16px) saturate(180%);*/
5 | /* background-color: rgba(255, 255, 255, 1); */
6 | /*border: 1px solid rgba(209, 213, 219, 0.3);*/
7 | -webkit-box-shadow: rgba(140, 152, 164, 0.075) 0 6px 12px 0;
8 | -moz-box-shadow: rgba(140, 152, 164, 0.075) 0 6px 12px 0;
9 | box-shadow: rgba(140, 152, 164, 0.075) 0 6px 12px 0;
10 | border: 1px solid rgba(231, 234, 243, 0.7);
11 | }
12 |
13 | .card .ant-card-head-title {
14 | text-transform: capitalize;
15 | }
16 |
--------------------------------------------------------------------------------
/src/components/ContactForm/ContactForm.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { ContactForm } from './ContactForm.tsx';
4 |
5 | // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
6 | const meta = {
7 | title: 'Components/Contact form',
8 | component: ContactForm,
9 | parameters: {
10 | // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
11 | layout: 'centered',
12 | },
13 | // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
14 | // tags: ['autodocs'],
15 | // More on argTypes: https://storybook.js.org/docs/react/api/argtypes
16 | } satisfies Meta;
17 |
18 | export default meta;
19 | type Story = StoryObj;
20 |
21 | // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
22 | export const Default: Story = {
23 | args: {},
24 | };
25 |
--------------------------------------------------------------------------------
/src/components/ContactForm/ContactForm.tsx:
--------------------------------------------------------------------------------
1 | import { Button, Col, Form, FormProps, Input, Row } from 'antd';
2 | import { SendOutlined } from '@ant-design/icons';
3 | import { useStylesContext } from '../../context';
4 |
5 | const { TextArea } = Input;
6 |
7 | type Props = FormProps;
8 |
9 | export const ContactForm = ({ ...others }: Props) => {
10 | const stylesContext = useStylesContext();
11 |
12 | return (
13 |
14 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | }>
35 | Submit
36 |
37 |
38 |
39 |
40 | );
41 | };
42 |
--------------------------------------------------------------------------------
/src/components/Container/Container.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | CSSProperties,
3 | HTMLProps,
4 | ReactNode,
5 | useEffect,
6 | useState,
7 | } from 'react';
8 | import { useMediaQuery } from 'react-responsive';
9 |
10 | type ContainerProps = {
11 | children: ReactNode;
12 | style?: CSSProperties;
13 | } & HTMLProps;
14 |
15 | export const Container = ({ children, style, ...others }: ContainerProps) => {
16 | const [containerWidth, setContainerWidth] = useState();
17 | const isMedium = useMediaQuery({ minWidth: 769 }),
18 | isLarge = useMediaQuery({ minWidth: 992 }),
19 | isXLarge = useMediaQuery({ minWidth: 1200 }),
20 | isXXLarge = useMediaQuery({ minWidth: 1400 });
21 |
22 | useEffect(() => {
23 | // sort from large to small devices
24 | if (isXXLarge) {
25 | setContainerWidth('1320px');
26 | } else if (isXLarge) {
27 | setContainerWidth('1140px');
28 | } else if (isLarge) {
29 | setContainerWidth('960px');
30 | } else if (isMedium) {
31 | setContainerWidth('720px');
32 | } else {
33 | setContainerWidth('100%');
34 | }
35 | }, [isLarge, isXLarge, isXXLarge, isMedium]);
36 |
37 | return (
38 |
46 | {children}
47 |
48 | );
49 | };
50 |
--------------------------------------------------------------------------------
/src/components/Container/index.ts:
--------------------------------------------------------------------------------
1 | export { Container } from './Container.tsx';
2 |
--------------------------------------------------------------------------------
/src/components/EmployeeCard/EmployeeCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { EmployeeCard } from './EmployeeCard.tsx';
4 |
5 | const DATA = {
6 | employee_id: '24e4e64c-bf09-459f-8cea-f9d2de99d15b',
7 | title: 'Mrs',
8 | first_name: 'Eugen',
9 | middle_name: 'Pål',
10 | last_name: 'Tiltman',
11 | avatar:
12 | 'https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8Mnx8dXNlcnxlbnwwfHwwfHx8MA%3D%3D&auto=format&fit=crop&w=400&q=60',
13 | role: 'Operator',
14 | age: 28,
15 | email: 'etiltman0@dailymail.co.uk',
16 | country: 'Indonesia',
17 | favorite_color: 'gray',
18 | hire_date: '4/9/2017',
19 | salary: 92877.67,
20 | };
21 |
22 | const meta = {
23 | title: 'Components/Employee',
24 | component: EmployeeCard,
25 | parameters: {
26 | layout: 'centered',
27 | },
28 | tags: ['autodocs'],
29 | } satisfies Meta;
30 |
31 | export default meta;
32 |
33 | type Story = StoryObj;
34 |
35 | export const Default: Story = {
36 | args: {
37 | data: DATA,
38 | style: { width: 400 },
39 | },
40 | };
41 |
42 | export const Expanded: Story = {
43 | args: {
44 | data: DATA,
45 | showInfo: true,
46 | style: { width: 400 },
47 | },
48 | };
49 |
--------------------------------------------------------------------------------
/src/components/EmployeeCard/EmployeeCard.tsx:
--------------------------------------------------------------------------------
1 | import { Employee } from '../../types';
2 | import { Card as AntdCard, CardProps, Flex, Typography } from 'antd';
3 |
4 | const { Meta } = AntdCard;
5 |
6 | type Props = {
7 | data: Employee;
8 | showInfo?: boolean;
9 | } & CardProps;
10 |
11 | export const EmployeeCard = ({ data, showInfo, ...others }: Props) => {
12 | const {
13 | avatar,
14 | first_name,
15 | middle_name,
16 | last_name,
17 | role,
18 | age,
19 | country,
20 | title,
21 | email,
22 | hire_date,
23 | } = data;
24 |
25 | return (
26 |
35 | }
36 | {...others}
37 | >
38 |
39 |
40 | {role}
41 | {showInfo && (
42 | <>
43 | Email: {email}
44 | Country: {country}
45 | Age: {age}
46 | Join date: {hire_date}
47 | >
48 | )}
49 |
50 |
51 | );
52 | };
53 |
--------------------------------------------------------------------------------
/src/components/FaqCollapse/FaqCollapse.tsx:
--------------------------------------------------------------------------------
1 | import { Collapse, CollapseProps } from 'antd';
2 |
3 | type Props = CollapseProps;
4 |
5 | export const FaqCollapse = ({ ...others }: Props) => {
6 | return ;
7 | };
8 |
--------------------------------------------------------------------------------
/src/components/Flex/Flex.tsx:
--------------------------------------------------------------------------------
1 | import { CSSProperties, ReactNode } from 'react';
2 |
3 | type Props = {
4 | gap?: 'small' | 'middle' | 'large' | number;
5 | justifyContent?: CSSProperties['justifyContent'];
6 | alignItems?: CSSProperties['alignItems'];
7 | flexDirection?: CSSProperties['flexDirection'];
8 | children: ReactNode;
9 | } & CSSProperties;
10 |
11 | export const Flex = ({
12 | flexDirection,
13 | alignItems,
14 | gap,
15 | justifyContent,
16 | children,
17 | ...others
18 | }: Props) => {
19 | return (
20 |
38 | {children}
39 |
40 | );
41 | };
42 |
--------------------------------------------------------------------------------
/src/components/Loader/Loader.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { Loader } from './Loader.tsx';
4 |
5 | const meta = {
6 | title: 'Components/Loader',
7 | component: Loader,
8 | parameters: {
9 | layout: 'centered',
10 | },
11 | } satisfies Meta;
12 |
13 | export default meta;
14 |
15 | type Story = StoryObj;
16 |
17 | export const Default: Story = {
18 | args: {},
19 | };
20 |
--------------------------------------------------------------------------------
/src/components/Loader/Loader.tsx:
--------------------------------------------------------------------------------
1 | import { Spin, theme } from 'antd';
2 |
3 | import './styles.css';
4 |
5 | export const Loader = () => {
6 | const {
7 | token: { borderRadius },
8 | } = theme.useToken();
9 |
10 | return (
11 |
16 | );
17 | };
18 |
--------------------------------------------------------------------------------
/src/components/Loader/styles.css:
--------------------------------------------------------------------------------
1 | .loader-container {
2 | text-align: center;
3 | background: rgba(0, 0, 0, 0.05);
4 | }
5 |
6 | .content {
7 | padding: 50px;
8 | }
9 |
--------------------------------------------------------------------------------
/src/components/Logo/Logo.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import { withRouter } from 'storybook-addon-react-router-v6';
3 |
4 | import { Logo } from './Logo.tsx';
5 |
6 | const meta = {
7 | title: 'Components/Logo',
8 | component: Logo,
9 | parameters: {
10 | layout: 'centered',
11 | },
12 | tags: ['autodocs'],
13 | decorators: [withRouter],
14 | } satisfies Meta;
15 |
16 | export default meta;
17 |
18 | type Story = StoryObj;
19 |
20 | export const Black: Story = {
21 | args: {
22 | color: 'black',
23 | },
24 | };
25 |
26 | export const White: Story = {
27 | args: {
28 | color: 'white',
29 | bgColor: 'black',
30 | },
31 | };
32 |
33 | export const AsLink: Story = {
34 | args: {
35 | color: 'black',
36 | asLink: true,
37 | },
38 | };
39 |
40 | export const CustomImageHeight: Story = {
41 | args: {
42 | color: 'black',
43 | imgSize: {
44 | h: 36,
45 | },
46 | },
47 | };
48 |
--------------------------------------------------------------------------------
/src/components/Logo/Logo.tsx:
--------------------------------------------------------------------------------
1 | import { Flex, FlexProps, theme, Typography } from 'antd';
2 | import { Link } from 'react-router-dom';
3 | import { CSSProperties } from 'react';
4 |
5 | import './styles.css';
6 |
7 | type LogoProps = {
8 | color: CSSProperties['color'];
9 | imgSize?: {
10 | h?: number | string;
11 | w?: number | string;
12 | };
13 | asLink?: boolean;
14 | href?: string;
15 | bgColor?: CSSProperties['backgroundColor'];
16 | } & Partial;
17 |
18 | export const Logo = ({
19 | asLink,
20 | color,
21 | href,
22 | imgSize,
23 | bgColor,
24 | ...others
25 | }: LogoProps) => {
26 | const {
27 | token: { borderRadius },
28 | } = theme.useToken();
29 |
30 | return asLink ? (
31 |
32 |
33 |
38 |
49 | Antd Admin
50 |
51 |
52 |
53 | ) : (
54 |
55 |
60 |
71 | Antd Admin
72 |
73 |
74 | );
75 | };
76 |
--------------------------------------------------------------------------------
/src/components/Logo/styles.css:
--------------------------------------------------------------------------------
1 | .logo-link {
2 | text-decoration: none;
3 | }
4 |
5 | .logo-link:hover,
6 | .logo-link:focus {
7 | text-decoration: underline;
8 | }
9 |
--------------------------------------------------------------------------------
/src/components/MoreMenu/MoreMenu.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { MoreMenu } from './MoreMenu.tsx';
4 |
5 | const meta = {
6 | title: 'Components/More menu',
7 | component: MoreMenu,
8 | parameters: {
9 | layout: 'centered',
10 | },
11 | } satisfies Meta;
12 |
13 | export default meta;
14 |
15 | type Story = StoryObj;
16 |
17 | export const Default: Story = {
18 | args: {},
19 | };
20 |
--------------------------------------------------------------------------------
/src/components/MoreMenu/MoreMenu.tsx:
--------------------------------------------------------------------------------
1 | import { Button, Dropdown, MenuProps } from 'antd';
2 | import {
3 | DeleteOutlined,
4 | ExpandOutlined,
5 | MinusOutlined,
6 | MoreOutlined,
7 | SyncOutlined,
8 | } from '@ant-design/icons';
9 |
10 | const items: MenuProps['items'] = [
11 | {
12 | label: 'Expand',
13 | key: '1',
14 | icon: ,
15 | },
16 | {
17 | label: 'Minimize',
18 | key: '2',
19 | icon: ,
20 | },
21 | {
22 | label: 'Reload',
23 | key: '3',
24 | icon: ,
25 | },
26 | {
27 | label: 'Remove',
28 | key: '4',
29 | icon: ,
30 | danger: true,
31 | },
32 | ];
33 |
34 | export const MoreMenu = () => {
35 | return (
36 |
37 |
38 | More
39 |
40 |
41 | );
42 | };
43 |
--------------------------------------------------------------------------------
/src/components/NotificationsCard/Notifications.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import NotificationsData from '../../../public/mocks/Notifications.json';
3 |
4 | import { NotificationsCard } from './NotificationsCard.tsx';
5 |
6 | const meta = {
7 | title: 'Components/Notifications/List',
8 | component: NotificationsCard,
9 | parameters: {
10 | layout: 'centered',
11 | },
12 | } satisfies Meta;
13 |
14 | export default meta;
15 |
16 | type Story = StoryObj;
17 |
18 | export const Default: Story = {
19 | args: {
20 | data: NotificationsData.slice(0, 10),
21 | style: { width: 500 },
22 | },
23 | };
24 |
25 | export const Loading: Story = {
26 | args: {
27 | loading: true,
28 | style: { width: 500 },
29 | },
30 | };
31 |
32 | export const Error: Story = {
33 | args: {
34 | error: 'Error fetching items',
35 | style: { width: 500 },
36 | },
37 | };
38 |
39 | export const Empty: Story = {
40 | args: {
41 | data: [],
42 | style: { width: 500 },
43 | },
44 | };
45 |
--------------------------------------------------------------------------------
/src/components/NotificationsCard/NotificationsCard.tsx:
--------------------------------------------------------------------------------
1 | import { Alert, Button, CardProps, List } from 'antd';
2 | import { Card, Loader, NotificationsItem } from '../index.ts';
3 | import { Notifications } from '../../types';
4 |
5 | import './styles.css';
6 |
7 | type Props = {
8 | data?: Notifications[];
9 | loading?: boolean;
10 | error?: any;
11 | } & CardProps;
12 |
13 | export const NotificationsCard = ({
14 | data,
15 | loading,
16 | error,
17 | ...others
18 | }: Props) => {
19 | return (
20 | View all}
23 | className="card notifications-list-card"
24 | {...others}
25 | >
26 | {error ? (
27 |
33 | ) : loading ? (
34 |
35 | ) : (
36 | {
41 | console.log(page);
42 | },
43 | pageSize: 5,
44 | align: 'center',
45 | }}
46 | dataSource={data}
47 | renderItem={(item) => (
48 |
49 |
50 |
51 | )}
52 | />
53 | )}
54 |
55 | );
56 | };
57 |
--------------------------------------------------------------------------------
/src/components/NotificationsCard/styles.css:
--------------------------------------------------------------------------------
1 | .notifications-list-card .ant-card-body {
2 | padding: 0 0 1rem 0;
3 | }
4 |
5 | .available-tucks-card .ant-list-item {
6 | /*padding: 0;*/
7 | }
8 |
--------------------------------------------------------------------------------
/src/components/NotificationsItem/NotificationsItem.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { NotificationsItem } from './NotificationsItem.tsx';
4 |
5 | const DATA = {
6 | notification_id: 'dcffd2c4-63d7-4b70-88c2-e079fc7cde6f',
7 | user_id: '8956a7fd-070b-4dea-85fe-e0af167f2200',
8 | user: 'Cheston Crich',
9 | notification_type: 'text',
10 | notification_date: '5/15/2022',
11 | notification_message:
12 | 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit.',
13 | is_read: false,
14 | is_deleted: true,
15 | notification_category: 'Announcements',
16 | notification_image:
17 | 'https://robohash.org/essevelvoluptas.png?size=50x50&set=set1',
18 | color: 'pink',
19 | };
20 |
21 | const meta = {
22 | title: 'Components/Notifications/Item',
23 | component: NotificationsItem,
24 | parameters: {
25 | layout: 'centered',
26 | },
27 | tags: ['autodocs'],
28 | } satisfies Meta;
29 |
30 | export default meta;
31 |
32 | type Story = StoryObj;
33 |
34 | export const Default: Story = {
35 | args: {
36 | data: DATA,
37 | style: { width: 500 },
38 | },
39 | };
40 |
--------------------------------------------------------------------------------
/src/components/NotificationsItem/NotificationsItem.tsx:
--------------------------------------------------------------------------------
1 | import { Notifications } from '../../types';
2 | import { Avatar, Flex, FlexProps, Tag, Typography } from 'antd';
3 | import {
4 | ContainerOutlined,
5 | MailOutlined,
6 | PhoneOutlined,
7 | } from '@ant-design/icons';
8 |
9 | type Props = {
10 | data: Notifications;
11 | } & Omit;
12 |
13 | export const NotificationsItem = ({ data, ...others }: Props) => {
14 | const {
15 | notification_type,
16 | notification_category,
17 | notification_image,
18 | notification_date,
19 | notification_message,
20 | color,
21 | } = data;
22 |
23 | return (
24 |
25 |
26 |
27 |
28 |
29 | {notification_message.slice(0, 30)}...
30 |
31 |
36 | ) : notification_type === 'email' ? (
37 |
38 | ) : (
39 |
40 | )
41 | }
42 | style={{ textTransform: 'capitalize' }}
43 | >
44 | {notification_type}
45 |
46 |
47 |
48 |
49 | {notification_category}
50 |
51 | {notification_date}
52 |
53 |
54 |
55 | );
56 | };
57 |
--------------------------------------------------------------------------------
/src/components/Nprogress/Bar.tsx:
--------------------------------------------------------------------------------
1 | type Props = {
2 | animationDuration: number;
3 | progress: number;
4 | };
5 |
6 | export const Bar = ({ animationDuration, progress }: Props) => (
7 |
33 | );
34 |
--------------------------------------------------------------------------------
/src/components/Nprogress/Container.tsx:
--------------------------------------------------------------------------------
1 | import { ReactNode } from 'react';
2 |
3 | type Props = {
4 | animationDuration: number;
5 | isFinished: boolean;
6 | children: ReactNode;
7 | };
8 |
9 | export const NContainer = ({
10 | animationDuration,
11 | children,
12 | isFinished,
13 | }: Props) => (
14 |
21 | {children}
22 |
23 | );
24 |
--------------------------------------------------------------------------------
/src/components/Nprogress/Progress.tsx:
--------------------------------------------------------------------------------
1 | import { useNProgress } from '@tanem/react-nprogress';
2 | import { NContainer } from './Container.tsx';
3 | import { Bar } from './Bar.tsx';
4 | import { NSpinner } from './Spinner.tsx';
5 |
6 | type Props = {
7 | isAnimating?: boolean;
8 | };
9 |
10 | export const NProgress = ({ isAnimating }: Props) => {
11 | const { animationDuration, isFinished, progress } = useNProgress({
12 | isAnimating,
13 | });
14 |
15 | return (
16 |
17 |
18 |
19 | {/*
20 | This example doesn't use a spinner component so the UI stays
21 | tidy. You're free to render whatever is appropriate for your
22 | use-case.
23 | */}
24 |
25 | );
26 | };
27 |
--------------------------------------------------------------------------------
/src/components/Nprogress/Spinner.tsx:
--------------------------------------------------------------------------------
1 | import './spinner.css';
2 |
3 | export const NSpinner = () => (
4 |
27 | );
28 |
--------------------------------------------------------------------------------
/src/components/Nprogress/index.ts:
--------------------------------------------------------------------------------
1 | export { Bar } from './Bar.tsx';
2 | export { NContainer } from './Container.tsx';
3 | export { NProgress } from './Progress.tsx';
4 | export { NSpinner } from './Spinner.tsx';
5 |
--------------------------------------------------------------------------------
/src/components/Nprogress/spinner.css:
--------------------------------------------------------------------------------
1 | @keyframes spinner {
2 | 0% {
3 | transform: rotate(0deg);
4 | }
5 | 100% {
6 | transform: rotate(360deg);
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/components/PageHeader/PageHeader.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import { HomeOutlined, PieChartOutlined } from '@ant-design/icons';
3 | import { Link } from 'react-router-dom';
4 | import { withRouter } from 'storybook-addon-react-router-v6';
5 | import { DASHBOARD_ITEMS } from '../../constants';
6 |
7 | import { PageHeader } from './PageHeader.tsx';
8 |
9 | const meta = {
10 | title: 'Components/Page header',
11 | component: PageHeader,
12 | parameters: {
13 | layout: 'centered',
14 | },
15 | tags: ['autodocs'],
16 | decorators: [withRouter],
17 | } satisfies Meta;
18 |
19 | export default meta;
20 |
21 | type Story = StoryObj;
22 |
23 | export const Simple: Story = {
24 | args: {
25 | title: 'Dashboard',
26 | breadcrumbs: [
27 | {
28 | title: (
29 | <>
30 |
31 | home
32 | >
33 | ),
34 | path: '/',
35 | },
36 | {
37 | title: 'default dashboard',
38 | },
39 | ],
40 | style: { width: 800 },
41 | },
42 | };
43 |
44 | export const Complex: Story = {
45 | args: {
46 | title: 'Dashboard',
47 | breadcrumbs: [
48 | {
49 | title: (
50 | <>
51 |
52 | home
53 | >
54 | ),
55 | path: '/',
56 | },
57 | {
58 | title: (
59 | <>
60 |
61 | dashboards
62 | >
63 | ),
64 | menu: {
65 | items: DASHBOARD_ITEMS.map((d) => ({
66 | key: d.title,
67 | title: {d.title},
68 | })),
69 | },
70 | },
71 | {
72 | title: 'default',
73 | },
74 | ],
75 | style: { width: 800 },
76 | },
77 | };
78 |
--------------------------------------------------------------------------------
/src/components/PageHeader/PageHeader.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Breadcrumb, BreadcrumbProps, Divider, Space, Typography } from 'antd';
3 |
4 | import './styles.css';
5 |
6 | type Props = {
7 | title: string;
8 | breadcrumbs: BreadcrumbProps['items'];
9 | } & React.HTMLAttributes;
10 |
11 | export const PageHeader = ({ breadcrumbs, title, ...others }: Props) => {
12 | return (
13 |
14 |
15 |
19 | {title}
20 |
21 |
22 |
23 |
24 | {title}
25 |
26 |
27 | );
28 | };
29 |
--------------------------------------------------------------------------------
/src/components/PageHeader/styles.css:
--------------------------------------------------------------------------------
1 | .page-header-breadcrumbs .ant-breadcrumb-link {
2 | text-transform: capitalize !important;
3 | }
4 |
5 | .ant-dropdown .ant-dropdown-menu-item .ant-dropdown-menu-title-content {
6 | text-transform: capitalize !important;
7 | }
8 |
--------------------------------------------------------------------------------
/src/components/PricingTable/PricingTable.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import PricingData from '../../../public/mocks/Pricing.json';
3 |
4 | import { PricingTable } from './PricingTable.tsx';
5 |
6 | const meta = {
7 | title: 'Components/Pricing table',
8 | component: PricingTable,
9 | parameters: {
10 | layout: 'centered',
11 | },
12 | tags: ['autodocs'],
13 | } satisfies Meta;
14 |
15 | export default meta;
16 |
17 | type Story = StoryObj;
18 |
19 | export const Default: Story = {
20 | args: {
21 | data: PricingData,
22 | style: { width: 1000 },
23 | },
24 | };
25 |
26 | export const Loading: Story = {
27 | args: {
28 | loading: true,
29 | style: { width: 1000 },
30 | },
31 | };
32 |
33 | export const Error: Story = {
34 | args: {
35 | error: 'Error fetching items',
36 | style: { width: 1000 },
37 | },
38 | };
39 |
--------------------------------------------------------------------------------
/src/components/RefreshBtn/RefreshBtn.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { RefreshBtn } from './RefreshBtn.tsx';
4 |
5 | const meta = {
6 | title: 'Components/Refresh button',
7 | component: RefreshBtn,
8 | parameters: {
9 | layout: 'centered',
10 | },
11 | tags: ['autodocs'],
12 | } satisfies Meta;
13 |
14 | export default meta;
15 |
16 | type Story = StoryObj;
17 |
18 | export const Default: Story = {
19 | args: {},
20 | };
21 |
22 | export const WithIcon: Story = {
23 | args: {
24 | icon: true,
25 | },
26 | };
27 |
--------------------------------------------------------------------------------
/src/components/RefreshBtn/RefreshBtn.tsx:
--------------------------------------------------------------------------------
1 | import { Button, ButtonProps } from 'antd';
2 | import { SyncOutlined } from '@ant-design/icons';
3 |
4 | type Props = {
5 | icon?: boolean;
6 | } & ButtonProps;
7 |
8 | export const RefreshBtn = ({ icon, ...others }: Props) => {
9 | return (
10 | : null}
12 | onClick={() => window.location.reload()}
13 | {...others}
14 | >
15 | Refresh page
16 |
17 | );
18 | };
19 |
--------------------------------------------------------------------------------
/src/components/SitemapCard/SitemapCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import { withRouter } from 'storybook-addon-react-router-v6';
3 | import { DASHBOARD_ITEMS } from '../../constants';
4 |
5 | import { SitemapCard } from './SitemapCard.tsx';
6 |
7 | const meta = {
8 | title: 'Components/Sitemap',
9 | component: SitemapCard,
10 | parameters: {
11 | layout: 'centered',
12 | },
13 | decorators: [withRouter],
14 | } satisfies Meta;
15 |
16 | export default meta;
17 |
18 | type Story = StoryObj;
19 |
20 | export const Default: Story = {
21 | args: {
22 | data: {
23 | title: 'dashboard',
24 | links: DASHBOARD_ITEMS.map((d) => ({ title: d.title, path: '#' })),
25 | },
26 | style: { width: 400 },
27 | },
28 | };
29 |
--------------------------------------------------------------------------------
/src/components/SitemapCard/SitemapCard.tsx:
--------------------------------------------------------------------------------
1 | import { CardProps, Flex, Typography } from 'antd';
2 | import { Card } from '../index.ts';
3 |
4 | import './styles.css';
5 | import { Link } from 'react-router-dom';
6 |
7 | type Props = {
8 | data: {
9 | title: string;
10 | links: { title: string; path: string }[];
11 | };
12 | } & CardProps;
13 |
14 | export const SitemapCard = ({ data, ...others }: Props) => {
15 | return (
16 |
17 |
18 |
19 | {data.title}
20 |
21 |
22 | {data.links.map((d) => (
23 |
24 | {d.title}
25 |
26 | ))}
27 |
28 |
29 |
30 | );
31 | };
32 |
--------------------------------------------------------------------------------
/src/components/SitemapCard/styles.css:
--------------------------------------------------------------------------------
1 | .sitemap-card .ant-card-body {
2 | padding: 0;
3 | }
4 |
5 | .sitemap-card .ant-list-item {
6 | text-transform: capitalize;
7 | }
8 |
--------------------------------------------------------------------------------
/src/components/SocialMediaCard/SocialMediaCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { SocialMediaCard } from './SocialMediaCard.tsx';
4 |
5 | const meta = {
6 | title: 'Components/Social media',
7 | component: SocialMediaCard,
8 | parameters: {
9 | layout: 'centered',
10 | },
11 | } satisfies Meta;
12 |
13 | export default meta;
14 |
15 | type Story = StoryObj;
16 |
17 | export const Default: Story = {
18 | args: {
19 | style: { width: 400 },
20 | },
21 | };
22 |
--------------------------------------------------------------------------------
/src/components/SocialMediaCard/SocialMediaCard.tsx:
--------------------------------------------------------------------------------
1 | import { Button, ButtonProps, CardProps, Flex } from 'antd';
2 | import { Card } from '../index.ts';
3 | import {
4 | FacebookFilled,
5 | GithubFilled,
6 | InstagramFilled,
7 | LinkedinFilled,
8 | TwitterCircleFilled,
9 | } from '@ant-design/icons';
10 |
11 | const BUTTON_PROPS: ButtonProps = {
12 | type: 'link',
13 | style: {
14 | textAlign: 'start',
15 | },
16 | };
17 |
18 | type Props = CardProps;
19 |
20 | export const SocialMediaCard = ({ ...others }: Props) => {
21 | return (
22 |
23 |
24 | } {...BUTTON_PROPS}>
25 | Facebook
26 |
27 | } {...BUTTON_PROPS}>
28 | Instagram
29 |
30 | } {...BUTTON_PROPS}>
31 | Facebook
32 |
33 | } {...BUTTON_PROPS}>
34 | Facebook
35 |
36 | } {...BUTTON_PROPS}>
37 | Facebook
38 |
39 |
40 |
41 | );
42 | };
43 |
--------------------------------------------------------------------------------
/src/components/TimelineCard/TimelineCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import TimelineData from '../../../public/mocks/TimelineActivity.json';
3 |
4 | import { TimelineCard } from './TimelineCard.tsx';
5 |
6 | const meta = {
7 | title: 'Components/Timeline',
8 | component: TimelineCard,
9 | parameters: {
10 | layout: 'centered',
11 | },
12 | tags: ['autodocs'],
13 | } satisfies Meta;
14 |
15 | export default meta;
16 |
17 | type Story = StoryObj;
18 |
19 | export const Default: Story = {
20 | args: {
21 | data: TimelineData.slice(0, 5),
22 | style: { width: 600 },
23 | },
24 | };
25 |
26 | export const Loading: Story = {
27 | args: {
28 | loading: true,
29 | style: { width: 600 },
30 | },
31 | };
32 |
33 | export const Error: Story = {
34 | args: {
35 | error: 'Error fetching items',
36 | style: { width: 600 },
37 | },
38 | };
39 |
--------------------------------------------------------------------------------
/src/components/TimelineCard/TimelineCard.tsx:
--------------------------------------------------------------------------------
1 | import { Alert, CardProps, Flex, Timeline, Typography } from 'antd';
2 | import {
3 | LaptopOutlined,
4 | MobileOutlined,
5 | TabletOutlined,
6 | } from '@ant-design/icons';
7 | import { ActivityTimeline } from '../../types';
8 | import { Card, Loader } from '../index.ts';
9 | import { ReactNode } from 'react';
10 |
11 | type Props = {
12 | data?: ActivityTimeline[];
13 | loading?: boolean;
14 | error?: ReactNode;
15 | } & CardProps;
16 |
17 | export const TimelineCard = ({ data, error, loading, ...others }: Props) => {
18 | return (
19 |
20 | {error ? (
21 |
27 | ) : loading ? (
28 |
29 | ) : (
30 | ({
33 | dot:
34 | _.device_type === 'desktop' ? (
35 |
36 | ) : _.device_type === 'tablet' ? (
37 |
38 | ) : (
39 |
40 | ),
41 | children: (
42 |
43 |
50 | {_.post_content}
51 |
52 |
53 | {_.timestamp}
54 |
55 |
56 | ),
57 | }))}
58 | />
59 | )}
60 |
61 | );
62 | };
63 |
--------------------------------------------------------------------------------
/src/components/UserAvatar/UserAvatar.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { UserAvatar } from './UserAvatar.tsx';
4 |
5 | const meta = {
6 | title: 'Components/User avatar',
7 | component: UserAvatar,
8 | parameters: {
9 | layout: 'centered',
10 | },
11 | tags: ['autodocs'],
12 | } satisfies Meta;
13 |
14 | export default meta;
15 |
16 | type Story = StoryObj;
17 |
18 | export const Default: Story = {
19 | args: {
20 | fullName: 'Kelvin Kiptum',
21 | },
22 | };
23 |
24 | export const Mark: Story = {
25 | args: {
26 | fullName: 'Kelvin Kiptum',
27 | mark: true,
28 | },
29 | };
30 |
31 | export const Verified: Story = {
32 | args: {
33 | fullName: 'Kelvin Kiptum',
34 | verified: true,
35 | textWidth: 'auto',
36 | },
37 | };
38 |
39 | export const CustomColor: Story = {
40 | args: {
41 | fullName: 'Kelvin Kiptum',
42 | color: 'green',
43 | },
44 | };
45 |
46 | export const Small: Story = {
47 | args: {
48 | fullName: 'Kelvin Kiptum',
49 | size: 'small',
50 | },
51 | };
52 |
53 | export const Large: Story = {
54 | args: {
55 | fullName: 'Kelvin Kiptum',
56 | size: 'large',
57 | },
58 | };
59 |
--------------------------------------------------------------------------------
/src/components/UserAvatar/UserAvatar.tsx:
--------------------------------------------------------------------------------
1 | import { Avatar, AvatarProps, Flex, FlexProps, theme, Typography } from 'antd';
2 | import { colourNameToHex, getNameInitials, isColorLight } from '../../utils';
3 | import { CheckCircleFilled, UserOutlined } from '@ant-design/icons';
4 | import { blue } from '@ant-design/colors';
5 | import { CSSProperties } from 'react';
6 |
7 | /**
8 | * mark - not a full name user, just a single user name
9 | */
10 | type Props = {
11 | fullName: string;
12 | mark?: boolean;
13 | size?: 'small' | 'middle' | 'large';
14 | verified?: boolean;
15 | color?: CSSProperties['color'];
16 | textWidth?: CSSProperties['width'];
17 | } & Omit;
18 |
19 | export const UserAvatar = ({
20 | fullName,
21 | mark,
22 | size,
23 | verified,
24 | color,
25 | textWidth,
26 | ...others
27 | }: Props) => {
28 | const {
29 | token: { colorPrimary },
30 | } = theme.useToken();
31 |
32 | const avatarProps: AvatarProps = {
33 | size: size === 'large' ? 36 : size === 'small' ? 18 : 24,
34 | };
35 |
36 | return (
37 |
38 | {mark ? (
39 | }
47 | {...avatarProps}
48 | />
49 | ) : (
50 |
59 | {getNameInitials(fullName)}
60 |
61 | )}
62 |
68 | {fullName}
69 |
70 | {verified && (
71 |
72 | )}
73 |
74 | );
75 | };
76 |
--------------------------------------------------------------------------------
/src/components/corporate/BlogsListCard/BlogListCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import { withRouter } from 'storybook-addon-react-router-v6';
3 |
4 | import { BlogsListCard } from './BlogsListCard.tsx';
5 |
6 | const MOCK_DATA = Array.from({ length: 5 }).map((_, i) => ({
7 | href: 'https://ant.design',
8 | title: `Lorem ipsum ${i}`,
9 | avatar: `https://xsgames.co/randomusers/avatar.php?g=pixel&key=${i}`,
10 | description:
11 | 'Ant Design, a design language for background applications, is refined by Ant UED Team.',
12 | content:
13 | 'We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure), to help people create their product prototypes beautifully and efficiently.',
14 | }));
15 |
16 | // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
17 | const meta = {
18 | title: 'Components/Corporate/Blogs list',
19 | component: BlogsListCard,
20 | parameters: {
21 | // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
22 | layout: 'centered',
23 | },
24 | // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
25 | tags: ['autodocs'],
26 | // More on argTypes: https://storybook.js.org/docs/react/api/argtypes
27 | decorators: [withRouter],
28 | } satisfies Meta;
29 |
30 | export default meta;
31 | type Story = StoryObj;
32 |
33 | // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
34 | export const Default: Story = {
35 | args: {
36 | data: MOCK_DATA,
37 | },
38 | };
39 |
40 | export const Loading: Story = {
41 | args: {
42 | loading: true,
43 | },
44 | };
45 |
46 | export const Error: Story = {
47 | args: {
48 | error: 'Failed to fetch blogs',
49 | },
50 | };
51 |
52 | export const NoData: Story = {
53 | args: {
54 | data: [],
55 | },
56 | };
57 |
--------------------------------------------------------------------------------
/src/components/corporate/BlogsListCard/styles.css:
--------------------------------------------------------------------------------
1 | .blogs-list-card .ant-card-body {
2 | padding: 0 0 1rem 0;
3 | }
4 |
5 | .blogs-list-card .ant-list-item {
6 | /*padding: 0;*/
7 | }
8 |
--------------------------------------------------------------------------------
/src/components/dashboard/bidding/AuctionCarousel/AuctionCarousel.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { CardItem } from './AuctionCarousel.tsx';
4 |
5 | const MOCK_DATA = {
6 | auction_id: 'a9e1b790-35f6-4549-b452-aff1eee3ef87',
7 | nft_name: 'non pretium quis lectus suspendisse potenti in eleifend quam a',
8 | nft_image:
9 | 'https://images.unsplash.com/photo-1644361566696-3d442b5b482a?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MXx8bmZ0fGVufDB8fDB8fHwy&auto=format&fit=crop&w=500&q=60',
10 | seller_username: 'rsingleton0',
11 | buyer_username: 'fandretti0',
12 | start_price: 33611.73,
13 | end_price: 95441.53,
14 | start_date: '5/11/2022',
15 | end_date: '10/30/2022',
16 | status: 'active',
17 | is_highest_bid_mine: false,
18 | winning_bid: 140.94,
19 | time_left: '8:20 PM',
20 | };
21 |
22 | // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
23 | const meta = {
24 | title: 'Components/Dashboard/Bidding/Auction card',
25 | component: CardItem,
26 | parameters: {
27 | layout: 'centered',
28 | },
29 | } satisfies Meta;
30 |
31 | export default meta;
32 | type Story = StoryObj;
33 |
34 | // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
35 | export const Default: Story = {
36 | args: {
37 | item: MOCK_DATA,
38 | style: { width: 300 },
39 | },
40 | };
41 |
--------------------------------------------------------------------------------
/src/components/dashboard/bidding/AuctionCarousel/styles.css:
--------------------------------------------------------------------------------
1 | .auction-carousel {
2 | }
3 |
4 | .slick-slide {
5 | }
6 |
7 | .auction-card {
8 | }
9 |
10 | .auction-card .ant-card-body {
11 | padding: 2px;
12 | }
13 |
14 | .auction-card .auction-card-header {
15 | height: 280px;
16 | background-image: linear-gradient(60deg, #29323c 0%, #485563 100%);
17 | }
18 |
--------------------------------------------------------------------------------
/src/components/dashboard/bidding/CategoriesCard/Categories.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { CategoriesCard } from './CategoriesCard.tsx';
4 |
5 | // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
6 | const meta = {
7 | title: 'Components/Dashboard/Bidding/Categories table',
8 | component: CategoriesCard,
9 | parameters: {
10 | layout: 'centered',
11 | },
12 | } satisfies Meta;
13 |
14 | export default meta;
15 | type Story = StoryObj;
16 |
17 | // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
18 | export const Default: Story = {
19 | args: {
20 | style: {
21 | width: 600,
22 | },
23 | },
24 | };
25 |
--------------------------------------------------------------------------------
/src/components/dashboard/bidding/CategoriesCard/styles.css:
--------------------------------------------------------------------------------
1 | .categories-list-card .ant-card-body {
2 | padding: 0 0 1rem 0;
3 | }
4 |
5 | .available-tucks-card .ant-list-item {
6 | /*padding: 0;*/
7 | }
8 |
--------------------------------------------------------------------------------
/src/components/dashboard/bidding/CreatorsCard/CreatorsCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import CreatorsData from '../../../../../public/mocks/AuctionCreators.json';
3 |
4 | import { CreatorsCard } from './CreatorsCard.tsx';
5 |
6 | // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
7 | const meta = {
8 | title: 'Components/Dashboard/Bidding/Creators table',
9 | component: CreatorsCard,
10 | parameters: {
11 | // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
12 | layout: 'centered',
13 | },
14 | // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
15 | tags: ['autodocs'],
16 | // More on argTypes: https://storybook.js.org/docs/react/api/argtypes
17 | } satisfies Meta;
18 |
19 | export default meta;
20 | type Story = StoryObj;
21 |
22 | // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
23 | export const Default: Story = {
24 | args: {
25 | data: CreatorsData,
26 | style: { width: 600 },
27 | },
28 | };
29 |
30 | export const Loading: Story = {
31 | args: {
32 | loading: true,
33 | style: { width: 600 },
34 | },
35 | };
36 |
37 | export const Error: Story = {
38 | args: {
39 | error: 'Error loading creators',
40 | style: { width: 600 },
41 | },
42 | };
43 |
44 | export const Empty: Story = {
45 | args: {
46 | data: [],
47 | style: { width: 600 },
48 | },
49 | };
50 |
--------------------------------------------------------------------------------
/src/components/dashboard/bidding/CreatorsCard/CreatorsCard.tsx:
--------------------------------------------------------------------------------
1 | import { ReactNode } from 'react';
2 | import { Alert, Button, CardProps, Table, TableColumnsType } from 'antd';
3 | import { AuctionCreator } from '../../../../types';
4 | import { Card, UserAvatar } from '../../../index';
5 | import { UserAddOutlined } from '@ant-design/icons';
6 | import './styles.css';
7 |
8 | const COLUMNS: TableColumnsType = [
9 | {
10 | key: 'creators_name',
11 | dataIndex: 'first_name',
12 | title: 'Creator',
13 | render: (_, { first_name, last_name, favorite_color }) => (
14 |
20 | ),
21 | },
22 | {
23 | key: 'sold_items',
24 | dataIndex: 'sales_count',
25 | title: 'Items',
26 | },
27 | {
28 | key: 'creator_actions',
29 | dataIndex: 'actions',
30 | title: 'Actions',
31 | render: () => (
32 | }>
33 | Follow
34 |
35 | ),
36 | },
37 | ];
38 |
39 | type Props = {
40 | data?: AuctionCreator[];
41 | loading?: boolean;
42 | error?: ReactNode;
43 | } & CardProps;
44 |
45 | export const CreatorsCard = ({ data, loading, error, ...others }: Props) => {
46 | return error ? (
47 |
53 | ) : (
54 | See all creators}
57 | className="card"
58 | {...others}
59 | >
60 |
67 |
68 | );
69 | };
70 |
--------------------------------------------------------------------------------
/src/components/dashboard/bidding/CreatorsCard/styles.css:
--------------------------------------------------------------------------------
1 | .creators-list-card .ant-card-body {
2 | padding: 0 0 1rem 0;
3 | }
4 |
5 | .available-tucks-card .ant-list-item {
6 | /*padding: 0;*/
7 | }
8 |
--------------------------------------------------------------------------------
/src/components/dashboard/bidding/TopItemsCard/TopItems.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import TopItemsData from '../../../../../public/mocks/BiddingTopSellers.json';
3 |
4 | import { TopItemsCard } from './TopItems.tsx';
5 |
6 | // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
7 | const meta = {
8 | title: 'Components/Dashboard/Bidding/Top items table',
9 | component: TopItemsCard,
10 | parameters: {
11 | // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
12 | layout: 'centered',
13 | },
14 | // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
15 | tags: ['autodocs'],
16 | // More on argTypes: https://storybook.js.org/docs/react/api/argtypes
17 | } satisfies Meta;
18 |
19 | export default meta;
20 | type Story = StoryObj;
21 |
22 | // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
23 | export const Default: Story = {
24 | args: {
25 | data: TopItemsData,
26 | style: { width: 800 },
27 | },
28 | };
29 |
30 | export const Loading: Story = {
31 | args: {
32 | loading: true,
33 | style: { width: 800 },
34 | },
35 | };
36 |
37 | export const Error: Story = {
38 | args: {
39 | error: 'Error loading items',
40 | style: { width: 800 },
41 | },
42 | };
43 |
44 | export const Empty: Story = {
45 | args: {
46 | data: [],
47 | style: { width: 800 },
48 | },
49 | };
50 |
--------------------------------------------------------------------------------
/src/components/dashboard/bidding/TransactionsCard/TransactionsCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import TransactionsData from '../../../../../public/mocks/BiddingTransactions.json';
3 |
4 | import { TransactionsCard } from './TransactionsCard.tsx';
5 |
6 | const meta = {
7 | title: 'Components/Dashboard/Bidding/Transactions table',
8 | component: TransactionsCard,
9 | parameters: {
10 | layout: 'centered',
11 | },
12 | tags: ['autodocs'],
13 | } satisfies Meta;
14 |
15 | export default meta;
16 |
17 | type Story = StoryObj;
18 |
19 | export const Default: Story = {
20 | args: {
21 | data: TransactionsData,
22 | style: { width: 800 },
23 | },
24 | };
25 |
26 | export const Loading: Story = {
27 | args: {
28 | loading: true,
29 | style: { width: 800 },
30 | },
31 | };
32 |
33 | export const Error: Story = {
34 | args: {
35 | error: 'Error loading items',
36 | style: { width: 800 },
37 | },
38 | };
39 |
40 | export const Empty: Story = {
41 | args: {
42 | data: [],
43 | style: { width: 800 },
44 | },
45 | };
46 |
--------------------------------------------------------------------------------
/src/components/dashboard/bidding/index.ts:
--------------------------------------------------------------------------------
1 | export { AuctionCarousel } from './AuctionCarousel/AuctionCarousel.tsx';
2 | export { CreatorsCard } from './CreatorsCard/CreatorsCard.tsx';
3 | export { TopItemsCard } from './TopItemsCard/TopItems.tsx';
4 | export { TransactionsCard } from './TransactionsCard/TransactionsCard.tsx';
5 | export { CategoriesCard } from './CategoriesCard/CategoriesCard.tsx';
6 |
--------------------------------------------------------------------------------
/src/components/dashboard/default/CampaignsCard/CampaignsCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import CampaignsData from '../../../../../public/mocks/Campaigns.json';
3 |
4 | import { CampaignsCard } from './CampaignsCard.tsx';
5 |
6 | const meta = {
7 | title: 'Components/Dashboard/Default/Campaigns table',
8 | component: CampaignsCard,
9 | parameters: {
10 | layout: 'centered',
11 | },
12 | tags: ['autodocs'],
13 | } satisfies Meta;
14 |
15 | export default meta;
16 |
17 | type Story = StoryObj;
18 |
19 | export const Default: Story = {
20 | args: {
21 | data: CampaignsData,
22 | style: { width: 1000 },
23 | },
24 | };
25 |
26 | export const Loading: Story = {
27 | args: {
28 | loading: true,
29 | data: [],
30 | style: { width: 1000 },
31 | },
32 | };
33 |
34 | export const Error: Story = {
35 | args: {
36 | error: 'Error loading items',
37 | data: [],
38 | style: { width: 1000 },
39 | },
40 | };
41 |
--------------------------------------------------------------------------------
/src/components/dashboard/default/EarningsCard/EarningsCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { EarningsCard } from './EarningsCard.tsx';
4 |
5 | const meta = {
6 | title: 'Components/Dashboard/Default/Earnings card',
7 | component: EarningsCard,
8 | parameters: {
9 | layout: 'centered',
10 | },
11 | } satisfies Meta;
12 |
13 | export default meta;
14 |
15 | type Story = StoryObj;
16 |
17 | export const Default: Story = {
18 | args: {
19 | data: [
20 | {
21 | type: 'Transport',
22 | value: 27,
23 | },
24 | {
25 | type: 'Communication',
26 | value: 25,
27 | },
28 | {
29 | type: 'Rent',
30 | value: 18,
31 | },
32 | {
33 | type: 'Entertainment',
34 | value: 15,
35 | },
36 | {
37 | type: 'Food',
38 | value: 10,
39 | },
40 | {
41 | type: 'Misc.',
42 | value: 5,
43 | },
44 | ],
45 | title: 'Earnings',
46 | diff: 20,
47 | style: { width: 360 },
48 | },
49 | };
50 |
--------------------------------------------------------------------------------
/src/components/dashboard/default/GetStartedCard/GetStartedCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { GetStartedCard } from './GetStartedCard.tsx';
4 |
5 | const meta = {
6 | title: 'Components/Dashboard/Default/Get started card',
7 | component: GetStartedCard,
8 | parameters: {
9 | layout: 'centered',
10 | },
11 | } satisfies Meta;
12 |
13 | export default meta;
14 |
15 | type Story = StoryObj;
16 |
17 | export const Default: Story = {
18 | args: {
19 | style: { width: 600 },
20 | },
21 | };
22 |
--------------------------------------------------------------------------------
/src/components/dashboard/default/GetStartedCard/GetStartedCard.tsx:
--------------------------------------------------------------------------------
1 | import { Button, CardProps, Flex, Image, Typography } from 'antd';
2 | import { RightOutlined } from '@ant-design/icons';
3 | import { Card } from '../../../index';
4 | import CountUp from 'react-countup';
5 |
6 | type Props = CardProps;
7 |
8 | export const GetStartedCard = ({ ...others }: Props) => {
9 | return (
10 |
11 |
12 |
13 |
14 | You have projects to finish this week
15 |
16 |
17 | You have already completed 68% of your monthly target. Keep going to
18 | achieve your goal.
19 |
20 |
21 | Get started
22 |
23 |
24 |
30 |
31 |
32 | );
33 | };
34 |
--------------------------------------------------------------------------------
/src/components/dashboard/default/LatestOrdersCard/LatestOrdersCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import CampaignsData from '../../../../../public/mocks/Campaigns.json';
3 |
4 | import { LatestOrdersCard } from './LatestOrdersCard.tsx';
5 |
6 | const meta = {
7 | title: 'Components/Dashboard/Default/Orders/Table',
8 | component: LatestOrdersCard,
9 | parameters: {
10 | layout: 'centered',
11 | },
12 | tags: ['autodocs'],
13 | } satisfies Meta;
14 |
15 | export default meta;
16 |
17 | type Story = StoryObj;
18 |
19 | export const Default: Story = {
20 | args: {
21 | data: CampaignsData,
22 | style: { width: 1000 },
23 | },
24 | };
25 |
26 | export const Loading: Story = {
27 | args: {
28 | loading: true,
29 | data: [],
30 | style: { width: 1000 },
31 | },
32 | };
33 |
34 | export const Error: Story = {
35 | args: {
36 | error: 'Error loading items',
37 | data: [],
38 | style: { width: 1000 },
39 | },
40 | };
41 |
--------------------------------------------------------------------------------
/src/components/dashboard/default/LatestOrdersCard/LatestOrdersCard.tsx:
--------------------------------------------------------------------------------
1 | import { Alert, Card, CardProps, Table } from 'antd';
2 | import { MoreMenu } from '../../../index.ts';
3 | import { ReactNode } from 'react';
4 | import { useFetchData } from '../../../../hooks';
5 |
6 | const COLUMNS = [
7 | {
8 | title: 'Customer name',
9 | dataIndex: 'customer_name',
10 | key: 'customer_name',
11 | },
12 | {
13 | title: 'Product',
14 | dataIndex: 'product_name',
15 | key: 'product_name',
16 | },
17 | {
18 | title: 'Orders',
19 | dataIndex: 'orders',
20 | key: 'orders',
21 | },
22 | {
23 | title: 'Country',
24 | dataIndex: 'country',
25 | key: 'country',
26 | },
27 | {
28 | title: 'Shipping address',
29 | dataIndex: 'shipping_address',
30 | key: 'shipping_address',
31 | },
32 | ];
33 |
34 | type Props = {
35 | data?: any;
36 | loading?: boolean;
37 | error?: ReactNode;
38 | } & CardProps;
39 |
40 | export const LatestOrdersCard = ({
41 | data,
42 | loading,
43 | error,
44 | ...others
45 | }: Props) => {
46 | const {
47 | data: ordersData,
48 | loading: ordersDataLoading,
49 | error: ordersDataError,
50 | } = useFetchData('/mocks/CountryOrders.json');
51 |
52 | return (
53 | } {...others}>
54 | {ordersDataError || error ? (
55 |
61 | ) : (
62 |
67 | )}
68 |
69 | );
70 | };
71 |
--------------------------------------------------------------------------------
/src/components/dashboard/default/OrdersChart/OrdersChart.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { OrdersChart } from './OrdersChart.tsx';
4 |
5 | const meta = {
6 | title: 'Components/Dashboard/Default/Orders/Chart',
7 | component: OrdersChart,
8 | parameters: {
9 | layout: 'centered',
10 | },
11 | } satisfies Meta;
12 |
13 | export default meta;
14 |
15 | type Story = StoryObj;
16 |
17 | export const Default: Story = {
18 | args: {
19 | style: { width: 500 },
20 | },
21 | };
22 |
--------------------------------------------------------------------------------
/src/components/dashboard/default/OrdersChart/OrdersChart.tsx:
--------------------------------------------------------------------------------
1 | import { Card, CardProps } from 'antd';
2 | import { Area } from '@ant-design/charts';
3 | import { MoreMenu } from '../../../index.ts';
4 |
5 | const AreaChart = () => {
6 | const data = [
7 | {
8 | country: 'order',
9 | date: '1 Aug',
10 | value: 100,
11 | },
12 | {
13 | country: 'order',
14 | date: '8 Aug',
15 | value: 300,
16 | },
17 | {
18 | country: 'order',
19 | date: '15 Aug',
20 | value: 200,
21 | },
22 | {
23 | country: 'order',
24 | date: '22 Aug',
25 | value: 250,
26 | },
27 | {
28 | country: 'revenue',
29 | date: '1 Aug',
30 | value: 900.5,
31 | },
32 | {
33 | country: 'revenue',
34 | date: '8 Aug',
35 | value: 1500.5,
36 | },
37 | {
38 | country: 'revenue',
39 | date: '15 Aug',
40 | value: 1200.7,
41 | },
42 | {
43 | country: 'revenue',
44 | date: '22 Aug',
45 | value: 1300.1,
46 | },
47 | ];
48 |
49 | const config = {
50 | data,
51 | xField: 'date',
52 | yField: 'value',
53 | seriesField: 'country',
54 | slider: {
55 | start: 0.1,
56 | end: 0.9,
57 | },
58 | };
59 |
60 | return ;
61 | };
62 |
63 | type Props = CardProps;
64 |
65 | export const OrdersChart = ({ ...others }: Props) => {
66 | return (
67 | } {...others}>
68 |
69 |
70 | );
71 | };
72 |
--------------------------------------------------------------------------------
/src/components/dashboard/default/RecentUsersCard/RecentUsersCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import CampaignsData from '../../../../../public/mocks/Campaigns.json';
3 |
4 | import { RecentUsersCard } from './RecentUsersCard.tsx';
5 |
6 | const meta = {
7 | title: 'Components/Dashboard/Default/Users card',
8 | component: RecentUsersCard,
9 | parameters: {
10 | layout: 'centered',
11 | },
12 | tags: ['autodocs'],
13 | } satisfies Meta;
14 |
15 | export default meta;
16 |
17 | type Story = StoryObj;
18 |
19 | export const Default: Story = {
20 | args: {
21 | data: CampaignsData,
22 | style: { width: 1000 },
23 | },
24 | };
25 |
26 | export const Loading: Story = {
27 | args: {
28 | loading: true,
29 | data: [],
30 | style: { width: 1000 },
31 | },
32 | };
33 |
34 | export const Error: Story = {
35 | args: {
36 | error: 'Error loading items',
37 | data: [],
38 | style: { width: 1000 },
39 | },
40 | };
41 |
--------------------------------------------------------------------------------
/src/components/dashboard/default/RecentUsersCard/RecentUsersCard.tsx:
--------------------------------------------------------------------------------
1 | import { Alert, Card, CardProps, Table, Typography } from 'antd';
2 | import { MoreMenu } from '../../../index.ts';
3 | import { useFetchData } from '../../../../hooks';
4 | import { ReactNode } from 'react';
5 |
6 | const COLUMNS = [
7 | {
8 | title: 'Names',
9 | dataIndex: 'first_name',
10 | key: 'name',
11 | render: (_: any, { first_name, last_name }: any) => (
12 |
13 | {first_name} {last_name}
14 |
15 | ),
16 | },
17 | {
18 | title: 'Gender',
19 | dataIndex: 'gender',
20 | key: 'gender',
21 | },
22 | {
23 | title: 'Country',
24 | dataIndex: 'country',
25 | key: 'country',
26 | },
27 | {
28 | title: 'Birth date',
29 | dataIndex: 'birthdate',
30 | key: 'birthdate',
31 | },
32 | ];
33 |
34 | type Props = { data?: any; loading?: boolean; error?: ReactNode } & CardProps;
35 |
36 | export const RecentUsersCard = ({ data, loading, error, ...others }: Props) => {
37 | const {
38 | data: usersData,
39 | loading: usersDataLoading,
40 | error: usersDataError,
41 | } = useFetchData('/mocks/ChannelUsers.json');
42 |
43 | return (
44 | } {...others}>
45 | {usersDataError || error ? (
46 |
52 | ) : (
53 |
58 | )}
59 |
60 | );
61 | };
62 |
--------------------------------------------------------------------------------
/src/components/dashboard/default/SubscribersChart/SubscribersChart.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { SubscribersChart } from './SubscribersChart.tsx';
4 |
5 | const meta = {
6 | title: 'Components/Dashboard/Default/Subscribers card',
7 | component: SubscribersChart,
8 | parameters: {
9 | layout: 'centered',
10 | },
11 | } satisfies Meta;
12 |
13 | export default meta;
14 |
15 | type Story = StoryObj;
16 |
17 | export const Default: Story = {
18 | args: {
19 | style: { width: 600 },
20 | },
21 | };
22 |
--------------------------------------------------------------------------------
/src/components/dashboard/default/SubscribersChart/SubscribersChart.tsx:
--------------------------------------------------------------------------------
1 | import { Card, CardProps, Flex, Typography } from 'antd';
2 | import { Column } from '@ant-design/charts';
3 | import { MoreMenu } from '../../../index.ts';
4 |
5 | type Props = CardProps;
6 |
7 | const ColumnChart = () => {
8 | const data = [
9 | {
10 | type: '1 July',
11 | subscribers: 38,
12 | },
13 | {
14 | type: '8 July',
15 | subscribers: 52,
16 | },
17 | {
18 | type: '15 July',
19 | subscribers: 61,
20 | },
21 | {
22 | type: '22 July',
23 | subscribers: 145,
24 | },
25 | {
26 | type: '29 July',
27 | subscribers: 48,
28 | },
29 | {
30 | type: '5 Aug',
31 | subscribers: 38,
32 | },
33 | {
34 | type: '12 Aug',
35 | subscribers: 38,
36 | },
37 | {
38 | type: '19 Aug',
39 | subscribers: 38,
40 | },
41 | ];
42 | const config = {
43 | data,
44 | xField: 'type',
45 | yField: 'subscribers',
46 | label: {
47 | position: 'middle',
48 |
49 | style: {
50 | fill: '#FFFFFF',
51 | opacity: 0.6,
52 | },
53 | },
54 | xAxis: {
55 | label: {
56 | autoHide: true,
57 | autoRotate: false,
58 | },
59 | },
60 | meta: {
61 | type: {
62 | alias: 'Subscribers',
63 | },
64 | subscribers: {
65 | alias: 'count',
66 | },
67 | },
68 | };
69 | // @ts-ignore
70 | return ;
71 | };
72 |
73 | export const SubscribersChart = ({ ...others }: Props) => {
74 | return (
75 | } {...others}>
76 |
77 | 75% activity growth
78 |
79 |
80 |
81 | );
82 | };
83 |
--------------------------------------------------------------------------------
/src/components/dashboard/default/TasksChartCard/TasksChart.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { TasksChartCard } from './TasksChartCard.tsx';
4 |
5 | const TASKS_DATA = [
6 | {
7 | day: 'Monday',
8 | value: 33,
9 | status: 'new',
10 | },
11 | {
12 | day: 'Tuesday',
13 | value: 44,
14 | status: 'new',
15 | },
16 | {
17 | day: 'Wednesday',
18 | value: 35,
19 | status: 'new',
20 | },
21 | {
22 | day: 'Thursday',
23 | value: 55,
24 | status: 'new',
25 | },
26 | {
27 | day: 'Friday',
28 | value: 49,
29 | status: 'new',
30 | },
31 | {
32 | day: 'Saturday',
33 | value: 63,
34 | status: 'new',
35 | },
36 | {
37 | day: 'Sunday',
38 | value: 72,
39 | status: 'new',
40 | },
41 | {
42 | day: 'Monday',
43 | value: 69,
44 | status: 'in progress',
45 | },
46 | {
47 | day: 'Tuesday',
48 | value: 81,
49 | status: 'in progress',
50 | },
51 | {
52 | day: 'Wednesday',
53 | value: 34,
54 | status: 'in progress',
55 | },
56 | {
57 | day: 'Thursday',
58 | value: 25,
59 | status: 'in progress',
60 | },
61 | {
62 | day: 'Friday',
63 | value: 39,
64 | status: 'in progress',
65 | },
66 | {
67 | day: 'Saturday',
68 | value: 45,
69 | status: 'in progress',
70 | },
71 | {
72 | day: 'Sunday',
73 | value: 60,
74 | status: 'in progress',
75 | },
76 | ];
77 |
78 | const meta = {
79 | title: 'Components/Dashboard/Default/Tasks/Chart',
80 | component: TasksChartCard,
81 | parameters: {
82 | layout: 'centered',
83 | },
84 | } satisfies Meta;
85 |
86 | export default meta;
87 |
88 | type Story = StoryObj;
89 |
90 | export const Default: Story = {
91 | args: {
92 | data: TASKS_DATA,
93 | style: { width: 600 },
94 | },
95 | };
96 |
--------------------------------------------------------------------------------
/src/components/dashboard/default/TasksChartCard/TasksChartCard.tsx:
--------------------------------------------------------------------------------
1 | import { Column } from '@ant-design/charts';
2 | import { Button, CardProps } from 'antd';
3 | import { Card } from '../../../index.ts';
4 |
5 | type Tasks = {
6 | day: string;
7 | value: number;
8 | status: string;
9 | };
10 |
11 | type ChartProps = {
12 | data: Tasks[];
13 | };
14 |
15 | const ColumnChart = ({ data }: ChartProps) => {
16 | const config = {
17 | data,
18 | isStack: true,
19 | xField: 'day',
20 | yField: 'value',
21 | seriesField: 'status',
22 | label: {
23 | position: 'top', // 'top', 'bottom', 'middle'
24 | offset: 10,
25 | style: {
26 | fill: 'transparent',
27 | },
28 | },
29 | interactions: [
30 | {
31 | type: 'active-region',
32 | enable: false,
33 | },
34 | ],
35 | columnBackground: {
36 | style: {
37 | fill: 'rgba(0,0,0,0.1)',
38 | },
39 | },
40 | legend: {
41 | position: 'bottom',
42 | },
43 | };
44 |
45 | // @ts-ignore
46 | return ;
47 | };
48 |
49 | type Props = {
50 | data?: Tasks[];
51 | } & CardProps;
52 |
53 | export const TasksChartCard = ({ data, ...others }: Props) => {
54 | return (
55 | See all} {...others}>
56 |
57 |
58 | );
59 | };
60 |
--------------------------------------------------------------------------------
/src/components/dashboard/default/TasksListCard/TasksList.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import TasksListData from '../../../../../public/mocks/TasksList.json';
3 |
4 | import { TasksListCard } from './TasksListCard.tsx';
5 |
6 | const meta = {
7 | title: 'Components/Dashboard/Default/Tasks/List',
8 | component: TasksListCard,
9 | parameters: {
10 | layout: 'centered',
11 | },
12 | tags: ['autodocs'],
13 | } satisfies Meta;
14 |
15 | export default meta;
16 |
17 | type Story = StoryObj;
18 |
19 | export const Default: Story = {
20 | args: {
21 | data: TasksListData,
22 | style: { width: 800 },
23 | },
24 | };
25 |
26 | export const Loading: Story = {
27 | args: {
28 | loading: true,
29 | style: { width: 800 },
30 | },
31 | };
32 |
33 | export const Error: Story = {
34 | args: {
35 | error: 'Error fetching items',
36 | style: { width: 800 },
37 | },
38 | };
39 |
40 | export const Empty: Story = {
41 | args: {
42 | data: [],
43 | style: { width: 800 },
44 | },
45 | };
46 |
--------------------------------------------------------------------------------
/src/components/dashboard/default/TasksListCard/styles.css:
--------------------------------------------------------------------------------
1 | .tasks-list-card .ant-card-body {
2 | /*padding: 0 0 1rem 0;*/
3 | }
4 |
5 | .tasks-list-card .ant-list-item {
6 | /*padding: 0;*/
7 | }
8 |
--------------------------------------------------------------------------------
/src/components/dashboard/default/WeeklyActivityCard/WeeklyActivityCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { WeeklyActivityCard } from './WeeklyActivityCard.tsx';
4 |
5 | const ACTIVITY_DATA = [
6 | {
7 | day: 'Monday',
8 | value: 10,
9 | },
10 | {
11 | day: 'Tuesday',
12 | value: 22,
13 | },
14 | {
15 | day: 'Wednesday',
16 | value: 25,
17 | },
18 | {
19 | day: 'Thursday',
20 | value: 26,
21 | },
22 | {
23 | day: 'Friday',
24 | value: 15,
25 | },
26 | {
27 | day: 'Saturday',
28 | value: 12,
29 | },
30 | {
31 | day: 'Sunday',
32 | value: 3,
33 | },
34 | ];
35 |
36 | const meta = {
37 | title: 'Components/Dashboard/Default/Activity card',
38 | component: WeeklyActivityCard,
39 | parameters: {
40 | layout: 'centered',
41 | },
42 | } satisfies Meta;
43 |
44 | export default meta;
45 |
46 | type Story = StoryObj;
47 |
48 | export const Default: Story = {
49 | args: {
50 | data: ACTIVITY_DATA,
51 | style: { width: 600 },
52 | },
53 | };
54 |
--------------------------------------------------------------------------------
/src/components/dashboard/default/WeeklyActivityCard/WeeklyActivityCard.tsx:
--------------------------------------------------------------------------------
1 | import { Area } from '@ant-design/charts';
2 | import { CardProps } from 'antd';
3 | import { Card } from '../../../index.ts';
4 |
5 | type Activity = {
6 | day: string;
7 | value: number;
8 | };
9 |
10 | type ChartProps = {
11 | data: Activity[];
12 | };
13 |
14 | const AreaChart = ({ data }: ChartProps) => {
15 | const config = {
16 | data,
17 | xField: 'day',
18 | yField: 'value',
19 | xAxis: {
20 | range: [0, 1],
21 | },
22 | smooth: true,
23 | };
24 |
25 | return ;
26 | };
27 |
28 | type Props = {
29 | data: Activity[];
30 | } & CardProps;
31 |
32 | export const WeeklyActivityCard = ({ data, ...others }: Props) => {
33 | return (
34 |
35 |
36 |
37 | );
38 | };
39 |
--------------------------------------------------------------------------------
/src/components/dashboard/default/index.ts:
--------------------------------------------------------------------------------
1 | export { CampaignsCard } from './CampaignsCard/CampaignsCard.tsx';
2 | export { EarningsCard } from './EarningsCard/EarningsCard.tsx';
3 | export { GetStartedCard } from './GetStartedCard/GetStartedCard.tsx';
4 | export { LatestOrdersCard } from './LatestOrdersCard/LatestOrdersCard.tsx';
5 | export { OrdersChart } from './OrdersChart/OrdersChart.tsx';
6 | export { RecentUsersCard } from './RecentUsersCard/RecentUsersCard.tsx';
7 | export { SubscribersChart } from './SubscribersChart/SubscribersChart.tsx';
8 | export { WeeklyActivityCard } from './WeeklyActivityCard/WeeklyActivityCard.tsx';
9 | export { TasksChartCard } from './TasksChartCard/TasksChartCard.tsx';
10 | export { TasksListCard } from './TasksListCard/TasksListCard.tsx';
11 |
--------------------------------------------------------------------------------
/src/components/dashboard/ecommerce/CustomerReviewsCard/CustomerReviewsCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { CustomerReviewsCard } from './CustomerReviewsCard.tsx';
4 |
5 | const meta = {
6 | title: 'Components/Dashboard/Ecommerce/Customer reviews card',
7 | component: CustomerReviewsCard,
8 | parameters: {
9 | layout: 'centered',
10 | },
11 | } satisfies Meta;
12 |
13 | export default meta;
14 |
15 | type Story = StoryObj;
16 |
17 | export const Default: Story = {
18 | args: {
19 | style: { width: 600 },
20 | },
21 | };
22 |
--------------------------------------------------------------------------------
/src/components/dashboard/ecommerce/index.ts:
--------------------------------------------------------------------------------
1 | export { CustomerReviewsCard } from './CustomerReviewsCard/CustomerReviewsCard.tsx';
2 |
--------------------------------------------------------------------------------
/src/components/dashboard/index.ts:
--------------------------------------------------------------------------------
1 | export {
2 | CampaignsCard,
3 | RecentUsersCard,
4 | GetStartedCard,
5 | OrdersChart,
6 | LatestOrdersCard,
7 | EarningsCard,
8 | SubscribersChart,
9 | WeeklyActivityCard,
10 | TasksChartCard,
11 | TasksListCard,
12 | } from './default';
13 | export { RevenueCard, PostsCard, ProjectsCard } from './shared';
14 | export { CustomerReviewsCard } from './ecommerce';
15 | export { ProjectsCountCard, ProjectsTable, ClientsTable } from './projects';
16 | export {
17 | StatsCard as MarketingStatsCard,
18 | VisitorsChartCard,
19 | SocialStatsCard as MarketingSocialStatsCard,
20 | CampaignsActivity,
21 | CampaignsAdsCard,
22 | AudienceLocationChart,
23 | } from './marketing';
24 | export {
25 | SocialStatsCard,
26 | FollowersChart,
27 | LikesChart,
28 | DevicesCardChart,
29 | MilestonesCard,
30 | CommentsCard,
31 | } from './social';
32 | export {
33 | AuctionCarousel,
34 | CreatorsCard,
35 | TopItemsCard,
36 | TransactionsCard,
37 | CategoriesCard as BiddingCategoriesCard,
38 | } from './bidding';
39 | export {
40 | StatsCard as LearningStatsCard,
41 | CoursesCard,
42 | CoursesCarousel,
43 | StudyStatisticsCard,
44 | ProgressCard,
45 | ExamsCard,
46 | CommunityGroupCard,
47 | } from './learning';
48 | export {
49 | StatsCard as LogisticsStatsCard,
50 | DeliveryTableCard,
51 | DeliveryAnalyticsCard,
52 | DailyPlanCard,
53 | TruckListCard,
54 | DeliveryRequestCard,
55 | } from './logistics';
56 |
--------------------------------------------------------------------------------
/src/components/dashboard/learning/CommunityGroupsCard/CommunityGroupCard.tsx:
--------------------------------------------------------------------------------
1 | import { Alert, Avatar, Button, CardProps, List, Typography } from 'antd';
2 | import { CommunityGroup } from '../../../../types';
3 | import { PlusOutlined } from '@ant-design/icons';
4 | import { Card } from '../../../index.ts';
5 | import { ReactNode } from 'react';
6 |
7 | import './styles.css';
8 |
9 | type Props = {
10 | data?: CommunityGroup[];
11 | loading?: boolean;
12 | error?: ReactNode;
13 | } & CardProps;
14 |
15 | export const CommunityGroupCard = ({
16 | data,
17 | loading,
18 | error,
19 | ...others
20 | }: Props) => {
21 | return (
22 | } />}
26 | {...others}
27 | >
28 | {error ? (
29 |
35 | ) : (
36 | {
42 | console.log(page);
43 | },
44 | pageSize: 5,
45 | align: 'center',
46 | }}
47 | dataSource={data}
48 | renderItem={(item) => (
49 |
50 |
58 | }
59 | title={{item.name} }
60 | description={`${item.size} Members`}
61 | />
62 |
63 | )}
64 | loading={loading}
65 | />
66 | )}
67 |
68 | );
69 | };
70 |
--------------------------------------------------------------------------------
/src/components/dashboard/learning/CommunityGroupsCard/CommunityGroupsCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import CommunityGroupsData from '../../../../../public/mocks/CommunityGroups.json';
3 |
4 | import { CommunityGroupCard } from './CommunityGroupCard.tsx';
5 |
6 | const meta = {
7 | title: 'Components/Dashboard/Learning/Communities card',
8 | component: CommunityGroupCard,
9 | parameters: {
10 | layout: 'centered',
11 | },
12 | tags: ['autodocs'],
13 | } satisfies Meta;
14 |
15 | export default meta;
16 |
17 | type Story = StoryObj;
18 |
19 | export const Default: Story = {
20 | args: {
21 | data: CommunityGroupsData.slice(0, 10),
22 | style: { width: 600 },
23 | },
24 | };
25 |
26 | export const Loading: Story = {
27 | args: {
28 | loading: true,
29 | data: [],
30 | style: { width: 600 },
31 | },
32 | };
33 |
34 | export const Error: Story = {
35 | args: {
36 | error: 'Error loading items',
37 | data: [],
38 | style: { width: 600 },
39 | },
40 | };
41 |
--------------------------------------------------------------------------------
/src/components/dashboard/learning/CommunityGroupsCard/styles.css:
--------------------------------------------------------------------------------
1 | .community-group-card .ant-card-body {
2 | padding: 0 0 1rem 0;
3 | }
4 |
5 | .community-group-list .ant-list-item {
6 | /*padding: 0;*/
7 | }
8 |
9 | .community-group-list .ant-list-item-meta {
10 | margin-block-end: 0 !important;
11 | align-items: center !important;
12 | }
13 |
14 | .community-group-list .ant-list-item-meta-title {
15 | text-transform: capitalize;
16 | font-weight: 500;
17 | margin-bottom: 0 !important;
18 | }
19 |
20 | .community-group-list .ant-list-item-meta-title a {
21 | font-size: 16px;
22 | }
23 |
--------------------------------------------------------------------------------
/src/components/dashboard/learning/CoursesCard/CoursesCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import CoursesData from '../../../../../public/mocks/Courses.json';
3 |
4 | import { CoursesCard } from './CoursesCard.tsx';
5 |
6 | const meta = {
7 | title: 'Components/Dashboard/Learning/Courses/Table',
8 | component: CoursesCard,
9 | parameters: {
10 | layout: 'centered',
11 | },
12 | tags: ['autodocs'],
13 | } satisfies Meta;
14 |
15 | export default meta;
16 |
17 | type Story = StoryObj;
18 |
19 | export const Default: Story = {
20 | args: {
21 | data: CoursesData.slice(0, 20),
22 | style: { width: 1000 },
23 | },
24 | };
25 |
26 | export const Loading: Story = {
27 | args: {
28 | loading: true,
29 | data: [],
30 | style: { width: 1000 },
31 | },
32 | };
33 |
34 | export const Error: Story = {
35 | args: {
36 | error: 'Error loading items',
37 | data: [],
38 | style: { width: 1000 },
39 | },
40 | };
41 |
--------------------------------------------------------------------------------
/src/components/dashboard/learning/CoursesCarousel/CoursesCaroursel.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import CoursesData from '../../../../../public/mocks/RecommendedCourses.json';
3 |
4 | import { CoursesCarousel } from './CoursesCarousel.tsx';
5 |
6 | const meta = {
7 | title: 'Components/Dashboard/Learning/Courses/Carousel',
8 | component: CoursesCarousel,
9 | parameters: {
10 | layout: 'centered',
11 | },
12 | } satisfies Meta;
13 |
14 | export default meta;
15 |
16 | type Story = StoryObj;
17 |
18 | export const Default: Story = {
19 | args: {
20 | data: CoursesData.slice(0, 5),
21 | style: { width: 600 },
22 | },
23 | };
24 |
--------------------------------------------------------------------------------
/src/components/dashboard/learning/CoursesCarousel/styles.css:
--------------------------------------------------------------------------------
1 | .courses-carousel-card .ant-card-body {
2 | /*padding-bottom: 0;*/
3 | }
4 |
--------------------------------------------------------------------------------
/src/components/dashboard/learning/ExamsCard/ExamsCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import ExamsData from '../../../../../public/mocks/Exams.json';
3 |
4 | import { ExamsCard } from './ExamsCard.tsx';
5 |
6 | const meta = {
7 | title: 'Components/Dashboard/Learning/Exams card',
8 | component: ExamsCard,
9 | parameters: {
10 | layout: 'centered',
11 | },
12 | tags: ['autodocs'],
13 | } satisfies Meta;
14 |
15 | export default meta;
16 |
17 | type Story = StoryObj;
18 |
19 | export const Default: Story = {
20 | args: {
21 | data: ExamsData.slice(0, 10),
22 | style: { width: 600 },
23 | },
24 | };
25 |
26 | export const Loading: Story = {
27 | args: {
28 | loading: true,
29 | data: [],
30 | style: { width: 600 },
31 | },
32 | };
33 |
34 | export const Error: Story = {
35 | args: {
36 | error: 'Error loading items',
37 | data: [],
38 | style: { width: 600 },
39 | },
40 | };
41 |
--------------------------------------------------------------------------------
/src/components/dashboard/learning/ExamsCard/ExamsCard.tsx:
--------------------------------------------------------------------------------
1 | import { Alert, Button, CardProps, Flex, List, Typography } from 'antd';
2 | import { Exam } from '../../../../types';
3 | import { RightOutlined } from '@ant-design/icons';
4 |
5 | import './styles.css';
6 | import { Card } from '../../../index.ts';
7 | import { ReactNode } from 'react';
8 | import { useMediaQuery } from 'react-responsive';
9 |
10 | type Props = {
11 | data?: Exam[];
12 | loading?: boolean;
13 | error?: ReactNode;
14 | } & CardProps;
15 |
16 | export const ExamsCard = ({ data, loading, error, ...others }: Props) => {
17 | const isLarge = useMediaQuery({ maxWidth: 1024 });
18 |
19 | return (
20 | See all upcoming exams]}
24 | {...others}
25 | >
26 | {error ? (
27 |
33 | ) : (
34 | {
39 | console.log(page);
40 | },
41 | pageSize: 5,
42 | align: 'center',
43 | }}
44 | dataSource={data}
45 | renderItem={(item) => (
46 |
47 |
48 |
49 |
50 | {item.course} - {item.course_code}
51 |
52 | Date: {item.exam_date}
53 |
54 | Duration: {item.exam_duration} mins
55 |
56 |
57 | } type="link" />
58 |
59 |
60 | )}
61 | loading={loading}
62 | />
63 | )}
64 |
65 | );
66 | };
67 |
--------------------------------------------------------------------------------
/src/components/dashboard/learning/ExamsCard/styles.css:
--------------------------------------------------------------------------------
1 | .exam-card .ant-card-body {
2 | padding: 0 0 1rem 0;
3 | }
4 |
--------------------------------------------------------------------------------
/src/components/dashboard/learning/ProgressCard/ProgressCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { ProgressCard } from './ProgressCard.tsx';
4 |
5 | const meta = {
6 | title: 'Components/Dashboard/Learning/Progress card',
7 | component: ProgressCard,
8 | parameters: {
9 | layout: 'centered',
10 | },
11 | } satisfies Meta;
12 |
13 | export default meta;
14 |
15 | type Story = StoryObj;
16 |
17 | export const Default: Story = {
18 | args: {
19 | style: { width: 600 },
20 | },
21 | };
22 |
--------------------------------------------------------------------------------
/src/components/dashboard/learning/StatsCard/StatsCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import { FileSyncOutlined } from '@ant-design/icons';
3 |
4 | import { StatsCard } from './StatsCard.tsx';
5 |
6 | const meta = {
7 | title: 'Components/Dashboard/Learning/Stats card',
8 | component: StatsCard,
9 | parameters: {
10 | layout: 'centered',
11 | },
12 | } satisfies Meta;
13 |
14 | export default meta;
15 |
16 | type Story = StoryObj;
17 |
18 | export const Default: Story = {
19 | args: {
20 | title: 'Courses in Progress',
21 | value: 18,
22 | icon: FileSyncOutlined,
23 | color: 'teal',
24 | progress: 30,
25 | style: { width: 600 },
26 | },
27 | };
28 |
--------------------------------------------------------------------------------
/src/components/dashboard/learning/StatsCard/StatsCard.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { CardProps, Flex, Progress, Typography } from 'antd';
3 | import { Card } from '../../../index.ts';
4 | import CountUp from 'react-countup';
5 |
6 | type Props = {
7 | title: string;
8 | value: number;
9 | icon: any;
10 | color: string;
11 | progress: number;
12 | } & CardProps;
13 |
14 | export const StatsCard = ({
15 | color,
16 | icon,
17 | title,
18 | value,
19 | progress,
20 | ...others
21 | }: Props) => {
22 | return (
23 |
24 |
25 | {React.createElement(icon, { style: { fontSize: 30 } })}
26 |
27 | {title}
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | );
36 | };
37 |
--------------------------------------------------------------------------------
/src/components/dashboard/learning/StudyStatisticsCard/StudyStatisticsCard.tsx:
--------------------------------------------------------------------------------
1 | import { Alert, CardProps } from 'antd';
2 | import { Heatmap } from '@ant-design/charts';
3 | import { ReactNode, useEffect, useState } from 'react';
4 | import * as _ from 'lodash';
5 | import { Card, Loader } from '../../../index.ts';
6 |
7 | type StudyStatistics = {
8 | id: string;
9 | value: number;
10 | category: string;
11 | month: string;
12 | total?: number;
13 | };
14 |
15 | type ColumnChartProps = { data: StudyStatistics[] };
16 |
17 | const ColumnChart = ({ data }: ColumnChartProps) => {
18 | const [refinedData, setRefinedData] = useState([]);
19 |
20 | useEffect(() => {
21 | const formattedData = _.sortBy(data, (item) => {
22 | // Map the month names to their corresponding numerical values for sorting
23 | const monthMap: { [key: string]: number } = {
24 | Jan: 1,
25 | Feb: 2,
26 | Mar: 3,
27 | Apr: 4,
28 | May: 5,
29 | Jun: 6,
30 | Jul: 7,
31 | Aug: 8,
32 | Sept: 9,
33 | Oct: 10,
34 | Nov: 11,
35 | Dec: 12,
36 | };
37 | // Use the numerical value for sorting
38 | return monthMap[item.month];
39 | });
40 | setRefinedData(formattedData);
41 | }, [data]);
42 |
43 | const config = {
44 | // width: 650,
45 | // height: 400,
46 | autoFit: true,
47 | data: refinedData,
48 | xField: 'month',
49 | yField: 'category',
50 | colorField: 'value',
51 | // color: ['#174c83', '#7eb6d4', '#efefeb', '#efa759', '#9b4d16'],
52 | meta: {
53 | 'Month of Year': {
54 | type: 'cat',
55 | },
56 | },
57 | };
58 |
59 | // @ts-ignore
60 | return ;
61 | };
62 |
63 | type Props = {
64 | data?: StudyStatistics[];
65 | loading?: boolean;
66 | error?: ReactNode;
67 | } & CardProps;
68 |
69 | export const StudyStatisticsCard = ({
70 | data,
71 | error,
72 | loading,
73 | ...others
74 | }: Props) => {
75 | return (
76 |
77 | {error ? (
78 |
84 | ) : loading ? (
85 |
86 | ) : (
87 |
88 | )}
89 |
90 | );
91 | };
92 |
--------------------------------------------------------------------------------
/src/components/dashboard/learning/StudyStatisticsCard/StudyStatisticssCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import StudyData from '../../../../../public/mocks/StudyStatistics.json';
3 |
4 | import { StudyStatisticsCard } from './StudyStatisticsCard.tsx';
5 |
6 | const meta = {
7 | title: 'Components/Dashboard/Learning/Study stats card',
8 | component: StudyStatisticsCard,
9 | parameters: {
10 | layout: 'centered',
11 | },
12 | tags: ['autodocs'],
13 | } satisfies Meta;
14 |
15 | export default meta;
16 |
17 | type Story = StoryObj;
18 |
19 | export const Default: Story = {
20 | args: {
21 | data: StudyData,
22 | style: { width: 600 },
23 | },
24 | };
25 |
26 | export const Loading: Story = {
27 | args: {
28 | loading: true,
29 | data: [],
30 | style: { width: 600 },
31 | },
32 | };
33 |
34 | export const Error: Story = {
35 | args: {
36 | error: 'Error loading items',
37 | data: [],
38 | style: { width: 600 },
39 | },
40 | };
41 |
--------------------------------------------------------------------------------
/src/components/dashboard/learning/index.ts:
--------------------------------------------------------------------------------
1 | export { StatsCard } from './StatsCard/StatsCard.tsx';
2 | export { CoursesCard } from './CoursesCard/CoursesCard.tsx';
3 | export { CoursesCarousel } from './CoursesCarousel/CoursesCarousel.tsx';
4 | export { StudyStatisticsCard } from './StudyStatisticsCard/StudyStatisticsCard.tsx';
5 | export { ProgressCard } from './ProgressCard/ProgressCard.tsx';
6 | export { ExamsCard } from './ExamsCard/ExamsCard.tsx';
7 | export { CommunityGroupCard } from './CommunityGroupsCard/CommunityGroupCard.tsx';
8 |
--------------------------------------------------------------------------------
/src/components/dashboard/logistics/DailyPlanCard/DailyPlanCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { DailyPlanCard } from './DailyPlanCard.tsx';
4 |
5 | const PLAN_DATA = [
6 | {
7 | type: 'Shipment processed',
8 | value: 38,
9 | },
10 | {
11 | type: 'Orders processed',
12 | value: 52,
13 | },
14 | {
15 | type: 'Requests queue',
16 | value: 61,
17 | },
18 | ];
19 |
20 | const meta = {
21 | title: 'Components/Dashboard/Logistics/Daily plan',
22 | component: DailyPlanCard,
23 | parameters: {
24 | layout: 'centered',
25 | },
26 | } satisfies Meta;
27 |
28 | export default meta;
29 |
30 | type Story = StoryObj;
31 |
32 | export const Default: Story = {
33 | args: {
34 | data: PLAN_DATA,
35 | style: { width: 600 },
36 | },
37 | };
38 |
--------------------------------------------------------------------------------
/src/components/dashboard/logistics/DailyPlanCard/DailyPlanCard.tsx:
--------------------------------------------------------------------------------
1 | import { Bar } from '@ant-design/charts';
2 | import { CardProps } from 'antd';
3 | import { Card } from '../../../index.ts';
4 |
5 | type Plan = {
6 | type: string;
7 | value: number;
8 | };
9 |
10 | type BarProps = {
11 | data: Plan[];
12 | };
13 |
14 | const BarChart = ({ data }: BarProps) => {
15 | const config = {
16 | data,
17 | xField: 'value',
18 | yField: 'type',
19 | seriesField: 'type',
20 | legend: {
21 | position: 'top-left',
22 | },
23 | };
24 | // @ts-ignore
25 | return ;
26 | };
27 |
28 | type Props = {
29 | data?: Plan[];
30 | } & CardProps;
31 |
32 | export const DailyPlanCard = ({ data, ...others }: Props) => {
33 | return (
34 |
35 |
36 |
37 | );
38 | };
39 |
--------------------------------------------------------------------------------
/src/components/dashboard/logistics/DeliveryAnalyticsCard/DeliveryAnalyticsCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import DeliveryAnalytics from '../../../../../public/mocks/DeliveryAnalytics.json';
3 |
4 | import { DeliveryAnalyticsCard } from './DeliveryAnalyticsCard.tsx';
5 |
6 | const meta = {
7 | title: 'Components/Dashboard/Logistics/Delivery/Analytics',
8 | component: DeliveryAnalyticsCard,
9 | parameters: {
10 | layout: 'centered',
11 | },
12 | tags: ['autodocs'],
13 | } satisfies Meta;
14 |
15 | export default meta;
16 |
17 | type Story = StoryObj;
18 |
19 | export const Default: Story = {
20 | args: {
21 | data: DeliveryAnalytics.slice(0, 10),
22 | style: { width: 600 },
23 | },
24 | };
25 |
26 | export const Loading: Story = {
27 | args: {
28 | loading: true,
29 | data: [],
30 | style: { width: 600 },
31 | },
32 | };
33 |
34 | export const Error: Story = {
35 | args: {
36 | error: 'Error loading items',
37 | data: [],
38 | style: { width: 600 },
39 | },
40 | };
41 |
--------------------------------------------------------------------------------
/src/components/dashboard/logistics/DeliveryRequestCard/DeliveryRequestCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import TruckDeliveryRequest from '../../../../../public/mocks/TruckDeliveryRequest.json';
3 |
4 | import { DeliveryRequestCard } from './DeliveryRequestCard.tsx';
5 |
6 | const meta = {
7 | title: 'Components/Dashboard/Logistics/Delivery/Requests',
8 | component: DeliveryRequestCard,
9 | parameters: {
10 | layout: 'centered',
11 | },
12 | tags: ['autodocs'],
13 | } satisfies Meta;
14 |
15 | export default meta;
16 |
17 | type Story = StoryObj;
18 |
19 | export const Default: Story = {
20 | args: {
21 | data: TruckDeliveryRequest.slice(0, 10),
22 | style: { width: 600 },
23 | },
24 | };
25 |
26 | export const Loading: Story = {
27 | args: {
28 | loading: true,
29 | data: [],
30 | style: { width: 600 },
31 | },
32 | };
33 |
34 | export const Error: Story = {
35 | args: {
36 | error: 'Error loading items',
37 | data: [],
38 | style: { width: 600 },
39 | },
40 | };
41 |
--------------------------------------------------------------------------------
/src/components/dashboard/logistics/DeliveryRequestCard/styles.css:
--------------------------------------------------------------------------------
1 | .delivery-request-card .ant-card-body {
2 | padding: 0 0 1rem 0;
3 | }
4 |
5 | .delivery-request-list .ant-card-body {
6 | padding: 1rem;
7 | }
8 |
--------------------------------------------------------------------------------
/src/components/dashboard/logistics/DeliveryTableCard/DeliveryTableCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import TruckDeliveryRequest from '../../../../../public/mocks/TruckDeliveries.json';
3 |
4 | import { DeliveryTableCard } from './DeliveryTableCard.tsx';
5 |
6 | const meta = {
7 | title: 'Components/Dashboard/Logistics/Delivery/Table',
8 | component: DeliveryTableCard,
9 | parameters: {
10 | layout: 'centered',
11 | },
12 | tags: ['autodocs'],
13 | } satisfies Meta;
14 |
15 | export default meta;
16 |
17 | type Story = StoryObj;
18 |
19 | export const Default: Story = {
20 | args: {
21 | data: TruckDeliveryRequest.slice(0, 10),
22 | style: { width: 1000 },
23 | },
24 | };
25 |
26 | export const Loading: Story = {
27 | args: {
28 | loading: true,
29 | data: [],
30 | style: { width: 1000 },
31 | },
32 | };
33 |
34 | export const Error: Story = {
35 | args: {
36 | error: 'Error loading items',
37 | data: [],
38 | style: { width: 1000 },
39 | },
40 | };
41 |
--------------------------------------------------------------------------------
/src/components/dashboard/logistics/StatsCard/StatsCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import { BlockOutlined } from '@ant-design/icons';
3 |
4 | import { StatsCard } from './StatsCard.tsx';
5 |
6 | const STATS = {
7 | icon: BlockOutlined,
8 | value: 1245,
9 | title: 'new packages',
10 | diff: 16,
11 | };
12 |
13 | const meta = {
14 | title: 'Components/Dashboard/Logistics/Stats',
15 | component: StatsCard,
16 | parameters: {
17 | layout: 'centered',
18 | },
19 | } satisfies Meta;
20 |
21 | export default meta;
22 |
23 | type Story = StoryObj;
24 |
25 | export const Default: Story = {
26 | args: {
27 | ...STATS,
28 | style: { width: 240 },
29 | },
30 | };
31 |
--------------------------------------------------------------------------------
/src/components/dashboard/logistics/StatsCard/StatsCard.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { CardProps, Flex, Typography } from 'antd';
3 | import { ArrowDownOutlined, ArrowUpOutlined } from '@ant-design/icons';
4 | import { green, red } from '@ant-design/colors';
5 | import { Card } from '../../../index.ts';
6 | import CountUp from 'react-countup';
7 |
8 | type Props = {
9 | title: string;
10 | value: number;
11 | diff: number;
12 | icon: any;
13 | } & CardProps;
14 |
15 | export const StatsCard = ({ icon, title, value, diff, ...others }: Props) => {
16 | return (
17 |
18 |
19 | {React.createElement(icon, { style: { fontSize: 30 } })}
20 |
21 | {title}
22 |
23 |
24 |
25 |
26 |
27 | 0 ? green[5] : red[5] }}
30 | >
31 | {diff}%
32 | {diff > 0 ? : }
33 |
34 |
35 |
36 |
37 | );
38 | };
39 |
--------------------------------------------------------------------------------
/src/components/dashboard/logistics/TrucksListCard/TruckListCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import TrucksData from '../../../../../public/mocks/Trucks.json';
3 |
4 | import { TruckListCard } from './TruckListCard.tsx';
5 |
6 | const meta = {
7 | title: 'Components/Dashboard/Logistics/Trucks list',
8 | component: TruckListCard,
9 | parameters: {
10 | layout: 'centered',
11 | },
12 | tags: ['autodocs'],
13 | } satisfies Meta;
14 |
15 | export default meta;
16 |
17 | type Story = StoryObj;
18 |
19 | export const Default: Story = {
20 | args: {
21 | data: TrucksData.slice(0, 10),
22 | style: { width: 600 },
23 | },
24 | };
25 |
26 | export const Loading: Story = {
27 | args: {
28 | loading: true,
29 | data: [],
30 | style: { width: 600 },
31 | },
32 | };
33 |
34 | export const Error: Story = {
35 | args: {
36 | error: 'Error loading items',
37 | data: [],
38 | style: { width: 600 },
39 | },
40 | };
41 |
--------------------------------------------------------------------------------
/src/components/dashboard/logistics/TrucksListCard/styles.css:
--------------------------------------------------------------------------------
1 | .available-tucks-card .ant-card-body {
2 | padding: 0 0 1rem 0;
3 | }
4 |
5 | .available-tucks-card .ant-list-item {
6 | /*padding: 0;*/
7 | }
8 |
--------------------------------------------------------------------------------
/src/components/dashboard/logistics/index.ts:
--------------------------------------------------------------------------------
1 | export { StatsCard } from './StatsCard/StatsCard.tsx';
2 | export { DeliveryTableCard } from './DeliveryTableCard/DeliveryTableCard.tsx';
3 | export { DeliveryAnalyticsCard } from './DeliveryAnalyticsCard/DeliveryAnalyticsCard.tsx';
4 | export { DailyPlanCard } from './DailyPlanCard/DailyPlanCard.tsx';
5 | export { TruckListCard } from './TrucksListCard/TruckListCard.tsx';
6 | export { DeliveryRequestCard } from './DeliveryRequestCard/DeliveryRequestCard.tsx';
7 |
--------------------------------------------------------------------------------
/src/components/dashboard/marketing/AudienceLocationChart/AudienceLocationChart.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { AudienceLocationChart } from './AudienceLocationChart.tsx';
4 |
5 | const meta = {
6 | title: 'Components/Dashboard/Marketing/Audience chart',
7 | component: AudienceLocationChart,
8 | parameters: {
9 | layout: 'centered',
10 | },
11 | } satisfies Meta;
12 |
13 | export default meta;
14 |
15 | type Story = StoryObj;
16 |
17 | export const Default: Story = {
18 | args: {
19 | style: { width: 600 },
20 | },
21 | };
22 |
--------------------------------------------------------------------------------
/src/components/dashboard/marketing/CampaignsActivity/CampaignsActivity.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { CampaignsActivity } from './CampaignsActivity.tsx';
4 |
5 | const meta = {
6 | title: 'Components/Dashboard/Marketing/Campaigns/Calendar',
7 | component: CampaignsActivity,
8 | parameters: {
9 | layout: 'centered',
10 | },
11 | } satisfies Meta;
12 |
13 | export default meta;
14 |
15 | type Story = StoryObj;
16 |
17 | export const Default: Story = {
18 | args: {
19 | style: { width: 600 },
20 | },
21 | };
22 |
--------------------------------------------------------------------------------
/src/components/dashboard/marketing/CampaignsActivity/CampaignsActivity.tsx:
--------------------------------------------------------------------------------
1 | import { Button, Calendar, CalendarProps, CardProps, Popover } from 'antd';
2 | import type { Dayjs } from 'dayjs';
3 | import { QuestionOutlined } from '@ant-design/icons';
4 | import { Card } from '../../../index.ts';
5 |
6 | const onPanelChange = (value: Dayjs, mode: CalendarProps['mode']) => {
7 | console.log(value.format('YYYY-MM-DD'), mode);
8 | };
9 |
10 | type Props = CardProps;
11 |
12 | export const CampaignsActivity = ({ ...others }: Props) => {
13 | return (
14 |
18 | } type="text" />
19 |
20 | }
21 | {...others}
22 | >
23 |
24 |
25 | );
26 | };
27 |
--------------------------------------------------------------------------------
/src/components/dashboard/marketing/CampaignsAdsCard/CampaignAdsCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import CampaignsData from '../../../../../public/mocks/CampaignAds.json';
3 |
4 | import { CampaignsAdsCard } from './CampaignsAdsCard.tsx';
5 |
6 | const meta = {
7 | title: 'Components/Dashboard/Marketing/Campaigns/Ads stats',
8 | component: CampaignsAdsCard,
9 | parameters: {
10 | layout: 'centered',
11 | },
12 | tags: ['autodocs'],
13 | } satisfies Meta;
14 |
15 | export default meta;
16 |
17 | type Story = StoryObj;
18 |
19 | export const Default: Story = {
20 | args: {
21 | data: CampaignsData.slice(0, 10),
22 | style: { width: 1000 },
23 | },
24 | };
25 |
26 | export const Loading: Story = {
27 | args: {
28 | loading: true,
29 | data: [],
30 | style: { width: 1000 },
31 | },
32 | };
33 |
34 | export const Error: Story = {
35 | args: {
36 | error: 'Error loading items',
37 | data: [],
38 | style: { width: 1000 },
39 | },
40 | };
41 |
--------------------------------------------------------------------------------
/src/components/dashboard/marketing/SocialStatsCard/SocialStatsCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { SocialStatsCard } from './SocialStatsCard.tsx';
4 |
5 | const meta = {
6 | title: 'Components/Dashboard/Marketing/Social stats',
7 | component: SocialStatsCard,
8 | parameters: {
9 | layout: 'centered',
10 | },
11 | } satisfies Meta;
12 |
13 | export default meta;
14 |
15 | type Story = StoryObj;
16 |
17 | export const Default: Story = {
18 | args: {
19 | style: { width: 600 },
20 | },
21 | };
22 |
--------------------------------------------------------------------------------
/src/components/dashboard/marketing/StatsCard/StatsCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { StatsCard } from './StatsCard.tsx';
4 |
5 | const STATS = {
6 | data: [274, 337, 81, 497],
7 | title: 'impressions',
8 | diff: 12.5,
9 | value: 16826,
10 | };
11 |
12 | const meta = {
13 | title: 'Components/Dashboard/Marketing/Stats',
14 | component: StatsCard,
15 | parameters: {
16 | layout: 'centered',
17 | },
18 | tags: ['autodocs'],
19 | } satisfies Meta;
20 |
21 | export default meta;
22 |
23 | type Story = StoryObj;
24 |
25 | export const Default: Story = {
26 | args: {
27 | ...STATS,
28 | data: [274, 337, 81, 497],
29 | style: { width: 600 },
30 | },
31 | };
32 |
33 | export const AsCurrency: Story = {
34 | args: {
35 | ...STATS,
36 | title: 'Revenue',
37 | data: [274, 337, 81, 497],
38 | asCurrency: true,
39 | diff: -2.5,
40 | style: { width: 600 },
41 | },
42 | };
43 |
--------------------------------------------------------------------------------
/src/components/dashboard/marketing/StatsCard/StatsCard.tsx:
--------------------------------------------------------------------------------
1 | import { CardProps, Col, Flex, Row, Tag, Typography } from 'antd';
2 | import { TinyColumn } from '@ant-design/charts';
3 | import { Card } from '../../../index.ts';
4 | import CountUp from 'react-countup';
5 |
6 | type ChartData = [number, number, number, number];
7 |
8 | type StatsColumnChartProps = {
9 | data: ChartData;
10 | color?: string;
11 | };
12 |
13 | const ColumnChart = ({ data, color }: StatsColumnChartProps) => {
14 | const brandColor = color || '#5B8FF9';
15 | const config = {
16 | height: 64,
17 | autoFit: true,
18 | data,
19 | color: brandColor,
20 | tooltip: {
21 | customContent: function (x: any, data: any) {
22 | return `NO.${x}: ${data[0]?.data?.y.toFixed(2)}`;
23 | },
24 | },
25 | };
26 | return ;
27 | };
28 |
29 | type Props = {
30 | title: string;
31 | value: number | string;
32 | data: ChartData;
33 | diff: number;
34 | asCurrency?: boolean;
35 | } & CardProps;
36 |
37 | export const StatsCard = ({
38 | data,
39 | diff,
40 | title,
41 | value,
42 | asCurrency,
43 | ...others
44 | }: Props) => {
45 | return (
46 |
47 |
48 |
49 | {title}
50 |
51 |
52 |
53 |
54 | {typeof value === 'number' ? (
55 | <>
56 | {asCurrency && $ }
57 |
58 | >
59 | ) : (
60 | value
61 | )}
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | {diff}%
70 | compared to last month.
71 |
72 |
73 |
74 | );
75 | };
76 |
--------------------------------------------------------------------------------
/src/components/dashboard/marketing/VisitorsChartCard/VisitorsChartCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { VisitorsChartCard } from './VisitorsChartCard.tsx';
4 |
5 | const meta = {
6 | title: 'Components/Dashboard/Marketing/Visitors',
7 | component: VisitorsChartCard,
8 | parameters: {
9 | layout: 'centered',
10 | },
11 | } satisfies Meta;
12 |
13 | export default meta;
14 |
15 | type Story = StoryObj;
16 |
17 | export const Default: Story = {
18 | args: {
19 | style: { width: 600 },
20 | },
21 | };
22 |
--------------------------------------------------------------------------------
/src/components/dashboard/marketing/VisitorsChartCard/VisitorsChartCard.tsx:
--------------------------------------------------------------------------------
1 | import { Button, CardProps } from 'antd';
2 | import { RightOutlined } from '@ant-design/icons';
3 | import { Area } from '@ant-design/charts';
4 | import { Card } from '../../../index.ts';
5 |
6 | const AreaChart = () => {
7 | const data = [
8 | {
9 | timePeriod: '1 Aug',
10 | value: 6789,
11 | },
12 | {
13 | timePeriod: '2 Aug',
14 | value: 4123,
15 | },
16 | {
17 | timePeriod: '3 Aug',
18 | value: 7142,
19 | },
20 | {
21 | timePeriod: '4 Aug',
22 | value: 8461,
23 | },
24 | {
25 | timePeriod: '5 Aug',
26 | value: 10393,
27 | },
28 | {
29 | timePeriod: '6 Aug',
30 | value: 20381,
31 | },
32 | {
33 | timePeriod: '7 Aug',
34 | value: 19381,
35 | },
36 | {
37 | timePeriod: '8 Aug',
38 | value: 5693,
39 | },
40 | {
41 | timePeriod: '9 Aug',
42 | value: 11283,
43 | },
44 | {
45 | timePeriod: '10 Aug',
46 | value: 17621,
47 | },
48 | ];
49 |
50 | const config = {
51 | data,
52 | xField: 'timePeriod',
53 | yField: 'value',
54 | xAxis: {
55 | range: [0, 1],
56 | },
57 | smooth: true,
58 | };
59 |
60 | return ;
61 | };
62 |
63 | type Props = CardProps;
64 |
65 | export const VisitorsChartCard = ({ ...others }: Props) => {
66 | return (
67 |
71 | More details
72 |
73 | }
74 | {...others}
75 | >
76 |
77 |
78 | );
79 | };
80 |
--------------------------------------------------------------------------------
/src/components/dashboard/marketing/index.ts:
--------------------------------------------------------------------------------
1 | export { StatsCard } from './StatsCard/StatsCard.tsx';
2 | export { VisitorsChartCard } from './VisitorsChartCard/VisitorsChartCard.tsx';
3 | export { SocialStatsCard } from './SocialStatsCard/SocialStatsCard.tsx';
4 | export { CampaignsActivity } from './CampaignsActivity/CampaignsActivity.tsx';
5 | export { CampaignsAdsCard } from './CampaignsAdsCard/CampaignsAdsCard.tsx';
6 | export { AudienceLocationChart } from './AudienceLocationChart/AudienceLocationChart.tsx';
7 |
--------------------------------------------------------------------------------
/src/components/dashboard/projects/ClientsTable/ClientsTable.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import ClientsData from '../../../../../public/mocks/Clients.json';
3 |
4 | import { ClientsTable } from './ClientsTable.tsx';
5 |
6 | const meta = {
7 | title: 'Components/Dashboard/Projects/Clients',
8 | component: ClientsTable,
9 | parameters: {
10 | layout: 'centered',
11 | },
12 | } satisfies Meta;
13 |
14 | export default meta;
15 |
16 | type Story = StoryObj;
17 |
18 | export const Default: Story = {
19 | args: {
20 | data: ClientsData.slice(0, 10),
21 | style: { width: 600 },
22 | },
23 | };
24 |
--------------------------------------------------------------------------------
/src/components/dashboard/projects/ClientsTable/ClientsTable.tsx:
--------------------------------------------------------------------------------
1 | import { Table, TableProps, Typography } from 'antd';
2 | import { Clients } from '../../../../types';
3 | import { UserAvatar } from '../../../index.ts';
4 |
5 | const COLUMNS = [
6 | {
7 | title: 'Client Name',
8 | dataIndex: 'client_name',
9 | key: 'c_name',
10 | render: (_: any, { first_name, last_name }: Clients) => (
11 |
12 | ),
13 | },
14 | {
15 | title: 'Amount',
16 | dataIndex: 'total_price',
17 | key: 'client_amount',
18 | render: (_: any) => ${_} ,
19 | },
20 | ];
21 |
22 | type Props = {
23 | data: Clients[];
24 | } & TableProps;
25 |
26 | export const ClientsTable = ({ data, ...others }: Props) => (
27 |
35 | );
36 |
--------------------------------------------------------------------------------
/src/components/dashboard/projects/ProjectsCountCard/ProjectsCountCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { ProjectsCountCard } from './ProjectsCountCard.tsx';
4 |
5 | const meta = {
6 | title: 'Components/Dashboard/Projects/Project count',
7 | component: ProjectsCountCard,
8 | parameters: {
9 | layout: 'centered',
10 | },
11 | } satisfies Meta;
12 |
13 | export default meta;
14 |
15 | type Story = StoryObj;
16 |
17 | export const Default: Story = {
18 | args: {
19 | style: { width: 600 },
20 | },
21 | };
22 |
--------------------------------------------------------------------------------
/src/components/dashboard/projects/ProjectsCountCard/styles.scss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/src/components/dashboard/projects/ProjectsCountCard/styles.scss
--------------------------------------------------------------------------------
/src/components/dashboard/projects/ProjectsTables/ProjectsTable.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import ProjectsData from '../../../../../public/mocks/Projects.json';
3 |
4 | import { ProjectsTable } from './ProjectsTable.tsx';
5 |
6 | const meta = {
7 | title: 'Components/Dashboard/Projects/Projects table',
8 | component: ProjectsTable,
9 | parameters: {
10 | layout: 'centered',
11 | },
12 | } satisfies Meta;
13 |
14 | export default meta;
15 |
16 | type Story = StoryObj;
17 |
18 | export const Default: Story = {
19 | args: {
20 | data: ProjectsData.slice(0, 10),
21 | style: { width: 1000 },
22 | },
23 | };
24 |
--------------------------------------------------------------------------------
/src/components/dashboard/projects/index.ts:
--------------------------------------------------------------------------------
1 | export { ClientsTable } from './ClientsTable/ClientsTable.tsx';
2 | export { ProjectsCountCard } from './ProjectsCountCard/ProjectsCountCard.tsx';
3 | export { ProjectsTable } from './ProjectsTables/ProjectsTable.tsx';
4 |
--------------------------------------------------------------------------------
/src/components/dashboard/shared/PostsCard/PostsCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import PostsData from '../../../../../public/mocks/ScheduledPosts.json';
3 |
4 | import { PostsCard } from './PostsCard.tsx';
5 |
6 | const meta = {
7 | title: 'Components/Posts list',
8 | component: PostsCard,
9 | parameters: {
10 | layout: 'centered',
11 | },
12 | tags: ['autodocs'],
13 | } satisfies Meta;
14 |
15 | export default meta;
16 |
17 | type Story = StoryObj;
18 |
19 | export const Active: Story = {
20 | args: {
21 | as: 'active',
22 | data: PostsData.slice(0, 10),
23 | style: { width: 600 },
24 | },
25 | };
26 |
27 | export const Scheduled: Story = {
28 | args: {
29 | as: 'scheduled',
30 | data: PostsData.slice(0, 10),
31 | style: { width: 600 },
32 | },
33 | };
34 |
--------------------------------------------------------------------------------
/src/components/dashboard/shared/PostsCard/styles.css:
--------------------------------------------------------------------------------
1 | .posts-lists-card .ant-card-body {
2 | padding: 0 0 1rem 0;
3 | }
4 |
5 | .available-tucks-card .ant-list-item {
6 | /*padding: 0;*/
7 | }
8 |
--------------------------------------------------------------------------------
/src/components/dashboard/shared/ProjectsCard/ProjectsCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { ProjectsCard } from './ProjectsCard.tsx';
4 |
5 | const DATA = {
6 | project_id: 'ea74b32d-6466-4ef7-87cb-a17e0c38c1a8',
7 | project_name:
8 | 'aenean sit amet justo morbi ut odio cras mi pede malesuada in imperdiet et commodo vulputate justo in blandit ultrices',
9 | start_date: '10/2/2022',
10 | end_date: '3/13/2022',
11 | budget: 'Peso',
12 | project_manager: 'Dael Bulward',
13 | client_name: 'Topicblab',
14 | status: 'in progress',
15 | priority: 'medium',
16 | team_size: 17,
17 | project_description:
18 | 'Aliquam quis turpis eget elit sodales scelerisque. Mauris sit amet eros. Suspendisse accumsan tortor quis turpis.\n\nSed ante. Vivamus tortor. Duis mattis egestas metus.\n\nAenean fermentum. Donec ut mauris eget massa tempor convallis. Nulla neque libero, convallis eget, eleifend luctus, ultricies eu, nibh.',
19 | project_location: 'Palermo',
20 | project_type: 'marketing',
21 | project_category: 'government',
22 | project_duration: 6.1,
23 | };
24 |
25 | const meta = {
26 | title: 'Components/Project',
27 | component: ProjectsCard,
28 | parameters: {
29 | layout: 'centered',
30 | },
31 | tags: ['autodocs'],
32 | } satisfies Meta;
33 |
34 | export default meta;
35 |
36 | type Story = StoryObj;
37 |
38 | export const Default: Story = {
39 | args: {
40 | project: DATA,
41 | style: { width: 600 },
42 | },
43 | };
44 |
45 | export const Small: Story = {
46 | args: {
47 | project: DATA,
48 | size: 'small',
49 | style: { width: 400 },
50 | },
51 | };
52 |
--------------------------------------------------------------------------------
/src/components/dashboard/shared/ProjectsCard/styles.css:
--------------------------------------------------------------------------------
1 | .project-small-card .ant-card-body {
2 | }
3 |
--------------------------------------------------------------------------------
/src/components/dashboard/shared/RevenueCard/RevenueCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { RevenueCard } from './RevenueCard.tsx';
4 |
5 | const meta = {
6 | title: 'Components/Revenue',
7 | component: RevenueCard,
8 | parameters: {
9 | layout: 'centered',
10 | },
11 | tags: ['autodocs'],
12 | } satisfies Meta;
13 |
14 | export default meta;
15 |
16 | type Story = StoryObj;
17 |
18 | export const Default: Story = {
19 | args: {
20 | title: 'Visitors',
21 | value: 20149,
22 | diff: 5.54,
23 | style: { width: 320 },
24 | },
25 | };
26 |
--------------------------------------------------------------------------------
/src/components/dashboard/shared/RevenueCard/RevenueCard.tsx:
--------------------------------------------------------------------------------
1 | import { CardProps, Flex, Space, Typography } from 'antd';
2 | import { ArrowDownOutlined, ArrowUpOutlined } from '@ant-design/icons';
3 | import { green, red } from '@ant-design/colors';
4 | import CountUp from 'react-countup';
5 | import { Card } from '../../../index.ts';
6 | import { CSSProperties } from 'react';
7 |
8 | type Props = {
9 | title: string;
10 | value: string | number;
11 | diff: number;
12 | justify?: CSSProperties['justifyContent'];
13 | height?: number;
14 | } & CardProps;
15 |
16 | export const RevenueCard = (props: Props) => {
17 | const { title, value, diff, justify, height, ...others } = props;
18 |
19 | return (
20 |
21 |
27 | {title}
28 |
29 |
30 | {typeof value === 'number' ? (
31 | <>
32 | $
33 |
34 | >
35 | ) : (
36 | {value}
37 | )}
38 |
39 | 0 ? green[6] : red[5] }}>
40 | {diff > 0 ? : }
41 | 0 ? green[6] : red[5],
44 | fontWeight: 500,
45 | }}
46 | >
47 | %
48 |
49 |
50 |
51 |
52 |
53 | );
54 | };
55 |
--------------------------------------------------------------------------------
/src/components/dashboard/shared/index.ts:
--------------------------------------------------------------------------------
1 | export { RevenueCard } from './RevenueCard/RevenueCard.tsx';
2 | export { PostsCard } from './PostsCard/PostsCard.tsx';
3 | export { ProjectsCard } from './ProjectsCard/ProjectsCard.tsx';
4 |
--------------------------------------------------------------------------------
/src/components/dashboard/social/CommentsCard/CommentsCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 | import SocialsCommentsData from '../../../../../public/mocks/SocialComments.json';
3 |
4 | import { CommentsCard } from './CommentsCard.tsx';
5 |
6 | const meta = {
7 | title: 'Components/Dashboard/Social/Comments',
8 | component: CommentsCard,
9 | parameters: {
10 | layout: 'centered',
11 | },
12 | tags: ['autodocs'],
13 | } satisfies Meta;
14 |
15 | export default meta;
16 |
17 | type Story = StoryObj;
18 |
19 | export const Default: Story = {
20 | args: {
21 | data: SocialsCommentsData.slice(0, 5),
22 | style: { width: 600 },
23 | },
24 | };
25 |
26 | export const Loading: Story = {
27 | args: {
28 | loading: true,
29 | style: { width: 600 },
30 | },
31 | };
32 |
33 | export const Error: Story = {
34 | args: {
35 | error: 'Error fetching items',
36 | style: { width: 600 },
37 | },
38 | };
39 |
40 | export const Empty: Story = {
41 | args: {
42 | data: [],
43 | style: { width: 600 },
44 | },
45 | };
46 |
--------------------------------------------------------------------------------
/src/components/dashboard/social/CommentsCard/styles.css:
--------------------------------------------------------------------------------
1 | .comments-lists-card .ant-card-body {
2 | /*padding: 1rem 0 1rem 0;*/
3 | }
4 |
5 | .available-tucks-card .ant-list-item {
6 | /*padding: 0;*/
7 | }
8 |
--------------------------------------------------------------------------------
/src/components/dashboard/social/DevicesCardChart/DevicesCardChart.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { DevicesCardChart } from './DevicesCardChart.tsx';
4 |
5 | const meta = {
6 | title: 'Components/Dashboard/Social/Devices chart',
7 | component: DevicesCardChart,
8 | parameters: {
9 | layout: 'centered',
10 | },
11 | } satisfies Meta;
12 |
13 | export default meta;
14 |
15 | type Story = StoryObj;
16 |
17 | export const Default: Story = {
18 | args: {
19 | style: { width: 600 },
20 | },
21 | };
22 |
--------------------------------------------------------------------------------
/src/components/dashboard/social/FollowersChart/FollowersChart.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { FollowersChart } from './FollowersChart.tsx';
4 |
5 | const meta = {
6 | title: 'Components/Dashboard/Social/Followers chart',
7 | component: FollowersChart,
8 | parameters: {
9 | layout: 'centered',
10 | },
11 | } satisfies Meta;
12 |
13 | export default meta;
14 |
15 | type Story = StoryObj;
16 |
17 | export const Default: Story = {
18 | args: {
19 | style: { width: 600 },
20 | },
21 | };
22 |
--------------------------------------------------------------------------------
/src/components/dashboard/social/LikesChart/LikesChart.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { LikesChart } from './LikesChart.tsx';
4 |
5 | const meta = {
6 | title: 'Components/Dashboard/Social/Likes',
7 | component: LikesChart,
8 | parameters: {
9 | layout: 'centered',
10 | },
11 | } satisfies Meta;
12 |
13 | export default meta;
14 |
15 | type Story = StoryObj;
16 |
17 | export const Default: Story = {
18 | args: {
19 | style: { width: 600 },
20 | },
21 | };
22 |
--------------------------------------------------------------------------------
/src/components/dashboard/social/MilestonesCard/MilestonesCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { MilestonesCard } from './MilestonesCard.tsx';
4 |
5 | const meta = {
6 | title: 'Components/Dashboard/Social/Milestones',
7 | component: MilestonesCard,
8 | parameters: {
9 | layout: 'centered',
10 | },
11 | } satisfies Meta;
12 |
13 | export default meta;
14 |
15 | type Story = StoryObj;
16 |
17 | export const Default: Story = {
18 | args: {
19 | style: { width: 600 },
20 | },
21 | };
22 |
--------------------------------------------------------------------------------
/src/components/dashboard/social/MilestonesCard/styles.css:
--------------------------------------------------------------------------------
1 | .milestones-lists-card .ant-card-body {
2 | padding: 0 0 1rem 0;
3 | }
4 |
5 | .available-tucks-card .ant-list-item {
6 | /*padding: 0;*/
7 | }
8 |
--------------------------------------------------------------------------------
/src/components/dashboard/social/SocialStatsCard/SocialStatsCard.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from '@storybook/react';
2 |
3 | import { SocialStatsCard } from './SocialStatsCard.tsx';
4 |
5 | const DATA = {
6 | title: 'followers',
7 | value: 3432,
8 | };
9 |
10 | const meta = {
11 | title: 'Components/Dashboard/Social/Stats',
12 | component: SocialStatsCard,
13 | parameters: {
14 | layout: 'centered',
15 | },
16 | tags: ['autodocs'],
17 | } satisfies Meta;
18 |
19 | export default meta;
20 |
21 | type Story = StoryObj;
22 |
23 | export const Default: Story = {
24 | args: {
25 | ...DATA,
26 | style: { width: 300 },
27 | },
28 | };
29 |
30 | export const Loading: Story = {
31 | args: {
32 | ...DATA,
33 | loading: true,
34 | style: { width: 300 },
35 | },
36 | };
37 |
38 | export const Error: Story = {
39 | args: {
40 | ...DATA,
41 | error: 'Error fetching items',
42 | style: { width: 300 },
43 | },
44 | };
45 |
--------------------------------------------------------------------------------
/src/components/dashboard/social/SocialStatsCard/SocialStatsCard.tsx:
--------------------------------------------------------------------------------
1 | import { Alert, CardProps, Flex, Typography } from 'antd';
2 | import {
3 | CommentOutlined,
4 | LikeOutlined,
5 | UserAddOutlined,
6 | UserOutlined,
7 | UserSwitchOutlined,
8 | } from '@ant-design/icons';
9 | import { ReactElement, ReactNode } from 'react';
10 | import { Card, Loader } from '../../../index';
11 | import CountUp from 'react-countup';
12 |
13 | type Props = {
14 | title: 'followers' | 'following' | 'likes' | 'comments' | string;
15 | value?: number;
16 | error?: ReactNode;
17 | loading?: boolean;
18 | } & CardProps;
19 |
20 | export const SocialStatsCard = ({
21 | value,
22 | title,
23 | loading,
24 | error,
25 | ...others
26 | }: Props) => {
27 | const Icon = (): ReactElement => {
28 | let i;
29 | switch (title) {
30 | case 'following':
31 | i = ;
32 | break;
33 | case 'followers':
34 | i = ;
35 | break;
36 | case 'likes':
37 | i = ;
38 | break;
39 | case 'comments':
40 | i = ;
41 | break;
42 | default:
43 | i = ;
44 | break;
45 | }
46 |
47 | return i;
48 | };
49 |
50 | return (
51 |
52 | {error ? (
53 |
59 | ) : loading ? (
60 |
61 | ) : (
62 |
63 |
64 | {title}
65 |
66 |
67 |
68 |
69 | )}
70 |
71 | );
72 | };
73 |
--------------------------------------------------------------------------------
/src/components/dashboard/social/index.ts:
--------------------------------------------------------------------------------
1 | export { SocialStatsCard } from './SocialStatsCard/SocialStatsCard.tsx';
2 | export { FollowersChart } from './FollowersChart/FollowersChart.tsx';
3 | export { LikesChart } from './LikesChart/LikesChart.tsx';
4 | export { DevicesCardChart } from './DevicesCardChart/DevicesCardChart.tsx';
5 | export { MilestonesCard } from './MilestonesCard/MilestonesCard.tsx';
6 | export { CommentsCard } from './CommentsCard/CommentsCard.tsx';
7 |
--------------------------------------------------------------------------------
/src/components/index.ts:
--------------------------------------------------------------------------------
1 | export { BackBtn } from './BackBtn/BackBtn.tsx';
2 | export { BlogsListCard } from './corporate/BlogsListCard/BlogsListCard';
3 | export { Card } from './Card/Card';
4 | export { ContactForm } from './ContactForm/ContactForm';
5 | export { EmployeeCard } from './EmployeeCard/EmployeeCard';
6 | export { FaqCollapse } from './FaqCollapse/FaqCollapse';
7 | export { Flex } from './Flex/Flex';
8 | export { Loader } from './Loader/Loader';
9 | export { Logo } from './Logo/Logo';
10 | export { MoreMenu } from './MoreMenu/MoreMenu';
11 | export { NotificationsCard } from './NotificationsCard/NotificationsCard';
12 | export { NotificationsItem } from './NotificationsItem/NotificationsItem';
13 | export { PageHeader } from './PageHeader/PageHeader';
14 | export { PricingTable } from './PricingTable/PricingTable';
15 | export { RefreshBtn } from './RefreshBtn/RefreshBtn.tsx';
16 | export { SitemapCard } from './SitemapCard/SitemapCard';
17 | export { SocialMediaCard } from './SocialMediaCard/SocialMediaCard';
18 | export { TimelineCard } from './TimelineCard/TimelineCard';
19 | export { UserAvatar } from './UserAvatar/UserAvatar';
20 | export * from './Nprogress';
21 | export * from './dashboard';
22 | export * from './Container';
23 |
--------------------------------------------------------------------------------
/src/context/index.ts:
--------------------------------------------------------------------------------
1 | import { StylesContext, useStylesContext } from './styles';
2 |
3 | export { StylesContext, useStylesContext };
4 |
--------------------------------------------------------------------------------
/src/context/styles.tsx:
--------------------------------------------------------------------------------
1 | import { createContext, useContext } from 'react';
2 | import { CarouselProps, RowProps } from 'antd';
3 |
4 | export type StylesContentProps = {
5 | rowProps: RowProps;
6 | carouselProps: CarouselProps;
7 | };
8 |
9 | export const StylesContext = createContext(null);
10 |
11 | export const useStylesContext = () => useContext(StylesContext);
12 |
--------------------------------------------------------------------------------
/src/firebase/firebaseConfig.ts:
--------------------------------------------------------------------------------
1 | // Import the functions you need from the SDKs you need
2 | import { initializeApp } from 'firebase/app';
3 | import { getAnalytics } from 'firebase/analytics';
4 | import { getMessaging } from 'firebase/messaging';
5 |
6 | const {
7 | VITE_APP_API_KEY,
8 | VITE_APP_AUTH_DOMAIN,
9 | VITE_APP_PROJECT_ID,
10 | VITE_APP_STORAGE_BUCKET,
11 | VITE_APP_MESSENGER_SENDER_ID,
12 | VITE_APP_APP_ID,
13 | VITE_APP_MEASUREMENT_ID,
14 | } = import.meta.env;
15 |
16 | // TODO: Add SDKs for Firebase products that you want to use
17 | // https://firebase.google.com/docs/web/setup#available-libraries
18 |
19 | // Your web app's Firebase configuration
20 | // For Firebase JS SDK v7.20.0 and later, measurementId is optional
21 | const firebaseConfig = {
22 | apiKey: VITE_APP_API_KEY,
23 | authDomain: VITE_APP_AUTH_DOMAIN,
24 | projectId: VITE_APP_PROJECT_ID,
25 | storageBucket: VITE_APP_STORAGE_BUCKET,
26 | messagingSenderId: VITE_APP_MESSENGER_SENDER_ID,
27 | appId: VITE_APP_APP_ID,
28 | measurementId: VITE_APP_MEASUREMENT_ID,
29 | };
30 |
31 | // Initialize Firebase
32 | const app = initializeApp(firebaseConfig);
33 | const analytics = getAnalytics(app);
34 | const messaging = getMessaging(app);
35 |
36 | export { analytics, messaging };
37 |
--------------------------------------------------------------------------------
/src/hooks/index.ts:
--------------------------------------------------------------------------------
1 | import { usePageContext } from './usePageContext.tsx';
2 | import useFetchData from './useFetchData.tsx';
3 |
4 | export { usePageContext, useFetchData };
5 |
--------------------------------------------------------------------------------
/src/hooks/useFetchData.tsx:
--------------------------------------------------------------------------------
1 | import { useCallback, useEffect, useState } from 'react';
2 |
3 | const useFetchData = (url: string) => {
4 | const [data, setData] = useState([]);
5 | const [error, setError] = useState(null);
6 | const [loading, setLoading] = useState(true);
7 |
8 | const fetchData = useCallback(async () => {
9 | try {
10 | const response = await fetch(url);
11 | const json = await response.json();
12 |
13 | setData(json);
14 | } catch (error) {
15 | setError(error);
16 | } finally {
17 | setLoading(false);
18 | }
19 | }, []);
20 |
21 | useEffect(() => {
22 | fetchData();
23 | }, [url]);
24 |
25 | return { data, error, loading };
26 | };
27 |
28 | export default useFetchData;
29 |
--------------------------------------------------------------------------------
/src/hooks/usePageContext.tsx:
--------------------------------------------------------------------------------
1 | import { useOutletContext } from 'react-router-dom';
2 |
3 | export type ContextType = { title: string | null };
4 |
5 | export function usePageContext() {
6 | return useOutletContext();
7 | }
8 |
--------------------------------------------------------------------------------
/src/index.css:
--------------------------------------------------------------------------------
1 | :root {
2 | font-family: 'Lato', sans-serif;
3 | }
4 |
5 | body {
6 | margin: 0;
7 | }
8 |
--------------------------------------------------------------------------------
/src/layouts/app/FooterNav.tsx:
--------------------------------------------------------------------------------
1 | import { Layout } from 'antd';
2 |
3 | const { Footer } = Layout;
4 |
5 | type FooterNavProps = React.HTMLAttributes;
6 |
7 | const FooterNav = ({ ...others }: FooterNavProps) => {
8 | return (
9 | AntD Dashboard © 2023 Created by Design Sparx
10 | );
11 | };
12 |
13 | export default FooterNav;
14 |
--------------------------------------------------------------------------------
/src/layouts/app/HeaderNav.tsx:
--------------------------------------------------------------------------------
1 | import { Layout } from 'antd';
2 | import { useRef } from 'react';
3 |
4 | const { Header } = Layout;
5 |
6 | type HeaderNavProps = {
7 | navFill?: boolean;
8 | } & React.HTMLAttributes;
9 |
10 | const HeaderNav = ({ navFill, ...others }: HeaderNavProps) => {
11 | const nodeRef = useRef(null);
12 |
13 | return ;
14 | };
15 |
16 | export default HeaderNav;
17 |
--------------------------------------------------------------------------------
/src/layouts/app/index.ts:
--------------------------------------------------------------------------------
1 | export { AppLayout } from './App.tsx';
2 |
--------------------------------------------------------------------------------
/src/layouts/dashboards/index.tsx:
--------------------------------------------------------------------------------
1 | import { AppLayout } from '../app';
2 | import { Outlet } from 'react-router-dom';
3 |
4 | export const DashboardLayout = () => {
5 | return (
6 |
7 |
8 |
9 | );
10 | };
11 |
--------------------------------------------------------------------------------
/src/layouts/index.ts:
--------------------------------------------------------------------------------
1 | export { AppLayout } from './app';
2 | export { DashboardLayout } from './dashboards';
3 | export { GuestLayout } from './guest/Guest.tsx';
4 | export { CorporateLayout } from './corporate';
5 | export { UserAccountLayout } from './userAccount';
6 |
--------------------------------------------------------------------------------
/src/layouts/userAccount/styles.css:
--------------------------------------------------------------------------------
1 | .user-profile-card-nav .ant-tabs-nav {
2 | margin: 0 0 0 1rem;
3 | }
4 |
5 | .user-profile-card-nav .ant-card-actions li:first-of-type {
6 | margin: 0;
7 | }
8 |
--------------------------------------------------------------------------------
/src/main.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import App from './App.tsx';
4 | import './index.css';
5 | import { store, persistor } from './redux/store.ts';
6 | import { Provider } from 'react-redux';
7 | import { PersistGate } from 'redux-persist/integration/react';
8 | ReactDOM.createRoot(document.getElementById('root')!).render(
9 |
10 |
11 |
12 |
13 |
14 |
15 | ,
16 |
17 | );
18 |
--------------------------------------------------------------------------------
/src/pages/Sitemap.tsx:
--------------------------------------------------------------------------------
1 | import { SitemapCard } from '../components';
2 | import { Col, Flex, Row, Typography } from 'antd';
3 | import {
4 | AUTHENTICATION_ITEMS,
5 | CORPORATE_ITEMS,
6 | DASHBOARD_ITEMS,
7 | ERROR_ITEMS,
8 | USER_PROFILE_ITEMS,
9 | } from '../constants';
10 | import { useStylesContext } from '../context';
11 | import { BranchesOutlined } from '@ant-design/icons';
12 |
13 | const SITES = [
14 | {
15 | title: 'dashboard',
16 | links: DASHBOARD_ITEMS,
17 | },
18 | {
19 | title: 'corporate',
20 | links: CORPORATE_ITEMS,
21 | },
22 | {
23 | title: 'user profile',
24 | links: USER_PROFILE_ITEMS,
25 | },
26 | {
27 | title: 'authentication',
28 | links: AUTHENTICATION_ITEMS,
29 | },
30 | {
31 | title: 'errors',
32 | links: ERROR_ITEMS,
33 | },
34 | ];
35 |
36 | export const SitemapPage = () => {
37 | const context = useStylesContext();
38 |
39 | return (
40 |
41 |
42 |
43 | Sitemap
44 |
45 |
46 | {SITES.map((s) => (
47 |
48 |
49 |
50 | ))}
51 |
52 |
53 |
54 | );
55 | };
56 |
--------------------------------------------------------------------------------
/src/pages/authentication/AccountDeactivate.tsx:
--------------------------------------------------------------------------------
1 | import { Button, Flex, Typography } from 'antd';
2 | import { Logo } from '../../components';
3 | import { Link } from 'react-router-dom';
4 | import { PATH_DASHBOARD } from '../../constants';
5 |
6 | export const AccountDeactivePage = () => {
7 | return (
8 |
15 |
16 | Deactivated Account
17 |
18 | Looking for answers? Check the Help Center.
19 |
20 |
21 |
22 | Go to Homepage
23 |
24 |
25 |
26 | );
27 | };
28 |
--------------------------------------------------------------------------------
/src/pages/authentication/VerifyEmail.tsx:
--------------------------------------------------------------------------------
1 | import { Button, Flex, Typography } from 'antd';
2 | import { Logo } from '../../components';
3 | import { Link } from 'react-router-dom';
4 | import { PATH_DASHBOARD } from '../../constants';
5 |
6 | export const VerifyEmailPage = () => {
7 | return (
8 |
15 |
16 | Verify Your Email
17 |
18 | We have sent an email to{' '}
19 |
20 | kelvin.kiprop96@gmail.com
21 | {' '}
22 | plase follow a link to verify your email.
23 |
24 |
25 | Skip
26 |
27 |
28 | Did’t receive an email?
29 | Resend
30 |
31 |
32 | );
33 | };
34 |
--------------------------------------------------------------------------------
/src/pages/authentication/Welcome.tsx:
--------------------------------------------------------------------------------
1 | import { Button, Flex, Typography } from 'antd';
2 | import { Logo } from '../../components';
3 | import { Link } from 'react-router-dom';
4 | import { PATH_DASHBOARD } from '../../constants';
5 |
6 | export const WelcomePage = () => {
7 | return (
8 |
15 |
16 | Welcome to Antd
17 |
18 | A dynamic and versatile multipurpose dashboard utilizing Ant Design,
19 | React, TypeScript, and Vite.
20 |
21 |
22 |
23 | Go to Homepage
24 |
25 |
26 |
27 | );
28 | };
29 |
--------------------------------------------------------------------------------
/src/pages/authentication/index.ts:
--------------------------------------------------------------------------------
1 | export { SignUpPage } from './SignUp.tsx';
2 | export { SignInPage } from './SignIn.tsx';
3 | export { WelcomePage } from './Welcome.tsx';
4 | export { VerifyEmailPage } from './VerifyEmail.tsx';
5 | export { PasswordResetPage } from './PasswordReset.tsx';
6 | export { AccountDeactivePage } from './AccountDeactivate.tsx';
7 |
--------------------------------------------------------------------------------
/src/pages/corporate/Faqs.tsx:
--------------------------------------------------------------------------------
1 | import { Alert, Col, Row, Space, Typography } from 'antd';
2 | import { Card, FaqCollapse, Loader } from '../../components';
3 | import * as _ from 'lodash';
4 | import { useEffect, useState } from 'react';
5 | import { Faq } from '../../types';
6 | import { useStylesContext } from '../../context';
7 | import { useFetchData } from '../../hooks';
8 |
9 | export const CorporateFaqPage = () => {
10 | const {
11 | data: faqsData,
12 | loading: faqsDataLoading,
13 | error: faqsDataError,
14 | } = useFetchData('../mocks/Faqs.json');
15 | const [faqs, setFaqs] = useState<{ category: string; items: Faq[] }[]>([]);
16 | const stylesContext = useStylesContext();
17 |
18 | useEffect(() => {
19 | const data = _.chain(faqsData)
20 | .groupBy('category')
21 | .map((items, category) => {
22 | return {
23 | category,
24 | items: items.slice(0, 4).map((i) => ({
25 | ...i,
26 | label: i.question.slice(0, 50) + '...?',
27 | children: i.answer,
28 | })),
29 | };
30 | })
31 | .orderBy('category')
32 | .value();
33 |
34 | setFaqs(data);
35 | }, [faqsData]);
36 |
37 | return (
38 |
39 |
40 |
41 |
42 | {faqsDataError ? (
43 |
49 | ) : faqsDataLoading ? (
50 |
51 | ) : (
52 |
57 | {faqs.map((f) => (
58 | <>
59 | {f.category}
60 |
61 | >
62 | ))}
63 |
64 | )}
65 |
66 |
67 |
68 |
69 | );
70 | };
71 |
--------------------------------------------------------------------------------
/src/pages/corporate/Pricing.tsx:
--------------------------------------------------------------------------------
1 | import { PricingTable } from '../../components';
2 | import { useFetchData } from '../../hooks';
3 |
4 | export const CorporatePricingPage = () => {
5 | const {
6 | data: pricingData,
7 | error: pricingDataError,
8 | loading: pricingDataLoading,
9 | } = useFetchData('../mocks/Pricing.json');
10 |
11 | return (
12 |
19 | );
20 | };
21 |
--------------------------------------------------------------------------------
/src/pages/corporate/Team.tsx:
--------------------------------------------------------------------------------
1 | import { Alert, Col, List, Row } from 'antd';
2 | import { Card, EmployeeCard } from '../../components';
3 | import { Employee } from '../../types';
4 | import { useFetchData } from '../../hooks';
5 | import { useStylesContext } from '../../context';
6 |
7 | export const CorporateTeamPage = () => {
8 | const stylesContext = useStylesContext();
9 | const {
10 | data: employeesData,
11 | loading: employeesDataLoading,
12 | error: employeesDataError,
13 | } = useFetchData('../mocks/Employees.json');
14 |
15 | return (
16 |
17 |
18 |
19 |
20 | {employeesDataError ? (
21 |
27 | ) : (
28 | {
40 | console.log(page);
41 | },
42 | pageSize: 10,
43 | align: 'center',
44 | }}
45 | loading={employeesDataLoading}
46 | dataSource={employeesData}
47 | renderItem={(item: Employee) => (
48 |
49 |
50 |
51 | )}
52 | />
53 | )}
54 |
55 |
56 |
57 |
58 | );
59 | };
60 |
--------------------------------------------------------------------------------
/src/pages/corporate/index.ts:
--------------------------------------------------------------------------------
1 | export { CorporateAboutPage } from './About.tsx';
2 | export { CorporateTeamPage } from './Team.tsx';
3 | export { CorporateFaqPage } from './Faqs.tsx';
4 | export { CorporateContactPage } from './Contact.tsx';
5 | export { CorporatePricingPage } from './Pricing.tsx';
6 | export { CorporateLicensePage } from './Licence.tsx';
7 |
--------------------------------------------------------------------------------
/src/pages/dashboards/index.ts:
--------------------------------------------------------------------------------
1 | export { DefaultDashboardPage } from './Default.tsx';
2 | export { ProjectsDashboardPage } from './Projects.tsx';
3 | export { EcommerceDashboardPage } from './Ecommerce.tsx';
4 | export { MarketingDashboardPage } from './Marketing.tsx';
5 | export { SocialDashboardPage } from './Social.tsx';
6 | export { BiddingDashboardPage } from './Bidding.tsx';
7 | export { LearningDashboardPage } from './Learning.tsx';
8 | export { LogisticsDashboardPage } from './Logistics.tsx';
9 |
--------------------------------------------------------------------------------
/src/pages/errors/Error.tsx:
--------------------------------------------------------------------------------
1 | import { useRouteError } from 'react-router-dom';
2 | import { Result, Typography } from 'antd';
3 | import { BackBtn, RefreshBtn } from '../../components';
4 |
5 | const { Paragraph, Text } = Typography;
6 |
7 | type Error = unknown | any;
8 |
9 | export const ErrorPage = () => {
10 | const error: Error = useRouteError();
11 | console.error(error);
12 |
13 | return (
14 | , ]}
19 | >
20 |
21 |
22 |
28 | The page you tried to open has the following error:
29 |
30 |
31 |
{error.statusText || error.message}
32 |
33 |
34 | );
35 | };
36 |
--------------------------------------------------------------------------------
/src/pages/errors/Error400.tsx:
--------------------------------------------------------------------------------
1 | import { Result, Typography } from 'antd';
2 | import { CloseCircleOutlined } from '@ant-design/icons';
3 | import { red } from '@ant-design/colors';
4 | import { BackBtn, RefreshBtn } from '../../components';
5 |
6 | const { Paragraph, Text } = Typography;
7 |
8 | export const Error400Page = () => {
9 | return (
10 | , ]}
15 | >
16 |
17 |
18 |
24 | The content you submitted has the following error:
25 |
26 |
27 |
28 |
29 | Bad Request - Invalid URL Forward error >
30 |
31 |
32 |
33 | Bad Request. Your browser sent a request that this server could
34 | not understand Go to console >
35 |
36 |
37 |
38 | );
39 | };
40 |
--------------------------------------------------------------------------------
/src/pages/errors/Error403.tsx:
--------------------------------------------------------------------------------
1 | import { Result } from 'antd';
2 | import { BackBtn } from '../../components';
3 |
4 | export const Error403Page = () => {
5 | return (
6 | }
11 | />
12 | );
13 | };
14 |
--------------------------------------------------------------------------------
/src/pages/errors/Error404.tsx:
--------------------------------------------------------------------------------
1 | import { Result } from 'antd';
2 | import { BackBtn } from '../../components';
3 |
4 | export const Error404Page = () => {
5 | return (
6 | }
11 | />
12 | );
13 | };
14 |
--------------------------------------------------------------------------------
/src/pages/errors/Error500.tsx:
--------------------------------------------------------------------------------
1 | import { Result } from 'antd';
2 | import { BackBtn, RefreshBtn } from '../../components';
3 |
4 | export const Error500Page = () => {
5 | return (
6 | , ]}
11 | />
12 | );
13 | };
14 |
--------------------------------------------------------------------------------
/src/pages/errors/Error503.tsx:
--------------------------------------------------------------------------------
1 | import { Result } from 'antd';
2 | import { BackBtn, RefreshBtn } from '../../components';
3 |
4 | export const Error503Page = () => {
5 | return (
6 | , ]}
11 | />
12 | );
13 | };
14 |
--------------------------------------------------------------------------------
/src/pages/errors/index.ts:
--------------------------------------------------------------------------------
1 | export { ErrorPage } from './Error.tsx';
2 | export { Error400Page } from './Error400.tsx';
3 | export { Error403Page } from './Error403.tsx';
4 | export { Error404Page } from './Error404.tsx';
5 | export { Error500Page } from './Error500.tsx';
6 | export { Error503Page } from './Error503.tsx';
7 |
--------------------------------------------------------------------------------
/src/pages/index.ts:
--------------------------------------------------------------------------------
1 | export { HomePage } from './Home.tsx';
2 | export { SitemapPage } from './Sitemap.tsx';
3 | export * from './dashboards';
4 | export * from './corporate';
5 | export * from './userAccount';
6 | export * from './authentication';
7 | export * from './errors';
8 |
--------------------------------------------------------------------------------
/src/pages/userAccount/Activity.tsx:
--------------------------------------------------------------------------------
1 | import { TimelineCard } from '../../components';
2 | import { useFetchData } from '../../hooks';
3 |
4 | export const UserProfileActivityPage = () => {
5 | const {
6 | data: timelineData,
7 | loading: timelineDataLoading,
8 | error: timelineDataError,
9 | } = useFetchData('../mocks/TimelineActivity.json');
10 |
11 | return (
12 |
18 | );
19 | };
20 |
--------------------------------------------------------------------------------
/src/pages/userAccount/index.ts:
--------------------------------------------------------------------------------
1 | export { UserProfileDetailsPage } from './Details.tsx';
2 | export { UserProfilePreferencesPage } from './Preferences.tsx';
3 | export { UserProfileInformationPage } from './Information.tsx';
4 | export { UserProfileSecurityPage } from './Security.tsx';
5 | export { UserProfileActivityPage } from './Activity.tsx';
6 | export { UserProfileActionsPage } from './Actions.tsx';
7 | export { UserProfileHelpPage } from './Help.tsx';
8 | export { UserProfileFeedbackPage } from './Feedback.tsx';
9 |
--------------------------------------------------------------------------------
/src/redux/store.ts:
--------------------------------------------------------------------------------
1 | import { configureStore, combineReducers } from '@reduxjs/toolkit';
2 | import themeReducer, { ThemeState } from './theme/themeSlice';
3 | import { persistReducer, persistStore, PersistConfig } from 'redux-persist';
4 | import storage from 'redux-persist/lib/storage';
5 |
6 | // Define the state shape
7 | interface RootState {
8 | theme: ThemeState;
9 | }
10 |
11 | // Combine reducers
12 | const rootReducer = combineReducers({
13 | theme: themeReducer,
14 | });
15 |
16 | // Persist config with RootState
17 | const persistConfig: PersistConfig = {
18 | key: 'root',
19 | storage,
20 | version: 1,
21 | };
22 |
23 | const persistedReducer = persistReducer(persistConfig, rootReducer);
24 |
25 | // Configure store with persisted reducer
26 | export const store = configureStore({
27 | reducer: persistedReducer,
28 | middleware: (getDefaultMiddleware) =>
29 | getDefaultMiddleware({
30 | serializableCheck: false,
31 | }),
32 | });
33 |
34 | // Persistor
35 | export const persistor = persistStore(store);
36 |
37 | // Type for RootState
38 | export type { RootState };
39 |
--------------------------------------------------------------------------------
/src/redux/theme/themeSlice.ts:
--------------------------------------------------------------------------------
1 | import { createSlice } from '@reduxjs/toolkit';
2 |
3 | export interface ThemeState {
4 | mytheme: string;
5 | }
6 |
7 | const initialState: ThemeState = {
8 | mytheme: 'light',
9 | };
10 |
11 | const themeSlice = createSlice({
12 | name: 'mytheme',
13 | initialState,
14 | reducers: {
15 | toggleTheme: (state: ThemeState) => {
16 | state.mytheme = state.mytheme === 'light' ? 'dark' : 'light';
17 | },
18 | },
19 | });
20 |
21 | export const { toggleTheme } = themeSlice.actions;
22 |
23 | export default themeSlice.reducer;
24 |
--------------------------------------------------------------------------------
/src/stories/assets/accessibility.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/src/stories/assets/accessibility.png
--------------------------------------------------------------------------------
/src/stories/assets/accessibility.svg:
--------------------------------------------------------------------------------
1 |
2 | Accessibility
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/stories/assets/addon-library.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/src/stories/assets/addon-library.png
--------------------------------------------------------------------------------
/src/stories/assets/assets.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/src/stories/assets/assets.png
--------------------------------------------------------------------------------
/src/stories/assets/context.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/src/stories/assets/context.png
--------------------------------------------------------------------------------
/src/stories/assets/docs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/src/stories/assets/docs.png
--------------------------------------------------------------------------------
/src/stories/assets/figma-plugin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/src/stories/assets/figma-plugin.png
--------------------------------------------------------------------------------
/src/stories/assets/share.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/src/stories/assets/share.png
--------------------------------------------------------------------------------
/src/stories/assets/styling.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/src/stories/assets/styling.png
--------------------------------------------------------------------------------
/src/stories/assets/testing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/src/stories/assets/testing.png
--------------------------------------------------------------------------------
/src/stories/assets/theming.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/design-sparx/antd-multipurpose-dashboard/005fdbcf2d946b0f74e488e2673fc7c7589e5de3/src/stories/assets/theming.png
--------------------------------------------------------------------------------
/src/stories/assets/tutorials.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/stories/assets/youtube.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/types/bidding.ts:
--------------------------------------------------------------------------------
1 | export type Bidding = {
2 | auction_id: string;
3 | nft_name: string;
4 | nft_image: string;
5 | seller_username: string;
6 | buyer_username: string;
7 | start_price: number;
8 | end_price: number;
9 | start_date: string;
10 | end_date: string;
11 | status: 'active' | 'ending soon' | string;
12 | is_highest_bid_mine: boolean;
13 | winning_bid: number;
14 | time_left: string;
15 | };
16 |
17 | export type AuctionCreator = {
18 | creator_id: string;
19 | first_name: string;
20 | last_name: string;
21 | age: number;
22 | email: string;
23 | country: string;
24 | postal_code: string | null;
25 | favorite_color: string;
26 | sales_count: number;
27 | total_sales: string;
28 | };
29 |
30 | export type AuctionSales = {
31 | id: string;
32 | title: string;
33 | artist: string;
34 | volume: number;
35 | status: number;
36 | owners_count: number;
37 | description: string;
38 | image_url: string;
39 | creation_date: string;
40 | edition: number;
41 | price: number;
42 | owner: string;
43 | collection: string;
44 | verified: boolean;
45 | };
46 |
47 | export type AuctionTransactions = {
48 | id: string;
49 | image: string;
50 | product_id: string;
51 | transaction_date: string;
52 | seller: string;
53 | buyer: string;
54 | purchase_price: number;
55 | sale_price: number;
56 | profit: number;
57 | quantity: number;
58 | shipping_address: string;
59 | state: string | null;
60 | country: string;
61 | transaction_type: string;
62 | };
63 |
--------------------------------------------------------------------------------
/src/types/campaigns.ts:
--------------------------------------------------------------------------------
1 | export type CampaignAds = {
2 | id: string;
3 | ad_source: string;
4 | ad_campaign: string;
5 | ad_group: string;
6 | ad_type: string;
7 | impressions: number;
8 | clicks: number;
9 | conversions: number;
10 | cost: number;
11 | conversion_rate: number;
12 | revenue: number;
13 | roi: number;
14 | start_date: string;
15 | };
16 |
--------------------------------------------------------------------------------
/src/types/clients.ts:
--------------------------------------------------------------------------------
1 | export type Clients = {
2 | client_id: string;
3 | first_name: string;
4 | last_name: string;
5 | email: string;
6 | phone_number: string;
7 | purchase_date: string;
8 | product_name: string;
9 | quantity: number;
10 | unit_price: number;
11 | total_price: number;
12 | country: string;
13 | };
14 |
--------------------------------------------------------------------------------
/src/types/comments.ts:
--------------------------------------------------------------------------------
1 | export type CommentsType = 'post' | 'like' | 'comment' | string;
2 |
3 | export type CommentsPlatform =
4 | | 'facebook'
5 | | 'twitter'
6 | | 'instagram'
7 | | 'linkedin'
8 | | 'youtube'
9 | | string;
10 |
11 | export type CommentGender = 'Female' | 'Male' | 'Non-binary' | string;
12 |
13 | export type Comments = {
14 | id: string;
15 | author: string;
16 | user_id: string;
17 | activity_type: CommentsType;
18 | timestamp: string;
19 | post_content: string;
20 | platform: CommentsPlatform;
21 | user_location: string;
22 | user_age: number;
23 | user_gender: CommentGender;
24 | user_interests: string;
25 | user_friends_count: number;
26 | };
27 |
--------------------------------------------------------------------------------
/src/types/dashboard.ts:
--------------------------------------------------------------------------------
1 | export type Tasks = {
2 | id: string;
3 | name: string;
4 | description: string;
5 | priority: string;
6 | due_date: string;
7 | assigned_to: string;
8 | status: string;
9 | notes: string;
10 | category: string;
11 | duration: number;
12 | completed_date: string;
13 | color: string;
14 | };
15 |
--------------------------------------------------------------------------------
/src/types/employee.ts:
--------------------------------------------------------------------------------
1 | export type Employee = {
2 | employee_id: string;
3 | title: string;
4 | first_name: string;
5 | middle_name: string;
6 | last_name: string;
7 | avatar: string;
8 | role: string;
9 | age: number;
10 | email: string;
11 | country: string;
12 | favorite_color: string;
13 | hire_date: string;
14 | salary: number;
15 | };
16 |
--------------------------------------------------------------------------------
/src/types/faq.ts:
--------------------------------------------------------------------------------
1 | export type Faq = {
2 | id: string;
3 | question: string;
4 | answer: string;
5 | category: string;
6 | date_created: string;
7 | is_featured: boolean;
8 | views: number;
9 | related_faqs: Array;
10 | tags: string;
11 | rating: number;
12 | author: string;
13 | };
14 |
--------------------------------------------------------------------------------
/src/types/index.ts:
--------------------------------------------------------------------------------
1 | import type {
2 | Projects,
3 | ProjectCategory,
4 | ProjectStatus,
5 | ProjectPriority,
6 | } from './projects';
7 | import type { Clients } from './clients';
8 | import type { CampaignAds } from './campaigns';
9 | import type { PostPlatform, Posts, PostCategory } from './posts';
10 | import type {
11 | CommentsType,
12 | CommentGender,
13 | CommentsPlatform,
14 | Comments,
15 | } from './comments';
16 | import type {
17 | Bidding,
18 | AuctionCreator,
19 | AuctionSales,
20 | AuctionTransactions,
21 | } from './bidding';
22 | import type {
23 | LearningCourses,
24 | RecommendedCourses,
25 | Exam,
26 | CommunityGroup,
27 | } from './learnings.ts';
28 | import type {
29 | TruckDelivery,
30 | DeliveryAnalytics,
31 | Truck,
32 | DeliveryRequest,
33 | } from './logistics.ts';
34 | import type { Tasks } from './dashboard';
35 | import type { Notifications } from './notifications';
36 | import type { Employee } from './employee';
37 | import type { Faq } from './faq';
38 | import type { Pricing } from './pricing';
39 | import type { Session } from './session';
40 | import type { ActivityTimeline } from './timeline';
41 |
42 | export type {
43 | Projects,
44 | ProjectStatus,
45 | ProjectCategory,
46 | ProjectPriority,
47 | Clients,
48 | CampaignAds,
49 | PostCategory,
50 | PostPlatform,
51 | Posts,
52 | Comments,
53 | CommentGender,
54 | CommentsType,
55 | CommentsPlatform,
56 | Bidding,
57 | AuctionCreator,
58 | AuctionSales,
59 | AuctionTransactions,
60 | LearningCourses,
61 | RecommendedCourses,
62 | Exam,
63 | CommunityGroup,
64 | TruckDelivery,
65 | DeliveryAnalytics,
66 | Truck,
67 | DeliveryRequest,
68 | Tasks,
69 | Notifications,
70 | Employee,
71 | Faq,
72 | Pricing,
73 | Session,
74 | ActivityTimeline,
75 | };
76 |
--------------------------------------------------------------------------------
/src/types/learnings.ts:
--------------------------------------------------------------------------------
1 | export type LearningCourses = {
2 | id: string;
3 | name: string;
4 | code: string;
5 | description: string;
6 | instructor_name: string;
7 | start_date: string;
8 | end_date: string;
9 | credit_hours: number;
10 | department: string;
11 | prerequisites: string;
12 | course_location: string;
13 | total_lessons: number;
14 | current_lessons: number;
15 | favorite_color: string;
16 | };
17 |
18 | export type RecommendedCourses = {
19 | id: string;
20 | name: string;
21 | description: string;
22 | duration: number;
23 | level: string;
24 | price: number;
25 | category: string;
26 | instructor: string;
27 | start_date: string;
28 | course_language: string;
29 | favorite_color: string;
30 | lessons: number;
31 | };
32 |
33 | export type Exam = {
34 | student_id: string;
35 | full_name: string;
36 | email: string;
37 | course: string;
38 | course_code: string;
39 | exam_date: string;
40 | exam_time: number;
41 | exam_duration: number;
42 | exam_score: number;
43 | };
44 |
45 | export type CommunityGroup = {
46 | id: string;
47 | name: string;
48 | description: string;
49 | image: string;
50 | category: string;
51 | location: string;
52 | size: number;
53 | leader: string;
54 | start_date: string;
55 | meeting_time: string;
56 | member_age_range: number;
57 | member_interests: string;
58 | favorite_color: string;
59 | };
60 |
--------------------------------------------------------------------------------
/src/types/logistics.ts:
--------------------------------------------------------------------------------
1 | export type TruckDelivery = {
2 | shipment_id: string;
3 | truck_id: string;
4 | customer_id: string;
5 | customer_name: string;
6 | driver_name: string;
7 | origin_city: string;
8 | destination_city: string;
9 | shipment_date: string;
10 | delivery_time: number;
11 | shipment_weight: number;
12 | delivery_status: string;
13 | shipment_cost: number;
14 | favorite_color: string;
15 | };
16 |
17 | export type DeliveryAnalytics = {
18 | id: string;
19 | value: number;
20 | month: string;
21 | status: string;
22 | };
23 |
24 | export type Truck = {
25 | truck_id: string;
26 | make: string;
27 | model: string;
28 | year: number;
29 | mileage: number;
30 | price: number;
31 | color: string;
32 | status: string;
33 | availability: boolean;
34 | origin: string;
35 | destination: string;
36 | progress: number;
37 | };
38 |
39 | export type DeliveryRequest = {
40 | id: string;
41 | name: string;
42 | pickup_location: string;
43 | delivery_location: string;
44 | delivery_date: string;
45 | delivery_time: number;
46 | truck_type: 'small' | 'medium' | 'large' | string;
47 | cargo_weight: number;
48 | delivery_status: 'pending' | 'in transit' | 'delivered' | string;
49 | driver_name: string;
50 | contact_number: string;
51 | };
52 |
--------------------------------------------------------------------------------
/src/types/notifications.ts:
--------------------------------------------------------------------------------
1 | export type Notifications = {
2 | notification_id: string;
3 | user_id: string;
4 | user: string;
5 | notification_type: string;
6 | notification_date: string;
7 | notification_message: string;
8 | is_read: boolean;
9 | is_deleted: boolean;
10 | notification_category: string;
11 | notification_image: string;
12 | color: string;
13 | };
14 |
--------------------------------------------------------------------------------
/src/types/posts.ts:
--------------------------------------------------------------------------------
1 | export type PostPlatform =
2 | | 'Facebook'
3 | | 'Twitter'
4 | | 'Instagram'
5 | | 'LinkedIn'
6 | | 'YouTube'
7 | | string;
8 |
9 | export type PostCategory = 'News' | 'Events' | 'Promotions' | string;
10 |
11 | export type Posts = {
12 | id: string;
13 | title: string;
14 | content: string;
15 | date: string;
16 | time: number;
17 | author: string;
18 | category: PostCategory;
19 | tags: string;
20 | likes_count: number;
21 | comments_count: number;
22 | shares_count: number;
23 | image_url: string;
24 | link: string;
25 | location: string;
26 | hashtags: string;
27 | platform: PostPlatform;
28 | };
29 |
--------------------------------------------------------------------------------
/src/types/pricing.ts:
--------------------------------------------------------------------------------
1 | export type Pricing = {
2 | plan: string;
3 | monthly: number;
4 | annually: number;
5 | savings_caption: string;
6 | features: string[];
7 | color: string;
8 | preferred?: boolean;
9 | };
10 |
--------------------------------------------------------------------------------
/src/types/projects.ts:
--------------------------------------------------------------------------------
1 | export type ProjectStatus = 'in progress' | 'completed' | 'on hold' | string;
2 | export type ProjectCategory = 'technology' | 'marketing' | 'finance' | string;
3 | export type ProjectPriority = 'high' | 'medium' | 'low' | string;
4 | export type ProjectType =
5 | | 'software development'
6 | | 'marketing'
7 | | 'research'
8 | | string;
9 |
10 | export type Projects = {
11 | project_id: string;
12 | project_name: string;
13 | start_date: string;
14 | end_date: string;
15 | budget: string;
16 | project_manager: string;
17 | client_name: string;
18 | status: ProjectStatus;
19 | priority: ProjectPriority;
20 | team_size: number;
21 | project_description: string;
22 | project_location: string;
23 | project_type: ProjectType;
24 | project_category: ProjectCategory;
25 | project_duration: number;
26 | };
27 |
--------------------------------------------------------------------------------
/src/types/session.ts:
--------------------------------------------------------------------------------
1 | export type Session = {
2 | id: string;
3 | login_time: string;
4 | login_location: string;
5 | device_type: 'mobile' | 'desktop' | 'tablet' | string;
6 | browser: string;
7 | ip_address: string;
8 | session_type: string;
9 | status: 'active' | 'suspended' | 'locked' | string;
10 | login_duration: number;
11 | login_attempts: number;
12 | };
13 |
--------------------------------------------------------------------------------
/src/types/timeline.ts:
--------------------------------------------------------------------------------
1 | export type ActivityTimeline = {
2 | user_id: string;
3 | activity_type: string;
4 | timestamp: string;
5 | post_id: string;
6 | post_content: string;
7 | comment_id: number;
8 | comment_content: string;
9 | like_count: number;
10 | location: string;
11 | device_type: string;
12 | };
13 |
--------------------------------------------------------------------------------
/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | interface ImportMetaEnv {
4 | readonly VITE_APP_TITLE: string;
5 | // more env variables...
6 | }
7 |
8 | interface ImportMeta {
9 | readonly env: ImportMetaEnv;
10 | }
11 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "useDefineForClassFields": true,
5 | "lib": ["ES2020", "DOM", "DOM.Iterable"],
6 | "module": "ESNext",
7 | "skipLibCheck": true,
8 |
9 | /* Bundler mode */
10 | "moduleResolution": "bundler",
11 | "allowImportingTsExtensions": true,
12 | "resolveJsonModule": true,
13 | "isolatedModules": true,
14 | "noEmit": true,
15 | "jsx": "react-jsx",
16 |
17 | /* Linting */
18 | "strict": true,
19 | "noUnusedLocals": true,
20 | "noUnusedParameters": true,
21 | "noFallthroughCasesInSwitch": true
22 | },
23 | "include": ["src"],
24 | "references": [{ "path": "./tsconfig.node.json" }]
25 | }
26 |
--------------------------------------------------------------------------------
/tsconfig.node.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "composite": true,
4 | "skipLibCheck": true,
5 | "module": "ESNext",
6 | "moduleResolution": "bundler",
7 | "allowSyntheticDefaultImports": true
8 | },
9 | "include": ["vite.config.ts"]
10 | }
11 |
--------------------------------------------------------------------------------
/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite';
2 | import react from '@vitejs/plugin-react-swc';
3 |
4 | // https://vitejs.dev/config/
5 | export default defineConfig({
6 | plugins: [react()],
7 | });
8 |
--------------------------------------------------------------------------------