Skip to content

Commit

Permalink
Merge pull request #101 from zwenie-tech/irshana/check
Browse files Browse the repository at this point in the history
Irshana/check
  • Loading branch information
Rohith272 authored Sep 6, 2024
2 parents e5e78a8 + 16b55a2 commit 8e2459c
Show file tree
Hide file tree
Showing 8 changed files with 1,248 additions and 161 deletions.
17 changes: 17 additions & 0 deletions src/app/admin/activity/edit-activity/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"use client"; // Ensures this page uses client-side rendering

import { useParams } from "next/navigation";

const EDITActivityPage = () => {
const params = useParams(); // Access dynamic route parameters
const { id } = params; // Get the dynamic ID from the URL

return (
<div>
<h1>Edit Activity</h1>
<p>Activity ID: {id}</p> {/* Display the ID only */}
</div>
);
};

export default EDITActivityPage;
180 changes: 173 additions & 7 deletions src/app/admin/activity/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,175 @@
import React from 'react'
// import React from 'react'

function Page() {
return (
<div>activity</div>
)
}
// function Page() {
// return (
// <div>coordinators</div>
// )
// }

// export default Page
"use client";

import { ClientSideRowModelModule } from "@ag-grid-community/client-side-row-model";
import {
ColDef,
ModuleRegistry,
RowClickedEvent,
} from "@ag-grid-community/core";
import { AgGridReact } from "@ag-grid-community/react";
// import "@ag-grid-community/styles/ag-grid.css";
// import "@ag-grid-community/styles/ag-theme-quartz.css";
import "../../admin/ag-grid-theme-builder.css";
import { useRouter } from "next/navigation";
import React, { StrictMode, useMemo, useState } from "react";

ModuleRegistry.registerModules([ClientSideRowModelModule]);

export default Page
const Activity = () => {
const router = useRouter();
const [rowData, setRowData] = useState([
{
id: 1,
name: "John",
activityLink: "[email protected]",
Description: "jonh",
viewLike: "abc",
value: "India",
groupname: "Kerala",
schoolcategory:"MLP",
schooltypr:"Tirur",
eductionDist:"edfs",
educationSubDist:12,
sohodaya:"ABCD",
block:"Anus",
project:"edfs",
chapter:12,
conutry:"ABCD",
state:"Anus"
},
{
id: 2,
name: "John",
activityLink: "[email protected]",
Description: "jonh",
viewLike: "abc",
value: "India",
groupname: "Kerala",
schoolcategory:"MLP",
schooltypr:"Tirur",
eductionDist:"edfs",
educationSubDist:12,
sohodaya:"ABCD",
block:"Anus",
project:"edfs",
chapter:12,
conutry:"ABCD",
state:"Anus"
},
{
id: 3,
name: "John",
activityLink: "[email protected]",
Description: "jonh",
viewLike: "abc",
value: "India",
groupname: "Kerala",
schoolcategory:"MLP",
schooltypr:"Tirur",
eductionDist:"edfs",
educationSubDist:12,
sohodaya:"ABCD",
block:"Anus",
project:"edfs",
chapter:12,
conutry:"ABCD",
state:"Anus"
},
{
id: 4,
name: "John",
activityLink: "[email protected]",
Description: "jonh",
viewLike: "abc",
value: "India",
groupname: "Kerala",
schoolcategory:"MLP",
schooltypr:"Tirur",
eductionDist:"edfs",
educationSubDist:12,
sohodaya:"ABCD",
block:"Anus",
project:"edfs",
chapter:12,
conutry:"ABCD",
state:"Anus"},
{
id: 5,
name: "John",
activityLink: "[email protected]",
Description: "jonh",
viewLike: "abc",
value: "India",
groupname: "Kerala",
schoolcategory:"MLP",
schooltype:"Tirur",
eductionDist:"edfs",
educationSubDist:12,
sohodaya:"ABCD",
block:"Anus",
project:"edfs",
chapter:12,
conutry:"ABCD",
state:"Anus"
}
]);

const [columnDefs, setColumnDefs] = useState<ColDef[]>([
{ field: "name", headerName: "Name" },
{ field: "activityLink", headerName: "Activity Link" },
{ field: "Description", headerName: "Description" },
{ field: "viewLike", headerName: "View and Like" },
{ field: "value", headerName: "Value" },
{ field: "groupname", headerName: "Group Name" },
{ field: "schoolcategory", headerName: "School Category" },
{ field: "schooltype", headerName: "School Type" },
{ field: "eductionDist", headerName: "Education District" },
{ field: "educationSubDist", headerName: "Education Sub District" },
{ field: "sohodaya", headerName: "Sahodaya" },
{ field: "block", headerName: "Block" },
{ field: "project", headerName: "Project" },
{ field: "chapter", headerName: "Chapter" },
{ field: "conutry", headerName: "Conutry" },
{ field: "state", headerName: "State" },
]);

const defaultColDef = useMemo(() => {
return {
filter: "agTextColumnFilter",
floatingFilter: true,
};
}, []);
const onRowClicked = (event: RowClickedEvent) => {
// console.log(event.data);
const id = event.data.id;
router.push(`activity/edit-activity/${id}`);
};

return (
<div className=" bg-slate-100">
<div className={"ag-theme-quartz"} style={{ height: 600 }}>
<AgGridReact
rowData={rowData}
columnDefs={columnDefs}
defaultColDef={defaultColDef}
onRowClicked={onRowClicked}
rowSelection="multiple"
suppressRowClickSelection={true}
pagination={true}
paginationPageSize={10}
paginationPageSizeSelector={[10, 25, 50]}
/>
</div>
</div>
);
};
export default Activity;
17 changes: 17 additions & 0 deletions src/app/admin/contact-us-form/edit-contact/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"use client"; // Ensures this page uses client-side rendering

import { useParams } from "next/navigation";

const EDITActivityPage = () => {
const params = useParams(); // Access dynamic route parameters
const { id } = params; // Get the dynamic ID from the URL

return (
<div>
<h1>Edit Activity</h1>
<p>Activity ID: {id}</p> {/* Display the ID only */}
</div>
);
};

export default EDITActivityPage;
121 changes: 114 additions & 7 deletions src/app/admin/contact-us-form/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,116 @@
import React from 'react'
// import React from 'react'

function Page() {
return (
<div>contact-us-form</div>
)
}
// function Page() {
// return (
// <div>coordinators</div>
// )
// }

// export default Page
"use client";

import { ClientSideRowModelModule } from "@ag-grid-community/client-side-row-model";
import {
ColDef,
ModuleRegistry,
RowClickedEvent,
} from "@ag-grid-community/core";
import { AgGridReact } from "@ag-grid-community/react";
// import "@ag-grid-community/styles/ag-grid.css";
// import "@ag-grid-community/styles/ag-theme-quartz.css";
import "../../admin/ag-grid-theme-builder.css";
import { useRouter } from "next/navigation";
import React, { StrictMode, useMemo, useState } from "react";

ModuleRegistry.registerModules([ClientSideRowModelModule]);

export default Page
const Contact = () => {
const router = useRouter();
const [rowData, setRowData] = useState([
{
id: 1,
name: "John",
email: "[email protected]",
subject: "jonh",
messege: "abc",
LSGD: "India",
district: "Kerala",

},
{
id: 2,
name: "John",
email: "[email protected]",
subject: "jonh",
messege: "abc",
LSGD: "India",
district: "Kerala",
},
{
id: 3,
name: "John",
email: "[email protected]",
subject: "jonh",
messege: "abc",
LSGD: "India",
district: "Kerala",
},
{
id: 4,
name: "John",
email: "[email protected]",
subject: "jonh",
messege: "abc",
LSGD: "India",
district: "Kerala",},
{
id: 5,
name: "John",
email: "[email protected]",
subject: "jonh",
messege: "abc",
LSGD: "India",
district: "Kerala",
}
]);

const [columnDefs, setColumnDefs] = useState<ColDef[]>([
{ field: "name", headerName: "Name" },
{ field: "email", headerName: "Email" },
{ field: "subject", headerName: "Subject" },
{ field: "messege", headerName: "Messege" },
{ field: "LSGD", headerName: "LSGD" },
{ field: "district", headerName: "District " },
]);

const defaultColDef = useMemo(() => {
return {
filter: "agTextColumnFilter",
floatingFilter: true,
};
}, []);
const onRowClicked = (event: RowClickedEvent) => {
// console.log(event.data);
const id = event.data.id;
router.push(`contact-us-form/edit-contact/${id}`);
};

return (
<div className=" bg-slate-100">
<div className={"ag-theme-quartz"} style={{ height: 600 }}>
<AgGridReact
rowData={rowData}
columnDefs={columnDefs}
defaultColDef={defaultColDef}
onRowClicked={onRowClicked}
rowSelection="multiple"
suppressRowClickSelection={true}
pagination={true}
paginationPageSize={10}
paginationPageSizeSelector={[10, 25, 50]}
/>
</div>
</div>
);
};
export default Contact;
17 changes: 17 additions & 0 deletions src/app/admin/coordinators/edit-coordinator/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"use client"; // Ensures this page uses client-side rendering

import { useParams } from "next/navigation";

const EditCoordinatorPage = () => {
const params = useParams(); // Access dynamic route parameters
const { id } = params; // Get the dynamic ID from the URL

return (
<div>
<h1>Edit Coordinator</h1>
<p>Coordinator ID: {id}</p> {/* Display the ID only */}
</div>
);
};

export default EditCoordinatorPage;
Loading

0 comments on commit 8e2459c

Please sign in to comment.