Skip to content

Commit

Permalink
fix: remove nanoid from deps. Changed keys in Li to names
Browse files Browse the repository at this point in the history
  • Loading branch information
Tedzury committed Dec 27, 2023
1 parent f8eb6f5 commit 01b623d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 28 deletions.
18 changes: 0 additions & 18 deletions package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"@lit/react": "^1.0.2",
"@material/web": "^1.0.1",
"firebase": "^10.7.1",
"nanoid": "^5.0.4",
"overlayscrollbars": "^2.4.5",
"overlayscrollbars-react": "^0.5.3",
"react": "^18.2.0",
Expand Down
16 changes: 7 additions & 9 deletions src/components/DocsComp/ui/DocsTypeComp.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { nanoid } from 'nanoid';

import useScrollbar from '@/shared/lib/hooks/useScrollbar';
import { DocsExplorerType, SchemaTypeObj } from '@/shared/types';

Expand All @@ -21,9 +19,9 @@ const DocsTypeComp = ({ explorer, currType }: { explorer: DocsExplorerType; curr
const beforeSeparator = <br />;
const afterSeparator = i >= field.args.length - 1 ? <br /> : null;
return (
<p key={nanoid()} className="inline">
<p key={argTypeName.concat(i.toString())} className="inline">
{separation && beforeSeparator}
<span className={separation ? 'pl-3' : ''} key={nanoid()}>
<span className={separation ? 'pl-3' : ''}>
<span className="text-tertiary">{arg.name}</span>:&nbsp;
{before}
<a className="text-docs-link-text-color hover:underline" href={link} onClick={(e) => clinkHandler(e, link)}>
Expand All @@ -38,7 +36,7 @@ const DocsTypeComp = ({ explorer, currType }: { explorer: DocsExplorerType; curr
const returnType = getTypeName(field.type);
const [prevType, typeLink, afterType] = separateString(returnType);
return (
<li key={nanoid()}>
<li key={field.name}>
<span className="text-docs-field-text-color">{field.name}</span>
{args.length > 0 && '('}
{args}
Expand All @@ -58,7 +56,7 @@ const DocsTypeComp = ({ explorer, currType }: { explorer: DocsExplorerType; curr
});
const inputFields = currType?.inputFields?.map((field) => {
return (
<li key={nanoid()}>
<li key={field?.type?.name}>
{field.name}:&nbsp;
<a
className="text-docs-link-text-color hover:underline"
Expand All @@ -72,11 +70,11 @@ const DocsTypeComp = ({ explorer, currType }: { explorer: DocsExplorerType; curr
});
const isFields = fields || inputFields;
const enumValues = currType?.enumValues?.map((value) => {
return <li key={nanoid()}>{value.name}</li>;
return <li key={value.name}>{value.name}</li>;
});
const possibleTypes = currType?.possibleTypes?.map((type) => {
return (
<li key={nanoid()}>
<li key={type.name}>
<a
className="text-docs-link-text-color hover:underline"
href={type.name}
Expand All @@ -89,7 +87,7 @@ const DocsTypeComp = ({ explorer, currType }: { explorer: DocsExplorerType; curr
});
const interfaces = currType?.interfaces?.map((inter) => {
return (
<li key={nanoid()}>
<li key={inter.name}>
<a
className="text-docs-link-text-color hover:underline"
href={inter.name}
Expand Down

0 comments on commit 01b623d

Please sign in to comment.