Skip to content

Commit

Permalink
feat: fix some linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dahal committed May 20, 2024
1 parent 45becff commit c0c963c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
7 changes: 4 additions & 3 deletions prisma/seeds/companies.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { generatePublicId } from "@/common/id";
import { faker } from "@faker-js/faker";
import { db } from "@/server/db";
import { sample } from "lodash-es";
import { faker } from "@faker-js/faker";
import colors from "colors";
import { sample } from "lodash-es";
colors.enable();

type CompanyType = {
Expand All @@ -17,8 +17,8 @@ type CompanyType = {
city: string;
state: string;
zipcode: string;
country: string;
};

const seedCompanies = async (count = 4) => {
const companies: CompanyType[] = [];

Expand All @@ -35,6 +35,7 @@ const seedCompanies = async (count = 4) => {
city: faker.location.city(),
state: faker.location.state({ abbreviated: true }),
zipcode: faker.location.zipCode(),
country: faker.location.countryCode(),
});
}

Expand Down
21 changes: 11 additions & 10 deletions src/components/update/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ import { DropdownButton } from "@/components/ui/dropdown-button";
import { useToast } from "@/components/ui/use-toast";
import type { ShareContactType, ShareRecipientType } from "@/schema/contacts";
import { api } from "@/trpc/react";
import { type Block } from "@blocknote/core";
import type { Block } from "@blocknote/core";
import type { Update } from "@prisma/client";
import { RiArrowDownSLine } from "@remixicon/react";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { Fragment, useState } from "react";

import { env } from "@/env";
import "@/styles/editor.css";
import { BlockNoteView, useCreateBlockNote } from "@blocknote/react";
import "@blocknote/react/style.css";
import { env } from "next-runtime-env";

type UpdatesEditorProps = {
update?: Update;
Expand All @@ -41,7 +41,7 @@ const UpdatesEditor = ({
}: UpdatesEditorProps) => {
const router = useRouter();
const { toast } = useToast();
const baseUrl = env.NEXT_PUBLIC_BASE_URL;
const baseUrl = env("NEXT_PUBLIC_BASE_URL");

const date = new Date();
const formattedDate = dayjsExt(date).format("MMM YYYY");
Expand Down Expand Up @@ -181,7 +181,7 @@ const UpdatesEditor = ({
});

const draftMutation = api.update.save.useMutation({
onSuccess: async ({ publicId, success, message }) => {
onSuccess: ({ publicId, success, message }) => {
toast({
variant: success ? "default" : "destructive",
title: success
Expand Down Expand Up @@ -213,7 +213,7 @@ const UpdatesEditor = ({
});

const cloneMutation = api.update.clone.useMutation({
onSuccess: async ({ publicId, success, message }) => {
onSuccess: ({ publicId, success, message }) => {
toast({
variant: success ? "default" : "destructive",
title: success
Expand All @@ -240,7 +240,7 @@ const UpdatesEditor = ({
},
});

const saveAsDraft = async () => {
const saveAsDraft = () => {
setLoading(true);

const data = {
Expand All @@ -253,14 +253,15 @@ const UpdatesEditor = ({
draftMutation.mutate(data);
};

const cloneUpdate = async () => {
const cloneUpdate = () => {
setLoading(true);

const data = {
title,
html,
content,
};

cloneMutation.mutate(data);
};

Expand Down Expand Up @@ -367,11 +368,11 @@ const UpdatesEditor = ({
</Button>
</li> */}

{update && mode === "edit" && (
{update && mode === "edit" && recipients && contacts && (
<li>
<ShareModal
recipients={recipients!}
contacts={contacts!}
recipients={recipients}
contacts={contacts}
baseLink={`${baseUrl}/updates/${update?.publicId}`}
title={`Share - "${title}"`}
subtitle="Share this update with team members, stakeholders and others."
Expand Down

0 comments on commit c0c963c

Please sign in to comment.