-
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.
music stat component added to dashbord
- Loading branch information
Showing
7 changed files
with
156 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React, { useState } from "react"; | ||
import AdminDashboard from "../modules/AdminDashboard"; | ||
import PageCard from "../modules/__modules__/Card/PageCard"; | ||
|
||
const AdminDashboardPage = () => { | ||
const [isTopNav, setIsTopNav] = useState(false); | ||
return ( | ||
<PageCard setIsTopNav={setIsTopNav}> | ||
<AdminDashboard isTopNav={isTopNav} /> | ||
</PageCard> | ||
); | ||
}; | ||
|
||
export default AdminDashboardPage; |
45 changes: 45 additions & 0 deletions
45
components/modules/AdminDashboard/_modules/Cards/MusicStatisticCard.jsx
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,45 @@ | ||
import React from "react"; | ||
import { VInfo, VStatsChart } from "../../../__modules/Vectors"; | ||
import PropsTypes from "prop-types"; | ||
|
||
const MusicStatisticCard = ({ | ||
statTitle, | ||
statValue, | ||
statIcon, | ||
iconColorClassName, | ||
iconBgClassName, | ||
}) => { | ||
return ( | ||
<div className="bg-white shadow-lg rounded-xl my-5 w-full p-5 mobile:m-0"> | ||
<div className="flex justify-between py-5 items-center"> | ||
<p className="font-bold">{statTitle}</p> | ||
<p className="text-gray-700"> | ||
<VInfo /> | ||
</p> | ||
</div> | ||
<div className="flex justify-between items-center pt-2"> | ||
<p className={`${iconColorClassName}`}> | ||
<VStatsChart className="text-2xl" /> | ||
</p> | ||
<div className="flex items-center gap-3"> | ||
<p className="text-3xl font-semibold">{statValue}</p> | ||
<p | ||
className={`${iconColorClassName} text-2xl bg-opacity-20 p-5 rounded-full ${iconBgClassName}`} | ||
> | ||
{statIcon} | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
MusicStatisticCard.propTypes = { | ||
statTitle: PropsTypes.string.isRequired, | ||
statValue: PropsTypes.string.isRequired, | ||
statIcon: PropsTypes.element.isRequired, | ||
iconColorClassName: PropsTypes.string.isRequired, | ||
iconBgClassName: PropsTypes.string.isRequired, | ||
}; | ||
|
||
export default MusicStatisticCard; |
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,48 @@ | ||
import React from "react"; | ||
import numberConverter from "../utils/helpers/numberConverter"; | ||
import { VImageCard, VRadar, VRefund, VTag } from "../__modules/Vectors"; | ||
import MusicStatisticCard from "./_modules/Cards/MusicStatisticCard"; | ||
import PropsTypes from "prop-types"; | ||
|
||
const AdminDashboard = ({ isTopNav }) => { | ||
return ( | ||
<div className={`my-24 mr-5 ${isTopNav && "my-40"} transition-all`}> | ||
<div className="flex gap-5 mobile:grid mobile:grid-cols-2 mobilesm:grid-cols-1"> | ||
<MusicStatisticCard | ||
statTitle="Music Artist" | ||
statValue={numberConverter(352)} | ||
statIcon={<VImageCard />} | ||
iconColorClassName="text-primary" | ||
iconBgClassName="bg-primary" | ||
/> | ||
<MusicStatisticCard | ||
statTitle="Music Album" | ||
statValue={numberConverter(987)} | ||
statIcon={<VTag />} | ||
iconColorClassName="text-[#1ee2ac]" | ||
iconBgClassName="bg-[#1ee2ac]" | ||
/> | ||
<MusicStatisticCard | ||
statTitle="Music Followers" | ||
statValue={numberConverter(25012)} | ||
statIcon={<VRadar />} | ||
iconColorClassName="text-[#ff7750]" | ||
iconBgClassName="bg-[#ff7750]" | ||
/> | ||
<MusicStatisticCard | ||
statTitle="Music comments" | ||
statValue={numberConverter(5300000)} | ||
statIcon={<VRefund />} | ||
iconColorClassName="text-[#00d0ff]" | ||
iconBgClassName="bg-[#00d0ff]" | ||
/> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
AdminDashboard.propsTypes = { | ||
isTopNav: PropsTypes.bool.isRequired, | ||
}; | ||
|
||
export default AdminDashboard; |
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,16 @@ | ||
const M_NUMBER_UNIT = 1000000; | ||
const K_NUMBER_UNIT = 1000; | ||
|
||
const numberConverter = (value) => { | ||
if (value >= M_NUMBER_UNIT) { | ||
const convertedNumber = (value / M_NUMBER_UNIT).toFixed(2) + "M"; | ||
return convertedNumber; | ||
} | ||
if (value >= K_NUMBER_UNIT) { | ||
const convertedNumber = (value / K_NUMBER_UNIT).toFixed(2) + "K"; | ||
return convertedNumber; | ||
} | ||
return value; | ||
}; | ||
|
||
export default numberConverter; |
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,12 @@ | ||
import React from "react"; | ||
import AdminDashboardPage from "../../components/AdminDashboardPage"; | ||
|
||
const dashboard = () => { | ||
return ( | ||
<div className="bg-globalBg h-screen"> | ||
<AdminDashboardPage /> | ||
</div> | ||
); | ||
}; | ||
|
||
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