Skip to content

Commit

Permalink
Change import of image
Browse files Browse the repository at this point in the history
  • Loading branch information
ernstmul committed Oct 3, 2024
1 parent 0be3489 commit 205f97c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
6 changes: 6 additions & 0 deletions src/lib/images/github-education-program/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import ArtworkDark from './artwork-dark.svg';
import ArtworkDarkMobile from './artwork-dark-mobile.svg';
import ArtworkLight from './artwork-light.svg';
import ArtworkLightMobile from './artwork-light-mobile.svg';

export { ArtworkDark, ArtworkDarkMobile, ArtworkLight, ArtworkLightMobile };
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
import AppwriteLogoLight from '$lib/images/appwrite-logo-light.svg';
import GithubLogoDark from '$lib/images/github-logo-dark.svg';
import GithubLogoLight from '$lib/images/github-logo-light.svg';
import {
ArtworkDark,
ArtworkDarkMobile,
ArtworkLightMobile,
ArtworkLight
} from '$lib/images/github-education-program';
let artworkImageSrc;
getArtworkImageSrc();
Expand All @@ -15,15 +21,13 @@
function getArtworkImageSrc() {
let isMobile = window.matchMedia('(max-width: 767px)').matches;
if ($app.themeInUse === 'light' && isMobile) {
artworkImageSrc =
'/console/src/lib/images/github-education-program/artwork-light-mobile.svg';
artworkImageSrc = ArtworkLightMobile;
} else if ($app.themeInUse === 'light' && !isMobile) {
artworkImageSrc = '/console/src/lib/images/github-education-program/artwork-light.svg';
artworkImageSrc = ArtworkLight;
} else if ($app.themeInUse === 'dark' && isMobile) {
artworkImageSrc =
'/console/src/lib/images/github-education-program/artwork-dark-mobile.svg';
artworkImageSrc = ArtworkDarkMobile;
} else {
artworkImageSrc = '/console/src/lib/images/github-education-program/artwork-dark.svg';
artworkImageSrc = ArtworkDark;
}
}
Expand Down

0 comments on commit 205f97c

Please sign in to comment.