Skip to content

Commit

Permalink
Merge branch 'main' into feature-add-pinned-repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
Mridul2820 authored Apr 30, 2023
2 parents b674900 + dcd71fa commit 2d6045c
Show file tree
Hide file tree
Showing 47 changed files with 4,146 additions and 6,709 deletions.
4 changes: 0 additions & 4 deletions .babelrc

This file was deleted.

48 changes: 48 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
README.md

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage
/test

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

yarn.lock
.prettierignore
.gitignore
.eslintignore


public

.all-contributorsrc
45 changes: 45 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
module.exports = {
env: {
browser: true,
commonjs: true,
es6: true,
node: true,
},
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:import/errors",
"plugin:import/typescript",
"plugin:import/warnings",
"next/core-web-vitals",
"prettier",
],
parserOptions: {
ecmaFeatures: {
jsx: true,
arrowFunctions: true,
},
ecmaVersion: "latest",
sourceType: "module",
},
settings: {
react: {
version: "detect",
},
},
plugins: ["react"],
rules: {
"import/no-named-as-default": 0,
"react/prop-types": 0,
"import/extensions": 0,
"react/react-in-jsx-scope": "off",
"react/jsx-filename-extension": [1, { extensions: [".js", ".jsx"] }],
"react/display-name": 1,
"no-empty": 0,
"no-unused-vars": 1,
"no-console": 1,
"@next/next/no-script-component-in-head": 0,
"@next/next/no-img-element": 0,
"@next/next/no-html-link-for-pages": 0,
},
};
7 changes: 0 additions & 7 deletions .eslintrc.json

This file was deleted.

1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.next
build
node_modules
yarn.lock
Expand Down
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"useTabs": false,
"semi": true,
"singleQuote": true,
"singleQuote": false,
"endOfLine": "lf",
"printWidth": 80,
"tabWidth": 2,
Expand Down
22 changes: 11 additions & 11 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
- Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
- The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities
Expand Down Expand Up @@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,11 @@ git clone https://github.com/Mridul2820/git-o-get.git

```
GITHUB_TOKEN = <YOUR_GITHUB_TOKEN>
SITE_URL = <YOUR_URL_FOR_APP>
CLOUD_NAME = <YOUR_CLOUDINARY_CLOUD_NAME>
BASE_IMAGE_URL = <URL_FOR_BASE_IMAGE>
```

- **`GITHUB_TOKEN`: Get your `Personal Access Token` by signing in to your github account and then go to your setting -> developer setting -> Personal access tokens -> Generate new token**
- **`SITE_URL`: Your base URL for the app**
- **`CLOUD_NAME`: Create a [Cloudinary](https://cloudinary.com/users/register/free) account and Get your `CLOUD NAME`**
- **`BASE_IMAGE_URL`: Upload [Base Image](https://github.com/Mridul2820/git-o-get/blob/main/public/assets/github-social.jpg) in Your Cloudinary Cloud and Get the public Id**

Expand All @@ -111,4 +109,8 @@ npm run dev

<a href="CONTRIBUTING.md">Contributing Guide</a>

## All the best! 🥇
## ⭐ Project Contributors

<a href="https://github.com/Mridul2820/git-o-get/graphs/contributors" align="center">
<img src="https://contrib.rocks/image?repo=Mridul2820/git-o-get" />
</a>
6 changes: 3 additions & 3 deletions client.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ApolloClient, InMemoryCache, createHttpLink } from '@apollo/client';
import { setContext } from '@apollo/client/link/context';
import { ApolloClient, InMemoryCache, createHttpLink } from "@apollo/client";
import { setContext } from "@apollo/client/link/context";

const { GITHUB_TOKEN } = process.env;

// Create the http link
const httpLink = createHttpLink({
uri: 'https://api.github.com/graphql',
uri: "https://api.github.com/graphql",
});

// Generate and set the header with the auth details
Expand Down
17 changes: 9 additions & 8 deletions components/404/NotFound.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Link from 'next/link';
import React from 'react';
import { BiArrowBack } from 'react-icons/bi';
import Link from "next/link";
import React from "react";
import { BiArrowBack } from "react-icons/bi";

const NotFound = ({ image, message }) => {
return (
Expand All @@ -11,11 +11,12 @@ const NotFound = ({ image, message }) => {
className="w-full max-w-[500px]"
/>
<p className="text-center">{message}</p>
<Link href="/">
<a className="bg-purple-mid flex justify-center items-center gap-2 text-white px-5 py-2 text-lg rounded-lg">
<BiArrowBack />
Back to home
</a>
<Link
href="/"
className="bg-purple-mid flex justify-center items-center gap-2 text-white px-5 py-2 text-lg rounded-lg"
>
<BiArrowBack />
Back to home
</Link>
</div>
);
Expand Down
20 changes: 10 additions & 10 deletions components/graphs/ContributionGraph.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React from "react";
import {
LineChart,
Line,
Expand All @@ -7,8 +7,8 @@ import {
XAxis,
ResponsiveContainer,
CartesianGrid,
} from 'recharts';
import CustomTooltip from '../reuse/CustomTooltip';
} from "recharts";
import CustomTooltip from "../reuse/CustomTooltip";

const ContributionGraph = ({ weeks, username }) => {
let contributions = [];
Expand All @@ -33,21 +33,21 @@ const ContributionGraph = ({ weeks, username }) => {
};

return (
<div className="dark:bg-dark-color dark:text-white dark:border dark:border-gray-700 py-3 px-3 md:px-5 shadow-bs1 rounded-md h-full w-full min-h-[400px] bg-white relative">
<div className="card-item py-3 px-3 md:px-5 min-h-[400px] mt-5 relative">
<p className="text-center mb-5 text-xl font-semibold">
{username}&apos;s Contribution Graph
</p>
<p className="absolute -left-6 top-[50%] -rotate-90 hidden md:block">
<p className="absolute -left-6 top-1/2 -rotate-90 hidden md:block">
Contributions
</p>
<p className="absolute left-[50%] bottom-3 translate-x-[-50%] whitespace-nowrap">
Days{' '}
<p className="absolute left-1/2 bottom-3 -translate-x-1/2 whitespace-nowrap">
Days{" "}
<span className="font-semibold">
{'(' +
{"(" +
contributions[0].date +
' - ' +
" - " +
contributions.slice(-1)[0].date +
')'}
")"}
</span>
</p>
<div className="pb-8 pl-0 md:pl-4">
Expand Down
34 changes: 17 additions & 17 deletions components/graphs/LanguagePie.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { motion } from 'framer-motion';
import { sumBy } from 'lodash';
import React, { useState } from 'react';
import React, { useState } from "react";
import { motion } from "framer-motion";
import { sumBy } from "lodash";
import { v4 as uuidv4 } from "uuid";
import {
PieChart,
Pie,
Sector,
Cell,
ResponsiveContainer,
Tooltip,
Legend,
} from 'recharts';
} from "recharts";

const LanguagePie = ({ repositories }) => {
const [activeIndex, setActiveIndex] = useState(0);
Expand Down Expand Up @@ -45,18 +45,18 @@ const LanguagePie = ({ repositories }) => {
if (allLangs.length >= 5) {
const mainLangs = allLangs.slice(0, 4);

const sum_of_other = sumBy(allLangs.slice(4), 'size');
const sum_of_other = sumBy(allLangs.slice(4), "size");

formatLangs.push(...mainLangs, {
name: 'Others',
color: '#bbb',
name: "Others",
color: "#bbb",
size: sum_of_other,
});
} else {
formatLangs.push(...allLangs);
}

const sum_of_all_values = sumBy(formatLangs, 'size');
const sum_of_all_values = sumBy(formatLangs, "size");

const renderActiveShape = ({
cx,
Expand Down Expand Up @@ -94,11 +94,11 @@ const LanguagePie = ({ repositories }) => {
const CustomTooltip = ({ active, payload }) => {
if (active && payload && payload.length) {
return (
<div className="custom-tooltip backdrop-blur-sm shadow-bs1 bg-slate-50 p-2 dark:bg-dark-gray dark:text-white dark:border dark:border-gray-500">
<div className="custom-tooltip backdrop-blur-sm shadow-bs1 bg-slate-50 p-2 dark:bg-dark-gray dark:text-white border dark:border-gray-500">
{payload[0].name +
': ' +
": " +
((payload[0].value * 100) / sum_of_all_values).toFixed(2) +
'%'}
"%"}
</div>
);
}
Expand All @@ -109,12 +109,12 @@ const LanguagePie = ({ repositories }) => {
return (
<div className="flex justify-center mb-2">
<ul className="mx-auto">
{formatLangs?.map((entry, index) => (
<li key={`item-${index}`} className="flex items-center gap-2">
{formatLangs?.map((entry) => (
<li key={uuidv4()} className="flex items-center gap-2">
<div className="h-3 w-3" style={{ background: entry.color }} />
<span className="text-sm select-none">{entry.name}</span>
<span>
{((entry.size * 100) / sum_of_all_values).toFixed(2) + '%'}
{((entry.size * 100) / sum_of_all_values).toFixed(2) + "%"}
</span>
</li>
))}
Expand All @@ -125,7 +125,7 @@ const LanguagePie = ({ repositories }) => {

return (
<motion.div
className="dark:bg-dark-color dark:text-white dark:border dark:border-gray-700 p-3 pb-0 shadow-bs1 rounded-md h-full w-full min-h-[400px] max-w-[380px] bg-white"
className="card-item dark:border-gray-700 p-3 pb-0 min-h-[442px] max-w-[380px]"
transition={{ duration: 1 }}
initial={{ scale: 0 }}
animate={{ scale: 1 }}
Expand All @@ -146,7 +146,7 @@ const LanguagePie = ({ repositories }) => {
>
{formatLangs.map((entry, index) => (
<Cell
key={`cell-${index}`}
key={uuidv4()}
fill={entry.color}
onMouseOver={() => onPieEnter(index)}
/>
Expand Down
Loading

0 comments on commit 2d6045c

Please sign in to comment.