Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ient into Mission-Finishing-Ui
  • Loading branch information
raihanuldev committed Nov 9, 2023
2 parents d69d103 + 03095f7 commit f06f28d
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 83 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm test
50 changes: 0 additions & 50 deletions src/Components/paginaition/Pagination.test.js

This file was deleted.

4 changes: 2 additions & 2 deletions src/Dashbord/MySelectedClass/Row.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const Row = ({ row, index }) => {
const navigate = useNavigate()
const handlePayNow = ()=>{
localStorage.setItem('row',JSON.stringify(row))
navigate('/dashbord/payment', {state:row})
navigate('/dashbord/payment-choose', {state:row})
}
// handle Remove Area
const handleRemove =()=>{
Expand Down Expand Up @@ -62,7 +62,7 @@ const Row = ({ row, index }) => {
<button onClick={handleRemove} className='btn btn-ghost '> <FaTrashAlt></FaTrashAlt> </button>
</td>
<th>
<Link to={{ pathname: '/dashbord/payment', state: { row } }}><button onClick={handlePayNow} className="btn btn-ghost">Pay Now</button></Link>
<Link to={{ pathname: '/dashbord/payment-choose', state: { row } }}><button onClick={handlePayNow} className="btn btn-ghost">Pay Now</button></Link>
</th>
</tr>
);
Expand Down
19 changes: 10 additions & 9 deletions src/Dashbord/Payment/Payment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ const stripePromis = loadStripe(import.meta.env.VITE_PK)
const Payment = () => {

const location = useLocation();
const [row, setRow] = useState(null)
console.log(location.state?.row);
const row =location.state?.row;

useEffect(() => {
const storedRow = localStorage.getItem('row');
if (storedRow) {
setRow(JSON.parse(storedRow));
localStorage.removeItem('row')
}
}, [])
const price = row?.price;
// useEffect(() => {
// const storedRow = localStorage.getItem('row');
// if (storedRow) {
// setRow(JSON.parse(storedRow));
// localStorage.removeItem('row')
// }
// }, [])
// const price = row?.price;

return (
<div>
Expand Down
36 changes: 36 additions & 0 deletions src/Pages/payments/PaymentChoose.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { useEffect, useState } from "react";
import { Link, useLocation } from "react-router-dom";


const PaymentChoose = () => {

// useing localstore for geting data by navigate.
const location = useLocation();
const [row, setRow] = useState(null)
console.log(row);
useEffect(() => {
const storedRow = localStorage.getItem('row');
if (storedRow) {
setRow(JSON.parse(storedRow));
localStorage.removeItem('row')
}
}, [])
if (row === null) {
return <p>loading</p>
}
return (
<div className="hero min-h-screen bg-base-200">
<div className="hero-content flex-col lg:flex-row-reverse">

<div className="card flex-shrink-0 w-full max-w-sm shadow-2xl bg-base-300 p-10 ">
<p className="text-3xl font-serif p-3">Choose Your Payment Method</p>
<Link to='/dashbord/stripe-pay' state={{row}}><button className="btn btn-outline">Payment With Stripe</button></Link>
<Link><button className="btn btn-outline my-2">Payment With SSL_COMMARCE</button></Link>
</div>
</div>
</div>

);
};

export default PaymentChoose;
11 changes: 11 additions & 0 deletions src/Pages/payments/ssl/SslPay.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';

const SslPay = () => {
return (
<div>
SslPay
</div>
);
};

export default SslPay;
50 changes: 28 additions & 22 deletions src/Routes/router.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,79 +17,85 @@ import PaymentHistory from "../Dashbord/PaymentHistory/PaymentHistory";
import ManageUsers from "../Dashbord/ManageUsers/ManageUsers";
import ManageClass from "../Dashbord/ManageClass/ManageClass";
import Community from "../Pages/community/Community";
import PaymentChoose from "../Pages/payments/PaymentChoose";
import SslPay from "../Pages/payments/ssl/SslPay";
import DashbordHome from "../Dashbord/DashbordHome/DashbordHome";

export const router = createBrowserRouter([
{
path:'/',
path: '/',
element: <Main></Main>,
errorElement: <ErrorPage></ErrorPage>,
children:[
children: [
{
path:'/',
path: '/',
element: <Home></Home>
},
{
path:'/instructors',
path: '/instructors',
element: <Instructors></Instructors>
},
{
path:'/classes',
path: '/classes',
element: <Classes></Classes>
},
{
path: '/comming-soon',
element: <Community/>
element: <Community />
}
]

},
{
path:'/login',
path: '/login',
element: <Login></Login>
},
{
path:'/singup',
path: '/singup',
element: <Singup></Singup>
},
{
path:'/dashbord',
path: '/dashbord',
element: <PrivateRoute><Dashbord></Dashbord></PrivateRoute>,
children:[
children: [
{
path: '',
element: <DashbordHome/>
},
{
path:'addnew',
path: 'addnew',
element: <AddClass></AddClass>
},
{
path:'myclasses',
path: 'myclasses',
element: <MyClasses></MyClasses>
},
{
path:'mycart',
path: 'mycart',
element: <MySelectedClass></MySelectedClass>
},
{
path:'payment',
element: <Payment></Payment>
path: 'payment-choose',
element: <PaymentChoose />
},
{
path: 'ssl-pay',
element: <SslPay />
},
{
path: 'stripe-pay',
element: <Payment />
},
{
path:'enrolled-class',
path: 'enrolled-class',
element: <EnrolledClass></EnrolledClass>
},
{
path: 'payment-history',
element: <PaymentHistory></PaymentHistory>
},
{
path:'manage-users',
path: 'manage-users',
element: <ManageUsers></ManageUsers>
},
{
path:'manage-classes',
path: 'manage-classes',
element: <ManageClass></ManageClass>
}
]
Expand Down

0 comments on commit f06f28d

Please sign in to comment.