-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add lightmode darkmode and traslation
- Loading branch information
Showing
7 changed files
with
246 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
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,60 @@ | ||
import useTextDirection from '@/hooks/useTextDirection'; | ||
import { use } from 'react'; | ||
import { getData } from '@/app/[locale]/leaderboard/getData'; | ||
export default function LeaderBoardChart() { | ||
const leaderBoardData = use(getData()); | ||
|
||
const direction = useTextDirection(); | ||
|
||
return ( | ||
<div | ||
dir={direction} | ||
className=" bg-lightAccBg overflow-y-auto h-2/3 w-2/3 flex flex-col gap-6 self-center ring-8 rounded-sm dark:bg-darkAccBg dark:ring-offset-darkAccBg p-2 " | ||
> | ||
{leaderBoardData.props.leaderboard.members.map((contributor, place) => { | ||
const pathDevelp = contributor | ||
|
||
return ( | ||
<div | ||
|
||
key={pathDevelp.node_id} | ||
className="w-full flex flex-col md:flex-row ring-4 h-fit p-2 rounded-md md:gap-6 " | ||
> | ||
<div className="flex gap-3 "> | ||
<span>#{place + 1}</span> | ||
<img | ||
className="rounded-full object-cover h-10 w-10" | ||
src={pathDevelp.avatar_url} | ||
alt="" | ||
/> | ||
<div className="flex flex-col"> | ||
<a | ||
className="truncate text-xs self-center font-bold underline decoration-blue-400 cursor-pointer w-20" | ||
target="_blank" | ||
href="" | ||
> | ||
{pathDevelp.name} | ||
</a> | ||
<span className="text-gray-500 text-xs self-end justify-start max-md:hidden"> | ||
{pathDevelp.stats.commits} commits | ||
</span> | ||
<span className="text-gray-500 text-xs self-end justify-start max-md:hidden"> | ||
score:{pathDevelp.score}{' '} | ||
</span> | ||
</div> | ||
</div> | ||
<span className="text-gray-500 text-xs md:hidden"> | ||
{pathDevelp.stats.commits} commits | ||
</span> | ||
<span className="text-green-500 text-xs"> | ||
{pathDevelp.stats.additions}++ | ||
</span> | ||
<span className="text-red-500 text-xs"> | ||
{pathDevelp.stats.deletions}-- | ||
</span> | ||
</div> | ||
); | ||
})} | ||
</div> | ||
); | ||
} |
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,64 @@ | ||
import { getData } from '@/app/[locale]/leaderboard/getData'; | ||
import useTextDirection from '@/hooks/useTextDirection'; | ||
import React from 'react'; | ||
import { use } from 'react'; | ||
export default function Monthly() { | ||
const leaderBoardData = use(getData()); | ||
|
||
|
||
const Monthly = leaderBoardData.props.leaderboard.members[leaderBoardData.props.leaderboard.members.length - 1]; | ||
const direction = useTextDirection(); | ||
|
||
|
||
return ( | ||
<div | ||
dir={direction} | ||
className="bg-lightAccBg min-h-[50dvh] ring-8 rounded-sm shadow-2xl dark:bg-darkAccBg dark:ring-offset-darkAccBg p-5 hover:shadow-discordLight " | ||
> | ||
<div className="flex justify-between"> | ||
<div className="flex flex-col gap-3 md:gap-6 "> | ||
<span>name:{Monthly.name}</span> | ||
<span> | ||
additions: | ||
<span className="text-green-500">{Monthly.stats.additions}</span> | ||
</span> | ||
<span> | ||
deletions: | ||
<span className="text-red-500">{Monthly.stats.deletions}</span> | ||
</span> | ||
<span>score:{Monthly.score}</span> | ||
</div> | ||
<img | ||
className="object-cover h-20 w-20 rounded-full" | ||
src={Monthly.avatar_url} | ||
alt="opps" | ||
/> | ||
</div> | ||
<h4 className="m-10">projects</h4> | ||
<div className="flex flex-wrap gap-3"> | ||
{Monthly.projects_names.map((project, index) => { | ||
return ( | ||
<a | ||
key={index} | ||
target="_blank" | ||
href={`https://github.com/${project.url}`} | ||
> | ||
{project.name} | ||
</a> | ||
); | ||
})} | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
// Dark Mode Colors | ||
// darkBg: colors.slate[950], | ||
// darkAccBg: colors.slate[800], | ||
// lightText: colors.slate[50], | ||
// discordDark: colors.white, | ||
|
||
// lightBg: colors.slate[100], | ||
// lightAccBg: colors.indigo[100], | ||
// darkText: colors.slate[950], | ||
// discordLight: colors.indigo[400], |
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,38 @@ | ||
import useTextDirection from '@/hooks/useTextDirection'; | ||
import { use } from 'react'; | ||
import { getData } from '@/app/[locale]/leaderboard/getData'; | ||
export default function Weekly() { | ||
const direction = useTextDirection(); | ||
const leaderBoardData = use(getData()); | ||
const Weekly = leaderBoardData.props.leaderboard.members[leaderBoardData.props.leaderboard.members.length-1]; | ||
console.log(leaderBoardData.props.leaderboard); | ||
|
||
return ( | ||
<div | ||
className="bg-lightAccBg max-h-[40dvh] ring-8 rounded-sm dark:bg-darkAccBg dark:ring-offset-darkAccBg p-5 shadow-2xl hover:shadow-discordLight " | ||
dir={direction} | ||
> | ||
<div className="flex justify-between"> | ||
<div className="flex flex-col gap-4 "> | ||
<span>name:{Weekly.name}</span> | ||
|
||
<span> | ||
additions: | ||
<span className="text-green-500">{Weekly.stats.additions}</span> | ||
</span> | ||
<span> | ||
deletions:{' '} | ||
<span className="text-red-500">{Weekly.stats.deletions}</span> | ||
</span> | ||
<span>commits:{Weekly.stats.commits}</span> | ||
<span>score:{Weekly.score}</span> | ||
</div> | ||
<img | ||
className="object-cover h-20 w-20 rounded-full" | ||
src={Weekly.avatar_url} | ||
alt="" | ||
/> | ||
</div> | ||
</div> | ||
); | ||
} |
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,37 @@ | ||
export type Welcome = { | ||
data: Data; | ||
}; | ||
|
||
export type Data = { | ||
data?: Array<Array<DatumClass | string>>; | ||
since?: Date; | ||
until?: Date; | ||
}; | ||
|
||
export type DatumClass = { | ||
name?: string; | ||
nodeID?: string; | ||
projectsNames?: ProjectsName[]; | ||
avatarURL?: string; | ||
score?: number; | ||
stats?: Stats; | ||
}; | ||
|
||
export type ProjectsName = { | ||
url?: URL; | ||
name?: Name; | ||
}; | ||
|
||
export enum Name { | ||
MaakafWebsite = 'maakaf-website', | ||
} | ||
|
||
export enum URL { | ||
MaakafMaakafWebsite = 'maakaf/maakaf-website', | ||
} | ||
|
||
export type Stats = { | ||
additions?: number; | ||
deletions?: number; | ||
commits?: number; | ||
}; |
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