Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: removed unused variables, exported name as a property of default import #381

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion apps/frontend/src/components/analytics/chart-social.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import { FC, useEffect, useMemo, useRef } from 'react';
import DrawChart from 'chart.js/auto';
import { TotalList } from '@gitroom/frontend/components/analytics/stars.and.forks.interface';
import dayjs from 'dayjs';
import { chunk } from 'lodash';

function mergeDataPoints(data: TotalList[], numPoints: number): TotalList[] {
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/src/components/analytics/chart.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use client';
import { FC, useEffect, useMemo, useRef } from 'react';
import { FC, useEffect, useRef } from 'react';
import DrawChart from 'chart.js/auto';
import {
ForksList,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import { Slider } from '@gitroom/react/form/slider';
import React, { FC, useCallback, useEffect, useMemo, useState } from 'react';
import { Button } from '@gitroom/react/form/button';
import { sortBy } from 'lodash';
import { Track } from '@gitroom/react/form/track';
import { useFetch } from '@gitroom/helpers/utils/custom.fetch';
import { Subscription } from '@prisma/client';
import { useDebouncedCallback } from 'use-debounce';
Expand All @@ -21,7 +19,6 @@ import interClass from '@gitroom/react/helpers/inter.font';
import { useRouter } from 'next/navigation';
import { useVariables } from '@gitroom/react/helpers/variable.context';
import { useModals } from '@mantine/modals';
import { AddProviderComponent } from '@gitroom/frontend/components/launches/add.provider.component';
import { TopTitle } from '@gitroom/frontend/components/launches/helpers/top.title.component';
import { Textarea } from '@gitroom/react/form/textarea';

Expand Down
5 changes: 1 addition & 4 deletions apps/frontend/src/components/launches/bot.picture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ import { Input } from '@gitroom/react/form/input';
import { Button } from '@gitroom/react/form/button';
import { useFetch } from '@gitroom/helpers/utils/custom.fetch';
import { useToaster } from '@gitroom/react/toaster/toaster';
import {
MediaComponent,
showMediaBox,
} from '@gitroom/frontend/components/media/media.component';
import { showMediaBox } from '@gitroom/frontend/components/media/media.component';

export const BotPicture: FC<{
integration: Integrations;
Expand Down
5 changes: 3 additions & 2 deletions apps/frontend/src/components/launches/calendar.context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ import { useSearchParams } from 'next/navigation';
import isoWeek from 'dayjs/plugin/isoWeek';
import weekOfYear from 'dayjs/plugin/weekOfYear';

dayjs.extend(isoWeek);
dayjs.extend(weekOfYear);
import { extend } from 'dayjs';
extend(isoWeek);
extend(weekOfYear);

export const CalendarContext = createContext({
currentDay: dayjs().day() as 0 | 1 | 2 | 3 | 4 | 5 | 6,
Expand Down
10 changes: 7 additions & 3 deletions apps/frontend/src/components/launches/calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ import isSameOrAfter from 'dayjs/plugin/isSameOrAfter';
import isSameOrBefore from 'dayjs/plugin/isSameOrBefore';
import { groupBy, sortBy } from 'lodash';
import Image from 'next/image';
dayjs.extend(isSameOrAfter);
dayjs.extend(isSameOrBefore);
import { extend } from 'dayjs';
extend(isSameOrAfter);
extend(isSameOrBefore);

export const days = [
'Monday',
Expand Down Expand Up @@ -499,7 +500,10 @@ export const CalendarColumn: FC<{
className={`w-full h-full rounded-[10px] hover:border hover:border-seventh flex justify-center items-center gap-[20px] opacity-30 grayscale hover:grayscale-0 hover:opacity-100`}
>
{integrations.map((selectedIntegrations) => (
<div className="relative" key={selectedIntegrations.identifier}>
<div
className="relative"
key={selectedIntegrations.identifier}
>
<div
className={clsx(
'relative w-[34px] h-[34px] rounded-full flex justify-center items-center bg-fifth filter transition-all duration-500'
Expand Down
3 changes: 1 addition & 2 deletions apps/frontend/src/components/launches/editor.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { forwardRef, useCallback, useRef } from 'react';
import { forwardRef } from 'react';
import type { MDEditorProps } from '@uiw/react-md-editor/src/Types';
import { RefMDEditor } from '@uiw/react-md-editor/src/Editor';
import MDEditor from '@uiw/react-md-editor';
import { useCopilotAction, useCopilotReadable } from '@copilotkit/react-core';
import dayjs from 'dayjs';
import { CopilotTextarea } from '@copilotkit/react-textarea';
import clsx from 'clsx';
import { useUser } from '@gitroom/frontend/components/layout/user.context';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {
ChangeEventHandler,
FC,
useCallback,
useMemo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import {
import { useFetch } from '@gitroom/helpers/utils/custom.fetch';
import { Input } from '@gitroom/react/form/input';
import { Button } from '@gitroom/react/form/button';
import { useCustomProviderFunction } from '@gitroom/frontend/components/launches/helpers/use.custom.provider.function';
import dayjs from 'dayjs';

const postUrlEmitter = new EventEmitter();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { AddProviderButton } from '@gitroom/frontend/components/launches/add.pro
import { useCallback, useEffect, useMemo, useState } from 'react';
import Image from 'next/image';
import { orderBy } from 'lodash';
// import { Calendar } from '@gitroom/frontend/components/launches/calendar';
import { CalendarWeekProvider } from '@gitroom/frontend/components/launches/calendar.context';
import { Filters } from '@gitroom/frontend/components/launches/filters';
import { useFetch } from '@gitroom/helpers/utils/custom.fetch';
Expand Down
1 change: 0 additions & 1 deletion apps/frontend/src/components/layout/layout.context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { ReactNode, useCallback } from 'react';
import { FetchWrapperComponent } from '@gitroom/helpers/utils/custom.fetch';
import { deleteDialog } from '@gitroom/react/helpers/delete.dialog';
import { isGeneral } from '@gitroom/react/helpers/is.general';
import { useReturnUrl } from '@gitroom/frontend/app/auth/return.url.component';
import { useVariables } from '@gitroom/react/helpers/variable.context';

Expand Down
20 changes: 10 additions & 10 deletions apps/frontend/src/components/layout/layout.settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import NotificationComponent from '@gitroom/frontend/components/notifications/no
import Link from 'next/link';
import useSWR from 'swr';
import { useFetch } from '@gitroom/helpers/utils/custom.fetch';
import dayjs from 'dayjs';
import utc from 'dayjs/plugin/utc';
import weekOfYear from 'dayjs/plugin/weekOfYear';
import isoWeek from 'dayjs/plugin/isoWeek';
Expand All @@ -37,10 +36,12 @@ const ModeComponent = dynamic(
{ ssr: false }
);

dayjs.extend(utc);
dayjs.extend(weekOfYear);
dayjs.extend(isoWeek);
dayjs.extend(isBetween);
import { extend } from 'dayjs';

extend(utc);
extend(weekOfYear);
extend(isoWeek);
extend(isBetween);

export const LayoutSettings = ({ children }: { children: ReactNode }) => {
const fetch = useFetch();
Expand Down Expand Up @@ -93,9 +94,7 @@ export const LayoutSettings = ({ children }: { children: ReactNode }) => {
/>
</div>
<div
className={clsx(
!isGeneral ? 'mt-[12px]' : 'min-w-[80px]'
)}
className={clsx(!isGeneral ? 'mt-[12px]' : 'min-w-[80px]')}
>
{isGeneral ? (
<svg
Expand Down Expand Up @@ -127,7 +126,8 @@ export const LayoutSettings = ({ children }: { children: ReactNode }) => {
)}
</div>
</Link>
{user?.orgId && (user.tier !== 'FREE' || !isGeneral || !billingEnabled) ? (
{user?.orgId &&
(user.tier !== 'FREE' || !isGeneral || !billingEnabled) ? (
<TopMenu />
) : (
<div />
Expand All @@ -141,7 +141,7 @@ export const LayoutSettings = ({ children }: { children: ReactNode }) => {
</div>
<div className="flex-1 flex">
<div className="flex-1 rounded-3xl px-[23px] py-[17px] flex flex-col">
{(user.tier === 'FREE' && isGeneral) && billingEnabled ? (
{user.tier === 'FREE' && isGeneral && billingEnabled ? (
<>
<div className="text-center mb-[20px] text-xl">
<h1 className="text-3xl">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'reflect-metadata';
import { FC, useCallback } from 'react';
import { FC } from 'react';
import { Post as PrismaPost } from '.prisma/client';
import { Providers } from '@gitroom/frontend/components/launches/providers/show.all.providers';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import React, {
useCallback,
useEffect,
useMemo,
useRef,
useState,
} from 'react';
import { useFetch } from '@gitroom/helpers/utils/custom.fetch';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC, useCallback, useEffect, useMemo, useState } from 'react';
import { FC, useCallback, useMemo, useState } from 'react';
import { Integration } from '@prisma/client';
import useSWR from 'swr';
import { useFetch } from '@gitroom/helpers/utils/custom.fetch';
Expand Down