-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
started implementing analytics dashboard
- Loading branch information
1 parent
a1680db
commit dd5e2cb
Showing
7 changed files
with
212 additions
and
10 deletions.
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { useQuery } from '@apollo/client' | ||
import { | ||
GET_DASHBOARD_APPLY_CLICKS, | ||
GET_DASHBOARD_EMPLOYER_CLICKS, | ||
GET_DASHBOARD_JOB_CLICKS, | ||
} from '../graphql/queries/analyticsQueries' | ||
import { Chart } from 'react-google-charts' | ||
import styles from '../styles/Dashboard.module.css' | ||
import Navbar from '../src/components/general/Navbar' | ||
|
||
function Dashboard() { | ||
const { | ||
data: jobClicks, | ||
loading: jobClicksLoading, | ||
error: jobClicksError, | ||
} = useQuery(GET_DASHBOARD_JOB_CLICKS, { | ||
variables: { startDate: '2024-01-01', endDate: '2024-08-01' }, | ||
}) | ||
const { | ||
data: applyClicks, | ||
loading: applyClicksLoading, | ||
error: applyClicksError, | ||
} = useQuery(GET_DASHBOARD_APPLY_CLICKS, { | ||
variables: { startDate: '2024-01-01', endDate: '2024-08-01' }, | ||
}) | ||
const { | ||
data: employerClicks, | ||
loading: employerClicksLoading, | ||
error: employerClicksError, | ||
} = useQuery(GET_DASHBOARD_EMPLOYER_CLICKS, { | ||
variables: { startDate: '2024-01-01', endDate: '2024-08-01' }, | ||
}) | ||
|
||
if (jobClicksLoading || applyClicksLoading || employerClicksLoading) return <div>loading</div> | ||
|
||
const dailyClickCounts = [['Date', 'Daily Count'], ...jobClicks.daily.map((item: any) => [item.date, item.count])] | ||
const dailyChartOptions = { | ||
title: 'Daily Clicks', | ||
} | ||
|
||
return ( | ||
<> | ||
<Navbar /> | ||
<main> | ||
<Chart chartType='Line' width='80%' height='400px' data={dailyClickCounts} options={dailyChartOptions} /> | ||
</main> | ||
</> | ||
) | ||
} | ||
|
||
export default Dashboard |
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,16 @@ | ||
import React from "react"; | ||
import styles from "../../../styles/components/AdminPageButtons.module.css"; | ||
import Link from "next/link"; | ||
|
||
|
||
export default function DashboardButton(props:any) { | ||
const { text, link } = props; | ||
return ( | ||
<div> | ||
<Link href={link}> | ||
<button className={styles.adminFunctionButton}>{text}</button> | ||
</Link> | ||
</div> | ||
) | ||
|
||
} |
Empty file.