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

fix: styles #300

Merged
merged 2 commits into from
Apr 14, 2024
Merged

fix: styles #300

merged 2 commits into from
Apr 14, 2024

Conversation

okisdev
Copy link
Owner

@okisdev okisdev commented Apr 14, 2024

No description provided.

Copy link

vercel bot commented Apr 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
chat-chat ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 14, 2024 8:00am

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @okisdev - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Docstrings: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@@ -16,8 +17,10 @@ export const Images = ({ images, query }: { images: string[]; query?: string })

const [isAllResources, setIsAllResources] = useState<boolean>(false);

const shown = isAllResources ? images : images.slice(0, 4);
const hidden = isAllResources ? [] : images.slice(4);
const isDesktop = useMediaQuery('(min-width: 768px)');
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (performance): Consider caching the result of useMediaQuery to avoid potential performance issues.

Repeated calls to useMediaQuery in different components or hooks can lead to performance degradation, especially on components that re-render often.

Suggested change
const isDesktop = useMediaQuery('(min-width: 768px)');
import { useMediaQueryContext } from 'path/to/context/MediaQueryContext';
const { isDesktop } = useMediaQueryContext();

@okisdev okisdev merged commit 890d3c2 into main Apr 14, 2024
3 checks passed
@okisdev okisdev deleted the fix/style branch April 14, 2024 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant