Skip to content

Commit

Permalink
Fix/console errors (#93)
Browse files Browse the repository at this point in the history
Co-authored-by: Ryczko <konradryczko1@gmail.com>
  • Loading branch information
pmatyjasik and Ryczko authored Mar 20, 2023
1 parent 7ab05e7 commit 1a04ef0
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 102 deletions.
27 changes: 0 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"react-dom": "^17.0.2",
"react-firebase-hooks": "^5.0.3",
"react-hot-toast": "^2.2.0",
"react-json-to-csv": "^1.0.4",
"recharts": "^2.4.3",
"sass": "^1.52.1",
"typescript": "^4.6.4",
Expand Down Expand Up @@ -60,10 +59,10 @@
"eslint-plugin-react-hooks": "^4.5.0",
"eslint-plugin-tailwindcss": "^3.5.0",
"eslint-plugin-testing-library": "^5.5.0",
"husky": "^8.0.0",
"jest": "^28.1.0",
"jest-environment-jsdom": "^28.1.0",
"postcss": "^8.4.14",
"tailwindcss": "^3.0.24",
"husky": "^8.0.0"
"tailwindcss": "^3.0.24"
}
}
2 changes: 1 addition & 1 deletion src/layout/Logo/Logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ interface LogoProps {
function Logo({ classNames = '' }: LogoProps) {
return (
<Link href={'/'} passHref>
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
<a
href={'/'}
className={clsx(
'block ml-14 font-serif text-2xl text-zinc-600 translate-y-[-2px] md:ml-11',
classNames
Expand Down
5 changes: 4 additions & 1 deletion src/layout/PageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ import Background from './Background/Background';
import GlobalLoader from './GlobalLoader/GlobalLoader';
import Navigation from 'src/layout/Navigation/Navigation';
import { useApplicationContext } from 'src/features/application/context';
import { useRouter } from 'next/router';
import { Fragment } from 'react';

interface PageLayoutProps {
children: React.ReactNode;
}

function PageLayout({ children }: PageLayoutProps) {
const { loading } = useApplicationContext();
const router = useRouter();

return (
<>
Expand All @@ -19,7 +22,7 @@ function PageLayout({ children }: PageLayoutProps) {
<div className="overflow-hidden px-6 pt-32 m-auto min-h-screen sm:px-4">
<Background />
<AnimatePresence exitBeforeEnter initial={false}>
{children}
<Fragment key={router.asPath}>{children}</Fragment>
</AnimatePresence>
</div>
</>
Expand Down
18 changes: 1 addition & 17 deletions src/pages/survey/answer/[surveyId]/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { DownloadIcon, LinkIcon, RefreshIcon } from '@heroicons/react/outline';

import CsvDownload from 'react-json-to-csv';
import { LinkIcon, RefreshIcon } from '@heroicons/react/outline';

import withAnimation from '../../../../shared/HOC/withAnimation';
import withProtectedRoute from '../../../../shared/HOC/withProtectedRoute';
Expand Down Expand Up @@ -48,20 +46,6 @@ function SurveyResultsPage() {
>
Copy link
</IconButton>
<CsvDownload
className="block"
data={answersData}
filename={`${title}.csv`}
>
<IconButton
title="Download as CSV file"
className="justify-center w-full sm:w-[170px]"
variant={IconButtonVariant.OUTLINE}
icon={<DownloadIcon className="w-5 h-5" />}
>
Download
</IconButton>
</CsvDownload>

<IconButton
title="Refresh data"
Expand Down
49 changes: 25 additions & 24 deletions src/shared/components/ButtonLink/ButtonLink.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
import React, { forwardRef } from 'react';
import clsx from 'clsx';
import { forwardRef, LegacyRef } from 'react';
import { ButtonProps, ButtonSize, ButtonVariant } from '../Button/Button';

export const ButtonLinkVariant = ButtonVariant;
export const ButtonLinkSize = ButtonSize;

const ButtonLink = forwardRef(function ButtonLink({
children,
className,
variant = ButtonLinkVariant.SECONDARY,
sizeType = ButtonLinkSize.DEFAULT,
...props
}: ButtonProps & React.HTMLProps<HTMLAnchorElement>) {
return (
<a
{...props}
className={clsx(
'btn',
variant,
sizeType,
'hover:no-underline',
className
)}
>
{children}
</a>
);
});
interface ButtonLinkProps extends ButtonProps {
children: React.ReactNode;
onClick?: () => void;
}

export default ButtonLink;
const ButtonLink = (
{
children,
className,
variant = ButtonLinkVariant.SECONDARY,
sizeType = ButtonLinkSize.DEFAULT,
...props
}: ButtonLinkProps,
ref: LegacyRef<HTMLAnchorElement>
) => (
<a
{...props}
ref={ref}
className={clsx('btn', variant, sizeType, 'hover:no-underline', className)}
>
{children}
</a>
);

export default forwardRef(ButtonLink);
29 changes: 0 additions & 29 deletions src/shared/utilities/convertTime.test.ts

This file was deleted.

0 comments on commit 1a04ef0

Please sign in to comment.