diff --git a/web/src/components/user-articles-toggle/index.stories.js b/web/src/components/user-articles-toggle/index.stories.js
index 1a742dd0..4561351d 100644
--- a/web/src/components/user-articles-toggle/index.stories.js
+++ b/web/src/components/user-articles-toggle/index.stories.js
@@ -13,16 +13,20 @@ export const AsGuest = {};
export const MyArticlesActive = {
parameters: {
- nextRouter: {
- pathname: '/user/[username]',
+ nextjs: {
+ router: {
+ asPath: '/user/lifeiscontent',
+ },
},
},
};
export const FavoritedArticlesActive = {
parameters: {
- nextRouter: {
- pathname: '/user/[username]/favorites',
+ nextjs: {
+ router: {
+ asPath: '/user/lifeiscontent/favorites',
+ },
},
},
};
diff --git a/web/src/components/user-avatar-link/index.js b/web/src/components/user-avatar-link/index.js
index 9902457d..6a088eae 100644
--- a/web/src/components/user-avatar-link/index.js
+++ b/web/src/components/user-avatar-link/index.js
@@ -1,4 +1,3 @@
-import React from 'react';
import PropTypes from 'prop-types';
import Link from 'next/link';
import { UserAvatar } from '../user-avatar';
@@ -6,10 +5,8 @@ import { gql } from '@apollo/client';
export function UserAvatarLink({ profile, username, size }) {
return (
-
-
-
-
+
+
);
}
diff --git a/web/src/components/user-avatar/index.js b/web/src/components/user-avatar/index.js
index 93413101..b38ac825 100644
--- a/web/src/components/user-avatar/index.js
+++ b/web/src/components/user-avatar/index.js
@@ -1,19 +1,17 @@
-import React from 'react';
import PropTypes from 'prop-types';
import { gql } from '@apollo/client';
import Image from 'next/image';
export function UserAvatar({ profile, username, size }) {
return (
-
-
-
+
);
}
@@ -28,10 +26,6 @@ UserAvatar.fragments = {
`,
};
-UserAvatar.defaultProps = {
- profile: {},
-};
-
UserAvatar.propTypes = {
profile: PropTypes.shape({ imageUrl: PropTypes.string }),
username: PropTypes.string.isRequired,
diff --git a/web/src/components/user-comment-form/index.js b/web/src/components/user-comment-form/index.js
index 408905c0..64811639 100644
--- a/web/src/components/user-comment-form/index.js
+++ b/web/src/components/user-comment-form/index.js
@@ -1,4 +1,3 @@
-import React from 'react';
import PropTypes from 'prop-types';
import { Formik, Form, Field, ErrorMessage } from 'formik';
import { FormikSubmitButton } from '../formik-submit-button';
@@ -18,7 +17,7 @@ export function UserCommentForm({
profile,
canCreateComment,
}) {
- if (canCreateComment.value === false) return null;
+ if (!canCreateComment?.value) return null;
return (