feat: made emoji-icon-picker

fix: google prompt coming up after leaving sign in, refractor: saving views data to db instead of local-storage
This commit is contained in:
Dakshesh Jain 2022-12-19 20:13:43 +05:30
parent f52724fd86
commit 13985df860
20 changed files with 1388 additions and 46 deletions

View file

@ -2,7 +2,7 @@ import React, { useState, useEffect } from "react";
// swr
import useSWR, { mutate } from "swr";
// react hook form
import { useForm } from "react-hook-form";
import { useForm, Controller } from "react-hook-form";
// headless
import { Dialog, Transition } from "@headlessui/react";
// services
@ -18,7 +18,7 @@ import { PROJECTS_LIST, WORKSPACE_MEMBERS } from "constants/fetch-keys";
import useUser from "lib/hooks/useUser";
import useToast from "lib/hooks/useToast";
// ui
import { Button, Input, TextArea, Select } from "ui";
import { Button, Input, TextArea, Select, EmojiIconPicker } from "ui";
// types
import { IProject } from "types";
@ -32,6 +32,7 @@ const defaultValues: Partial<IProject> = {
identifier: "",
description: "",
network: 0,
icon: "",
};
const IsGuestCondition: React.FC<{
@ -83,6 +84,7 @@ const CreateProjectModal: React.FC<Props> = ({ isOpen, setIsOpen }) => {
reset,
setError,
clearErrors,
control,
watch,
setValue,
} = useForm<IProject>({
@ -201,6 +203,22 @@ const CreateProjectModal: React.FC<Props> = ({ isOpen, setIsOpen }) => {
</p>
</div>
<div className="space-y-3">
<div>
<label htmlFor="icon" className="text-gray-500 mb-2">
Icon
</label>
<Controller
control={control}
name="icon"
render={({ field: { value, onChange } }) => (
<EmojiIconPicker
label={value ? String.fromCodePoint(parseInt(value)) : "Select Icon"}
value={value}
onChange={onChange}
/>
)}
/>
</div>
<div>
<Input
id="name"