diff --git a/src/shared/assets.d.ts b/src/shared/assets.d.ts new file mode 100644 index 000000000..b4e779c8d --- /dev/null +++ b/src/shared/assets.d.ts @@ -0,0 +1,9 @@ +declare module '*.png' { + const content: string; + export default content; +} + +declare module '*.svg' { + const content: string; + export default content; +} diff --git a/src/shared/components/icon/icon.module.css b/src/shared/components/icon/icon.module.css index 6a264cceb..c1741a1a0 100644 --- a/src/shared/components/icon/icon.module.css +++ b/src/shared/components/icon/icon.module.css @@ -34,6 +34,19 @@ font-size: var(--theme-font-size-5xl); } +img.size-xs, +img.size-sm, +img.size-md, +img.size-lg, +img.size-xl, +img.size-2xl, +img.size-3xl, +img.size-4xl, +img.size-5xl { + width: 1em; + height: 1em; +} + .color-default { color: var(--theme-colors-foreground); } diff --git a/src/shared/components/icon/icon.tsx b/src/shared/components/icon/icon.tsx index 335c6763b..a8a8daaee 100644 --- a/src/shared/components/icon/icon.tsx +++ b/src/shared/components/icon/icon.tsx @@ -1,8 +1,14 @@ import clsx from 'clsx'; import { motion } from 'motion/react'; -import { type ComponentType, forwardRef, memo, useMemo } from 'react'; +import { + type ComponentType, + type CSSProperties, + forwardRef, + ImgHTMLAttributes, + memo, + useMemo, +} from 'react'; import { IconBaseProps } from 'react-icons'; -import { FaLastfmSquare } from 'react-icons/fa'; import { LuAlignCenter, LuAlignLeft, @@ -127,12 +133,88 @@ import { import { MdOutlineVisibility, MdOutlineVisibilityOff } from 'react-icons/md'; import { PiMouseLeftClickFill, PiMouseRightClickFill } from 'react-icons/pi'; import { RiPlayListAddLine, RiRepeat2Line, RiRepeatOneLine } from 'react-icons/ri'; -import { SiMusicbrainz, SiSpotify } from 'react-icons/si'; import styles from './icon.module.css'; +import lastfmLogoIcon from './lastfm_logo_icon.svg'; +import listenbrainzLogoIcon from './listenbrainz_logo_icon.svg'; +import musicbrainzLogoIcon from './musicbrainz_logo_icon.svg'; +import qobuzLogoIcon from './qobuz_logo_icon.png'; +import spotifyLogoIcon from './spotify_logo_icon.svg'; export type AppIconSelection = keyof typeof AppIcon; +type LogoImgProps = ImgHTMLAttributes & { size?: number | string }; + +function logoImgStyle(size: number | string | undefined): CSSProperties | undefined { + if (size === undefined) return undefined; + const dim = typeof size === 'number' ? `${size}px` : size; + return { height: dim, width: dim }; +} + +const ListenBrainzLogoIcon = forwardRef( + ({ className, size, style, ...props }, ref) => ( + ListenBrainz + ), +); + +const SpotifyLogoIcon = forwardRef( + ({ className, size, style, ...props }, ref) => ( + Spotify + ), +); + +const MusicBrainzLogoIcon = forwardRef( + ({ className, size, style, ...props }, ref) => ( + MusicBrainz + ), +); +const QobuzLogoIcon = forwardRef( + ({ className, size, style, ...props }, ref) => ( + Qobuz + ), +); + +const LastfmLogoIcon = forwardRef( + ({ className, size, style, ...props }, ref) => ( + Last.fm + ), +); + export const AppIcon = { add: LuPlus, album: LuDisc3, @@ -156,9 +238,11 @@ export const AppIcon = { arrowUpToLine: LuArrowUpToLine, artist: LuUserPen, brandGitHub: LuGithub, - brandLastfm: FaLastfmSquare, - brandMusicBrainz: SiMusicbrainz, - brandSpotify: SiSpotify, + brandLastfm: LastfmLogoIcon, + brandListenBrainz: ListenBrainzLogoIcon, + brandMusicBrainz: MusicBrainzLogoIcon, + brandQobuz: QobuzLogoIcon, + brandSpotify: SpotifyLogoIcon, cache: LuCloudDownload, check: LuCheck, clipboardCopy: LuClipboardCopy, diff --git a/src/shared/components/icon/lastfm_logo_icon.svg b/src/shared/components/icon/lastfm_logo_icon.svg new file mode 100644 index 000000000..ae21acb6e --- /dev/null +++ b/src/shared/components/icon/lastfm_logo_icon.svg @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/shared/components/icon/listenbrainz_logo_icon.png b/src/shared/components/icon/listenbrainz_logo_icon.png new file mode 100644 index 000000000..182875a7f Binary files /dev/null and b/src/shared/components/icon/listenbrainz_logo_icon.png differ diff --git a/src/shared/components/icon/listenbrainz_logo_icon.svg b/src/shared/components/icon/listenbrainz_logo_icon.svg new file mode 100644 index 000000000..6037e4d85 --- /dev/null +++ b/src/shared/components/icon/listenbrainz_logo_icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/shared/components/icon/musicbrainz_logo_icon.svg b/src/shared/components/icon/musicbrainz_logo_icon.svg new file mode 100644 index 000000000..44fe7db59 --- /dev/null +++ b/src/shared/components/icon/musicbrainz_logo_icon.svg @@ -0,0 +1 @@ +MusicBrainz_logo \ No newline at end of file diff --git a/src/shared/components/icon/qobuz_logo_icon.png b/src/shared/components/icon/qobuz_logo_icon.png new file mode 100644 index 000000000..4ef8c4233 Binary files /dev/null and b/src/shared/components/icon/qobuz_logo_icon.png differ diff --git a/src/shared/components/icon/spotify_logo_icon.svg b/src/shared/components/icon/spotify_logo_icon.svg new file mode 100644 index 000000000..4f2e80329 --- /dev/null +++ b/src/shared/components/icon/spotify_logo_icon.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file