-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1655 from aswanthabam/dev
feat: Learning Circle Pages
- Loading branch information
Showing
24 changed files
with
1,407 additions
and
316 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
96 changes: 96 additions & 0 deletions
96
src/modules/Dashboard/modules/LearningCircle/pages/LcAdmin/LcAdmin.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
import Pagination from "@/MuLearnComponents/Pagination/Pagination"; | ||
import Table, { Data } from "@/MuLearnComponents/Table/Table"; | ||
import THead from "@/MuLearnComponents/Table/THead"; | ||
import { dashboardRoutes } from "@/MuLearnServices/urls"; | ||
import { ReactJSXElement } from "@emotion/react/types/jsx-namespace"; | ||
import { ReactElement, useEffect, useState } from "react"; | ||
import { getVerifiableMeetups } from "../../services/LearningCircleAPIs"; | ||
|
||
const LcAdmin = () => { | ||
const [isLoading, setIsLoading] = useState<boolean>(false); | ||
const [data, setData] = useState<any[]>([]); | ||
const [currentPage, setCurrentPage] = useState(1); | ||
const [totalPages, setTotalPages] = useState(1); | ||
const [perPage, setPerPage] = useState(20); | ||
const [sort, setSort] = useState(""); | ||
|
||
useEffect(() => { | ||
setIsLoading(true); | ||
getVerifiableMeetups().then(res => { | ||
console.log(res); | ||
setData(res); | ||
setIsLoading(false); | ||
}); | ||
}, []); | ||
|
||
const columnOrder: { | ||
column: string; | ||
Label: string; | ||
isSortable: boolean; | ||
wrap?: ( | ||
data: string | ReactElement, | ||
id: string, | ||
row: Data | ||
) => ReactJSXElement; | ||
}[] = [ | ||
{ | ||
column: "learning_circle", | ||
Label: "Learning Circle", | ||
isSortable: false | ||
}, | ||
{ column: "title", Label: "Meetup Title", isSortable: false }, | ||
{ column: "join_count", Label: "Join Count", isSortable: false }, | ||
{ | ||
column: "interested_count", | ||
Label: "Interest Count", | ||
isSortable: false | ||
}, | ||
{ | ||
column: "report_submitted_attendees", | ||
Label: "Report Submitted Attendees", | ||
isSortable: false | ||
}, | ||
{ | ||
column: "held_on", | ||
Label: "Started At", | ||
isSortable: false | ||
} | ||
]; | ||
return ( | ||
<> | ||
<Table | ||
isloading={isLoading} | ||
rows={data} | ||
page={currentPage} | ||
perPage={perPage} | ||
columnOrder={columnOrder} | ||
id={["id"]} | ||
onVerifyClick={() => {}} | ||
> | ||
<THead | ||
columnOrder={columnOrder} | ||
onIconClick={() => {}} | ||
action={false} | ||
/> | ||
<div> | ||
{!isLoading && ( | ||
<Pagination | ||
currentPage={currentPage} | ||
totalPages={totalPages} | ||
margin="10px 0" | ||
handleNextClick={() => {}} | ||
handlePreviousClick={() => {}} | ||
onSearchText={() => {}} | ||
onPerPageNumber={() => {}} | ||
perPage={perPage} | ||
setPerPage={setPerPage} | ||
/> | ||
)} | ||
</div> | ||
{/*use <Blank/> when u don't need <THead /> or <Pagination inside <Table/> cause <Table /> needs atleast 2 children*/} | ||
</Table> | ||
</> | ||
); | ||
}; | ||
|
||
export default LcAdmin; |
Oops, something went wrong.