Skip to content

Commit

Permalink
fix: remove redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
chuanyu0201 committed Jan 17, 2023
1 parent f67544e commit 1618cb1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ yarn-error.log*
*.tsbuildinfo
next-env.d.ts
.env

# idea
.idea
8 changes: 4 additions & 4 deletions components/DropDown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ function classNames(...classes: string[]) {
return classes.filter(Boolean).join(" ");
}

type vibeType = "Professional" | "Casual" | "Funny";
export type VibeType = "Professional" | "Casual" | "Funny";

interface DropDownProps {
vibe: "Professional" | "Casual" | "Funny";
setVibe: (vibe: vibeType) => void;
vibe: VibeType
setVibe: (vibe: VibeType) => void;
}

let vibes: vibeType[] = ["Professional", "Casual", "Funny"];
let vibes: VibeType[] = ["Professional", "Casual", "Funny"];

export default function DropDown({ vibe, setVibe }: DropDownProps) {
return (
Expand Down
4 changes: 2 additions & 2 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Head from "next/head";
import Image from "next/image";
import { useState } from "react";
import { Toaster, toast } from "react-hot-toast";
import DropDown from "../components/DropDown";
import DropDown, { VibeType } from "../components/DropDown";
import Footer from "../components/Footer";
import Github from "../components/GitHub";
import Header from "../components/Header";
Expand All @@ -14,7 +14,7 @@ import ResizablePanel from "../components/ResizablePanel";
const Home: NextPage = () => {
const [loading, setLoading] = useState(false);
const [bio, setBio] = useState("");
const [vibe, setVibe] = useState<"Professional" | "Casual" | "Funny">(
const [vibe, setVibe] = useState<VibeType>(
"Professional"
);
const [generatedBios, setGeneratedBios] = useState<String>("");
Expand Down

0 comments on commit 1618cb1

Please sign in to comment.