Skip to content

Commit

Permalink
Unsafe Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
luandro committed Sep 6, 2024
1 parent a4609a4 commit 9684f79
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 19 deletions.
1 change: 0 additions & 1 deletion src/components/Hero.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import { Button } from "@/components/ui/button";
import ReactMarkdown from 'react-markdown';

const Hero = ({ title, title2, subTitle, logos, onSmoothScroll }) => {

Expand Down
2 changes: 1 addition & 1 deletion src/components/Info.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const Info = ({ content }) => {
max={64}
className={`w-full text-[${colors[colorIndex]}] uppercase font-semibold leading-none`}
>
{index === array.length - 1 ? 'de ' + line.trim() : line.trim()}
{index === array.length - 1 ? `de ${line.trim()}` : line.trim()}
</Textfit>
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions src/components/MediaGallery.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const MediaGallery = ({ markdown, metaData }) => {
{item.image ? (
<img src={item.image} alt={item.title} className="object-cover w-full h-full" />
) : item.video ? (
<iframe src={item.video} title={item.title} className="w-full h-full" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen></iframe>
<iframe src={item.video} title={item.title} className="w-full h-full" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen />
) : null}
</div>
<div className="p-4">
Expand Down Expand Up @@ -100,7 +100,7 @@ const MediaGallery = ({ markdown, metaData }) => {
{currentItem?.image ? (
<img src={currentItem.image} alt={currentItem.title} className="max-w-full max-h-full object-contain" />
) : currentItem?.video ? (
<iframe src={currentItem.video} title={currentItem.title} className="w-full h-full" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen></iframe>
<iframe src={currentItem.video} title={currentItem.title} className="w-full h-full" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen />
) : null}
</div>
<Button
Expand Down
2 changes: 1 addition & 1 deletion src/components/Participants.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const parseParticipantsData = (markdownContent) => {
if (content[i].startsWith('### ') || content[i].startsWith('## ')) {
break;
}
description += content[i].trim() + '\n';
description += `${content[i].trim()}\n`;
}
return { name: participantName, description: description.trim() };
});
Expand Down
4 changes: 2 additions & 2 deletions src/lib/generateBlocks.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from 'url';
import { fileURLToPath } from 'node:url';
import { n2m } from './notionClient.js';
import axios from 'axios';
import chalk from 'chalk';
Expand Down Expand Up @@ -73,7 +73,7 @@ export async function generateBlocks(data, progressCallback) {
const markdown = await n2m.pageToMarkdown(page.id);
const markdownString = n2m.toMarkdownString(markdown);

if (markdownString && markdownString.parent) {
if (markdownString?.parent) {
const websiteBlock = page.properties["Website Block"]?.select?.name;
if (websiteBlock) {
// Process images
Expand Down
2 changes: 1 addition & 1 deletion src/lib/imageProcessor.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sharp from 'sharp';
import path from 'path';
import path from 'node:path';

export async function processImage(inputBuffer, outputPath, maxWidth = 1280) {
try {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/updateJson.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from 'url';
import { fileURLToPath } from 'node:url';
import { marked } from "marked";

const __filename = fileURLToPath(import.meta.url);
Expand Down
6 changes: 3 additions & 3 deletions src/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ export const extractEventInformation = (markdown) => {
eventInfo.localMedia = match[2];
}
} else {
eventInfo.local += line.trim() + ' ';
eventInfo.local += `${line.trim()} `;
}
} else if (currentSection === 'data' && line.trim() !== '') {
eventInfo.data += line.trim() + ' ';
eventInfo.data += `${line.trim()} `;
} else if (currentSection === 'organization' && line.trim() !== '') {
eventInfo.organization += line.trim() + ' ';
eventInfo.organization += `${line.trim()} `;
}
});

Expand Down
14 changes: 7 additions & 7 deletions src/pages/Index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,20 @@ const Index = () => {
<Schedule title={scheduleTitle} scheduleItems={scheduleItems} />
</div>
)}
{metaData['Participants'] && markdownContents['Participants'] && (
{metaData.Participants && markdownContents.Participants && (
<div id="participants" ref={sectionRefs.participants} className="min-h-screen">
<Participants
markdownContent={markdownContents['Participants']}
markdownContent={markdownContents.Participants}
/>
</div>
)}
{markdownContents['Gallery'] && metaData['Gallery'] && (
<div id="gallery" ref={sectionRefs['gallery']}>
{markdownContents.Gallery && metaData.Gallery && (
<div id="gallery" ref={sectionRefs.gallery}>
<MediaGallery
markdown={markdownContents['Gallery']}
markdown={markdownContents.Gallery}
metaData={{
...metaData['Gallery'],
title: metaData['Gallery'].title || "Galeria da Edição Anterior"
...metaData.Gallery,
title: metaData.Gallery.title || "Galeria da Edição Anterior"
}}
/>
</div>
Expand Down

0 comments on commit 9684f79

Please sign in to comment.