Skip to content

Commit

Permalink
⚙️ Release GRFG v1.0.0 (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
SashenJayathilaka committed Apr 28, 2023
1 parent 2a5ea4d commit b5684ae
Show file tree
Hide file tree
Showing 39 changed files with 437 additions and 214 deletions.
7 changes: 0 additions & 7 deletions .env.local

This file was deleted.

26 changes: 26 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## What type of PR is this? (check all applicable)

- [ ] Refactor
- [ ] Feature
- [ ] Bug Fix
- [ ] Enhancement
- [ ] Documentation Update

## Description

## Related Tickets & Documents

## QA Instructions, Screenshots, Recordings

_Please replace this line with instructions on how to test your changes, as well
as any relevant images for UI changes._

## Added tests?

- [ ] yes
- [ ] no, because they aren't needed
- [ ] no, because I need help

## Added to documentation?

- [ ] readme
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local
.env

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
next-env.d.ts
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.cache
.next
package.json
package-lock.json
Expand Down
1 change: 1 addition & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test
18 changes: 18 additions & 0 deletions app/error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"use client";

import EmptyState from "@/components/EmptyState";
import { useEffect } from "react";

type Props = {
error: Error;
};

function ErrorPage({ error }: Props) {
useEffect(() => {
console.log("🚀 ~ file: error.tsx:12 ~ ErrorState ~ error:", error);
}, [error]);

return <EmptyState />;
}

export default ErrorPage;
Binary file removed app/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import "../styles/globals.css";
export const metadata = {
title: "Readme Generator",
description: "Github Readme File Generator",
icons: "",
};

export default async function RootLayout({
Expand Down
9 changes: 9 additions & 0 deletions app/loading.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import GlobalLoading from "@/components/GlobalLoading";

type Props = {};

function LoadingPage({}: Props) {
return <GlobalLoading isLoading={true} />;
}

export default LoadingPage;
2 changes: 2 additions & 0 deletions atom/gitHubDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type gitHubDetail = {
name: string;
twitter: string;
email: string;
isTable: string;
};

const defaultPostState: gitHubDetail = {
Expand All @@ -16,6 +17,7 @@ const defaultPostState: gitHubDetail = {
name: "",
twitter: "",
email: "",
isTable: "",
};

export const gitHubDetails = atom<gitHubDetail>({
Expand Down
18 changes: 0 additions & 18 deletions atom/middleController.ts

This file was deleted.

18 changes: 0 additions & 18 deletions atom/technology.ts

This file was deleted.

21 changes: 3 additions & 18 deletions components/BodyContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { gitBadge } from "@/atom/displayBadges";
import { gitHubDetails } from "@/atom/gitHubDetails";
import { gitImages } from "@/atom/images";
import { middleControllers } from "@/atom/middleController";
import { readmeRows } from "@/atom/readmeRow";
import { gitImagesSizes } from "@/atom/size";
import { gitTechStack } from "@/atom/techStack";
Expand All @@ -14,7 +13,6 @@ import {
GitHubImages,
GitHubImagesSize,
GitHubTechStack,
MiddleController,
ReadmeRow,
} from "@/type";
import { Divider } from "@mui/material";
Expand Down Expand Up @@ -45,7 +43,6 @@ function BodyContent({}: Props) {
const [images, setImages] = useRecoilState(gitImages);
const [size, setSize] = useRecoilState(gitImagesSizes);
const [displayBadges, setDisplayBadges] = useRecoilState(gitBadge);
const [controllers, setControllers] = useRecoilState(middleControllers);

const {
updateFirstElement,
Expand All @@ -54,7 +51,6 @@ function BodyContent({}: Props) {
updateFourthElement,
updateFifthElement,
updateSixthElement,
updateSeventhElement,
} = updateCurrentStateValue();

const [firstElement, setFirstElement] =
Expand All @@ -65,17 +61,14 @@ function BodyContent({}: Props) {
const [fourthElement, setFourthElement] = useState<GitHubImages>(images);
const [fifthElement, setFifthElement] = useState<GitHubImagesSize>(size);
const [sixthElement, setSixthElement] = useState<GitBadges>(displayBadges);
const [seventhElement, setSevenElement] =
useState<MiddleController>(controllers);

const KeepCacheUpdated = (
firstStore: GitHubTechStack,
secondStore: GitHubDetail,
thirdStore: ReadmeRow,
fourthStore: GitHubImages,
fifthStore: GitHubImagesSize,
sixthStore: GitBadges,
seventhStore: MiddleController
sixthStore: GitBadges
) => {
localStorage.setItem(
"cache",
Expand All @@ -86,7 +79,6 @@ function BodyContent({}: Props) {
fourthStore,
fifthStore,
sixthStore,
seventhStore,
})
);

Expand Down Expand Up @@ -130,11 +122,6 @@ function BodyContent({}: Props) {
? { ...gitHubTechStack, ...cache.sixthStore }
: gitHubTechStack
);
setSevenElement(
cache.seventhStore
? { ...gitHubTechStack, ...cache.seventhStore }
: gitHubTechStack
);
};

const OnChangeAction = () => {
Expand All @@ -144,8 +131,7 @@ function BodyContent({}: Props) {
readmeRow,
images,
size,
displayBadges,
controllers
displayBadges
);

setAction(true);
Expand All @@ -164,7 +150,6 @@ function BodyContent({}: Props) {
updateFourthElement(fourthElement, setImages);
updateFifthElement(fifthElement, setSize);
updateSixthElement(sixthElement, setDisplayBadges);
updateSeventhElement(seventhElement, setControllers);
};

useEffect(() => {
Expand All @@ -173,7 +158,7 @@ function BodyContent({}: Props) {

return (
<>
{!isShow && <SmallHeader />}
<SmallHeader />
<div className="px-12 py-12 items-center">
{isShow ? (
<>
Expand Down
2 changes: 1 addition & 1 deletion components/ButtonActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function ButtonActions({ setIsShow, setIsMdPreview, isMdPreview }: Props) {
<span>Download Markdown</span>
</button>
<button
onClick={() => setIsShow(true)}
onClick={() => toast.info("This feature will be coming soon")}
className="bg-gray-300 hover:bg-gray-400 text-gray-800 font-bold py-2 px-4 rounded inline-flex items-center gap-2"
>
<AiOutlineSave size={20} />
Expand Down
60 changes: 42 additions & 18 deletions components/Contents/Languages.tsx
Original file line number Diff line number Diff line change
@@ -1,41 +1,65 @@
"use client";

import { gitTechnologies } from "@/atom/technology";
import updateState from "@/hook/updateState";
import { boxLabel } from "@/lib/boxLabel";
import { Checkbox, Tooltip } from "@mui/material";
import { useRecoilState } from "recoil";
import { useEffect, useState } from "react";

type Props = {
label: string;
image: string;
stateTechnologies: string[];
listOfTechnologies: string[];
setListOfTechnologies: (value: any) => void;
setStateTechnologies: (value: any) => void;
};

function Languages({ label, image }: Props) {
const [technology, setTechnology] = useRecoilState(gitTechnologies);
const { images } = updateState();

const boxLabel = { inputProps: { "aria-label": "Checkbox demo" } };
function Languages({
label,
image,
stateTechnologies,
listOfTechnologies,
setListOfTechnologies,
setStateTechnologies,
}: Props) {
const [isAtomValueExits, setIsAtomValueExits] = useState(false);

const onChangeTechnology = () => {
if (images.updatedStateTechnology.includes(image)) {
setTechnology((prev) => ({
if (isAtomValueExits) {
const removeCurrentState = listOfTechnologies.filter(
(element: any) => element.label !== label
);
setListOfTechnologies(removeCurrentState);

const removeItem = stateTechnologies.filter(
(element: any) => element.label !== label
);
setStateTechnologies((prev: any) => ({
...prev,
[label]: null,
skills: removeItem,
}));
} else {
setTechnology((prev) => ({
...prev,
[label]: image,
}));
const element = { label, image };
setListOfTechnologies((ls: any) => [
...ls,
...stateTechnologies,
element,
]);
}
};

useEffect(() => {
const isExits = stateTechnologies.some(function (el: any) {
return el.label === label;
});
setIsAtomValueExits(isExits);
}, [stateTechnologies]);

return (
<div>
<Tooltip title={label}>
<div
className={`flex justify-between items-center border border-[#0F2557] w-full overflow-hidden rounded-xl px-4 py-4 space-y-2 hover:bg-[#161748] hover-shadow-xl hover:text-black cursor-pointer ${
images.updatedStateTechnology.includes(image) && "bg-[#04082b]"
isAtomValueExits && "bg-[#04082b]"
}`}
onClick={onChangeTechnology}
>
Expand All @@ -45,9 +69,9 @@ function Languages({ label, image }: Props) {
name={label}
sx={{ color: "#fff" }}
color="default"
checked={images.updatedStateTechnology.includes(image)}
checked={isAtomValueExits}
/>
{images.updatedStateTechnology.includes(image) ? (
{isAtomValueExits ? (
<img
src={image}
alt={label}
Expand Down
22 changes: 14 additions & 8 deletions components/Contents/SmallHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,31 @@ function SmallHeader({}: Props) {
useEffect(() => {
setFirstImageArr(secondLine[Math.floor(Math.random() * secondLine.length)]);
}, [secondLine]);

return (
<div className="flex justify-center items-center px-4">
<div className="flex justify-center items-center px-4 py-2.5">
<div className="flex flex-col justify-between">
<div className="flex justify-between gap-4 items-center">
<div className="flex flex-col justify-between items-center">
<img className="w-36" src={firstImageArr!} alt="" />
<p className="text-xl font-medium">
Github Repository Readme.Md Generator
</p>
<img className="w-36" src={firstImageArr!} alt="" />
</div>
<div className="flex justify-center gap-4">
<button className="flex justify-center px-4 py-2.5 border border-gray-500 rounded-md hover: bg-gray-800 bg-transparent text-white items-center">
<div className="flex justify-center gap-4 py-2.5">
<a
href="https://github.com/SashenJayathilaka/Github-Readme-File-Generator.git"
className="flex justify-center px-4 py-2.5 border border-gray-500 rounded-md hover: bg-gray-800 bg-transparent text-white items-center cursor-pointer"
>
<AiOutlineStar size={20} className="animate-spin mr-2" />
Star This Repository
</button>
<button className="flex justify-center px-4 py-2.5 border border-gray-500 rounded-md hover: bg-gray-800 bg-transparent text-white items-center">
</a>
<a
href="https://github.com/SashenJayathilaka/Github-Readme-File-Generator.git"
className="flex justify-center px-4 py-2.5 border border-gray-500 rounded-md hover: bg-gray-800 bg-transparent text-white items-center cursor-pointer"
>
<AiOutlineFork size={20} className="animate-bounce mr-2" />
Fork This Repository
</button>
</a>
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit b5684ae

Please sign in to comment.