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

chore(deps): Update to next 13 and react 18 #344

Merged
merged 5 commits into from
Oct 1, 2023
Merged
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
4 changes: 2 additions & 2 deletions components/atoms/Artwork/Artwork.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {

export const Artwork: ArtworkComponent = memo(
function ArtworkComponentMemo({
alt,
className,
height = 512,
isSquare = true,
Expand All @@ -26,7 +27,6 @@ export const Artwork: ArtworkComponent = memo(
src,
subtitle,
width = 512,
...props
}) {
const [failedToLoad, setFailedToLoad] = useState(false);
const squareClassName = useClassNames(square, className);
Expand All @@ -46,12 +46,12 @@ export const Artwork: ArtworkComponent = memo(
const imageOrPlaceholder = shouldShowImage ? (
<Box
as={Image}
alt={alt}
className={artworkClassName}
height={height}
onError={handleError}
src={src}
width={width}
{...props}
/>
) : (
<Typography
Expand Down
22 changes: 0 additions & 22 deletions components/atoms/Link/Link.tsx

This file was deleted.

1 change: 0 additions & 1 deletion components/atoms/Link/index.ts

This file was deleted.

6 changes: 3 additions & 3 deletions components/atoms/LinkStack/LinkStack.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import Link, { LinkProps } from 'next/link';
import type { FunctionComponent } from 'react';

import { Link } from 'components/atoms/Link';
import { Stack } from 'components/layouts/Stack';
import { useClassNames } from 'hooks/useClassNames';
import type { ILinkProps, StackProps } from 'types';
import type { StackProps } from 'types';

import { linkStackClassName } from './linkStack.css';

type LinkStackProps = (StackProps & ILinkProps) | StackProps;
type LinkStackProps = (StackProps & LinkProps) | StackProps;

/**
* Allows all properties of both `Link` and `Stack`. Helpful when showing
Expand Down
3 changes: 2 additions & 1 deletion components/molecules/Footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Link from 'next/link';

import { ExternalLink } from 'components/atoms/ExternalLink';
import { Link } from 'components/atoms/Link';
import { Typography } from 'components/atoms/Typography';
import { Stack } from 'components/layouts/Stack';

Expand Down
7 changes: 4 additions & 3 deletions components/molecules/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Link from 'next/link';
import { useRouter } from 'next/router';
import type { FunctionComponent } from 'react';

import { Icon } from 'components/atoms/Icon';
import { Link } from 'components/atoms/Link';
import { Typography } from 'components/atoms/Typography';
import { Stack } from 'components/layouts/Stack';
import LogoIcon from 'icons/logo.svg';
Expand Down Expand Up @@ -70,11 +70,12 @@ export const Header: FunctionComponent<IHeaderProps> = ({
shouldUseCapsize={false}
>
<Link
anchorProps={{ 'aria-label': 'Pod Monster' }}
passHref={true}
aria-label="Pod Monster"
href="/"
className={homeLinkClassName}
>
<Icon size="large">
<Icon size="large" aria-hidden="true">
<LogoIcon className={homeIconClassName} />
</Icon>
{isAppNameHidden ? null : 'Pod Monster'}
Expand Down
2 changes: 1 addition & 1 deletion components/molecules/SubscriptionItem/SubscriptionItem.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Link from 'next/link';
import type { ApiResponse } from 'podcastdx-client/src/types';
import { useQuery } from 'react-query';

import { Artwork } from 'components/atoms/Artwork';
import { Dot } from 'components/atoms/Dot';
import { Link } from 'components/atoms/Link';
import { Typography } from 'components/atoms/Typography';
import { Stack } from 'components/layouts/Stack';
import { useSettingsContext } from 'contexts/SettingsContext';
Expand Down
14 changes: 5 additions & 9 deletions components/organisms/MediaPlayer/MediaPlayer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { AnimatePresence, m } from 'framer-motion';
import Link from 'next/link';
import { useRouter } from 'next/router';
import {
FunctionComponent,
Expand All @@ -11,7 +12,6 @@ import {
import { Artwork } from 'components/atoms/Artwork';
import { Icon } from 'components/atoms/Icon';
import { IconButton } from 'components/atoms/IconButton';
import { Link } from 'components/atoms/Link';
import { PlayPauseIcon } from 'components/atoms/PlayPauseIcon';
import { Range } from 'components/atoms/Range';
import { Typography } from 'components/atoms/Typography';
Expand Down Expand Up @@ -292,10 +292,8 @@ export const MediaPlayer: FunctionComponent = () => {
<Link
className={underlinedLink}
href={getEpisodePath({ episodeId, feedId })}
anchorProps={{
onClick: () => {
setSize(1);
},
onClick={() => {
setSize(1);
}}
>
{episodeTitle}
Expand All @@ -314,10 +312,8 @@ export const MediaPlayer: FunctionComponent = () => {
>
{currentChapter?.url ? (
<Link
anchorProps={{
rel: 'noreferrer noopener',
target: '_blank',
}}
rel="noreferrer noopener"
target="_blank"
className={underlinedLink}
href={currentChapter?.url}
>
Expand Down
8 changes: 4 additions & 4 deletions contexts/MediaContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,17 +205,17 @@ export const MediaProvider: FunctionComponent<PropsWithChildren<unknown>> = ({
}, []);

const seekBackward = useCallback(
({ seekOffset }) => {
const resultTime = mediaPlayerCurrentTime - seekOffset;
({ seekOffset }: Partial<MediaSessionActionDetails>) => {
const resultTime = mediaPlayerCurrentTime - (seekOffset ?? 0);

setCurrentTime(resultTime);
},
[mediaPlayerCurrentTime]
);

const seekForward = useCallback(
({ seekOffset }) => {
const resultTime = mediaPlayerCurrentTime + seekOffset;
({ seekOffset }: Partial<MediaSessionActionDetails>) => {
const resultTime = mediaPlayerCurrentTime + (seekOffset ?? 0);

setCurrentTime(resultTime);
},
Expand Down
3 changes: 0 additions & 3 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ const nextConfig = {
},
productionBrowserSourceMaps: true,
reactStrictMode: true,
svgrOptions: {
icon: true,
},
};

module.exports = withSentryConfig(
Expand Down
Loading
Loading