Skip to content

Commit

Permalink
remove/yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
ArunGovil committed Dec 15, 2022
1 parent 0e15ce9 commit b89ebec
Show file tree
Hide file tree
Showing 16 changed files with 77 additions and 278 deletions.
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ one stop directory for frequently used commands.

## What is cmdr?

cmdr is a directory of frequently used commands in software development, categorized across different technologies.
cmdr is a directory of frequently used commands in daily software development, categorized across different technologies.

## Running locally

Expand All @@ -25,9 +25,4 @@ cmdr will start running immediately.

## Contributing

All the commands are stored inside the project in a YAML file which acts as the current database. A new command can be easily to the system added by altering the YAML file and sending a pull request.





Commands are stored inside the content folder in a JSON file which acts as the current database. You can add new commands to the end of `content/content.json` file and submit a PR.
7 changes: 3 additions & 4 deletions components/Listing.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React, { useState, useEffect } from "react";
import { technology, codes } from "../json";
import CodeCard from "./CodeCard";
import content from "../content/content.yaml";
import tabs from "../content/tabs.yaml";
import content from "../content/content.json";
import { tabs } from "../utils";

export default function Listing() {
const [currentTab, setCurrentTab] = useState({ id: 1, title: "reactJs" });
const [currentTab, setCurrentTab] = useState({ id: 1, title: "reactjs" });
const [code, setCode] = useState<any>([]);
const [isLoading, setLoading] = useState(true);

Expand Down
6 changes: 3 additions & 3 deletions components/PrimarySearch.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Link from "next/link";
import React, { useEffect, useState } from "react";
import { placeholders } from "../json";
import content from "../content/content.yaml";
import { placeholders } from "../utils";
import content from "../content/content.json";

export default function PrimarySearch() {
const [data, setData] = useState(content);
Expand Down Expand Up @@ -42,7 +42,7 @@ export default function PrimarySearch() {
{data.length > 0 ? (
<ul>
{data.map((item) => (
<Link key={item.id} href="/details">
<Link key={item.code} href="/details">
<li className="mt-2 text-sm font-light text-slate-400 cursor-pointer hover:text-white hover:bg-gradient-to-br from-[#FF4D4D] to-orange-500 pt-1 pb-1 pl-1 rounded-md">
{item.title}
</li>
Expand Down
2 changes: 1 addition & 1 deletion components/SecondarySearch.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Link from "next/link";
import React, { useEffect, useState } from "react";
import { placeholders } from "../json";
import { placeholders } from "../utils";

interface SecondarySearchProps {
onChange: any;
Expand Down
20 changes: 20 additions & 0 deletions content/content.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[
{
"title": "Create React App using npm",
"code": "npm init react-app app-name",
"technology": "reactjs",
"tags": ["reactjs", "npm"]
},
{
"title": "Create React Native App using npm",
"code": "npx react-native init appName",
"technology": "reactnative",
"tags": ["reactnative", "npm"]
},
{
"title": "Git add remote url",
"code": "git remote add origin repo-url",
"technology": "git",
"tags": ["git", "remote"]
}
]
86 changes: 0 additions & 86 deletions content/content.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions content/palceholders.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions content/tabs.yaml

This file was deleted.

84 changes: 0 additions & 84 deletions json/index.ts

This file was deleted.

9 changes: 0 additions & 9 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
/** @type {import('next').NextConfig} */

const nextConfig = {
webpack: function (config) {
config.module.rules.push({
test: /\.ya?ml$/,
type: "json",

use: "js-yaml-loader",
});
return config;
},
reactStrictMode: true,
swcMinify: true,
};
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"@types/react-dom": "18.0.9",
"eslint": "8.28.0",
"eslint-config-next": "13.0.5",
"js-yaml-loader": "^1.2.2",
"next": "13.0.5",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand Down
4 changes: 2 additions & 2 deletions pages/details.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Head from "next/head";
import { useState } from "react";
import { Header, Footer, SearchListing, SecondarySearch } from "../components";
import content from "../content/content.yaml";
import content from "../content/content.json";

export default function Details() {
const [data, setData] = useState(content);
Expand All @@ -19,7 +19,7 @@ export default function Details() {
<link rel="icon" href="/img/frame.png" />
</Head>
<main className="flex flex-col items-center">
<Header showSearch={false} />
<Header />
<SecondarySearch onChange={filterData} />
<SearchListing searchData={data} />
<Footer />
Expand Down
2 changes: 1 addition & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function Home() {
<link rel="icon" href="/img/frame.png" />
</Head>
<main className="flex flex-col items-center">
<Header showSearch={false} />
<Header />
<Hero />
<Listing />
<About />
Expand Down
Binary file removed public/img/frame.png
Binary file not shown.
45 changes: 45 additions & 0 deletions utils/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
export const tabs = [
{
id: 1,
title: "reactjs",
},
{
id: 2,
title: "git",
},
{
id: 3,
title: "nextjs",
},
{
id: 4,
title: "django",
},
{
id: 5,
title: "reactnative",
},
];

export const placeholders = [
{
id: 1,
placeholder: "create react app",
},
{
id: 2,
placeholder: "git add remote",
},
{
id: 3,
placeholder: "create django project",
},
{
id: 4,
placeholder: "git view remote",
},
{
id: 5,
placeholder: "create express app",
},
];
Loading

1 comment on commit b89ebec

@vercel
Copy link

@vercel vercel bot commented on b89ebec Dec 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

cmdr – ./

cmdr-git-main-arungovil.vercel.app
cmdr.vercel.app
cmdr-arungovil.vercel.app

Please sign in to comment.