Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Lullabyq committed Jan 22, 2025
1 parent a3f3b84 commit fe13dad
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"prev": ["const", "let", "var"],
"next": ["const", "let", "var"]
}
]
],
"jsx-a11y/click-events-have-key-events": "off"
}
}
2 changes: 1 addition & 1 deletion docs/updates/list/index.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
slug: '/updates/list'
title: 'Новое в платорме'
title: 'Новое в платформе'
description: 'Всё про email-рассылки: как создавать выпуски, персонализировать контент и что нужно настраивать дополнительно'
sidebar_position: 1
hide_title: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ import { truncateString } from './utils/truncateString';

const NBSP = '\u00A0';

const RecentlyUpdatedArticlesCard = ({ children, slug }) => {
const RecentlyUpdatedArticlesCard = ({ children, slug, index }) => {
const handleClick = () => {
// eslint-disable-next-line no-undef
document.dispatchEvent(new CustomEvent('redirect', { detail: { slug } }));
};

return (
<div
className="card group p-4 rounded-xl border-solid border border-gray-300 gap-3 flex flex-col hover:cursor-pointer"
onClick={handleClick}
tabIndex={index}
role="link"
>
{children}
</div>
Expand Down Expand Up @@ -45,8 +48,8 @@ const RecentlyUpdatedArticlesChanges = ({ frontMatter }) => {
const RecentlyUpdatedArticles = ({ recentArticles }) => (
<Layout>
<div className="flex flex-col gap-4" id={RECENT_ARTICLES_CONTENT_ID}>
{recentArticles.map(({ title, lastUpdatedAt, frontMatter, slug, description }) => (
<RecentlyUpdatedArticlesCard key={slug} slug={slug}>
{recentArticles.map(({ title, lastUpdatedAt, frontMatter, slug, description }, index) => (
<RecentlyUpdatedArticlesCard key={slug} slug={slug} index={index}>
<div className="flex flex-col gap-2">
<h5 className="text-gray-800 text-base font-medium m-0 group-hover:text-blue-600">
{title}
Expand All @@ -65,7 +68,7 @@ const RecentlyUpdatedArticles = ({ recentArticles }) => (
<RecentlyUpdatedArticlesChanges frontMatter={frontMatter} />

{description && frontMatter.recent_article?.new && (
<span className="text-gray-800 text-sm">{truncateString(description, 180)}</span>
<span className="text-gray-800 text-xs">{truncateString(description, 200)}</span>
)}
</RecentlyUpdatedArticlesCard>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const RecentlyUpdatedArticlesIframe = () => {
ref={iframeRef}
src={RECENT_ARTICLES_TEMP_URL}
name="latest-articles"
title="latest-articles"
className="w-full"
style={{
border: 'none',
Expand All @@ -49,7 +50,7 @@ export const RecentlyUpdatedArticlesIframe = () => {
}}
onLoad={resizeIframe}
scrolling="no"
seamless={true}
seamless
/>
);
};
16 changes: 6 additions & 10 deletions src/plugins/docs-plugin-extended/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
const docsPluginExports = require('@docusaurus/plugin-content-docs');
const { getRecentlyUpdatedArticles } = require('./getRecentArticles');
const { RECENT_ARTICLES_TEMP_URL } = require('../../components/RecentlyUpdatedArticles/constants');

const defaultDocsPlugin = docsPluginExports.default;
import docsPluginExports from '@docusaurus/plugin-content-docs';
import { getRecentlyUpdatedArticles } from './getRecentArticles';
import { RECENT_ARTICLES_TEMP_URL } from '../../components/RecentlyUpdatedArticles/constants';

const docsPluginEnhanced = async (...pluginArgs) => {
const docsPluginInstance = await defaultDocsPlugin(...pluginArgs);
const docsPluginInstance = await docsPluginExports(...pluginArgs);

return {
...docsPluginInstance,
Expand Down Expand Up @@ -35,7 +33,5 @@ const docsPluginEnhanced = async (...pluginArgs) => {
};
};

module.exports = {
...docsPluginExports,
default: docsPluginEnhanced,
};
export * from '@docusaurus/plugin-content-docs';
export default docsPluginEnhanced;

0 comments on commit fe13dad

Please sign in to comment.