Skip to content

Commit

Permalink
feat: svg favicon
Browse files Browse the repository at this point in the history
  • Loading branch information
onursagir committed Aug 23, 2024
1 parent f435b3c commit b00d5d0
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/sour-lamps-explain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"web": minor
---

Use SVG favicon
34 changes: 34 additions & 0 deletions apps/web/src/app/icon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { ImageResponse } from 'next/og';
import { Logo } from '../components/logo';

// Image metadata
export const size = {
width: 32,
height: 32,
};
export const contentType = 'image/png';

// Image generation
export default function Icon() {
return new ImageResponse(
(
// ImageResponse JSX element
<div
style={{
width: '100%',
height: '100%',
display: 'flex',
justifyContent: 'center',
}}
>
<Logo variant="compact" style={{ width: '100%', height: 'auto' }} />
</div>
),
// ImageResponse options
{
// For convenience, we can re-use the exported icons size metadata
// config to also set the ImageResponse's width and height.
...size,
}
);
}

0 comments on commit b00d5d0

Please sign in to comment.