Skip to content

Commit

Permalink
refactor: fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
amphikapha committed Sep 19, 2024
1 parent 7ddfe4b commit 3dd25d0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
34 changes: 21 additions & 13 deletions src/lib/components/AnnoucementCard/AnnoucementCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
let isMobile = false;
const checkScreenSize = () => {
isMobile = window.innerWidth < 768;
};
const checkScreenSize = () => {
isMobile = window.innerWidth < 768;
};
onMount(() => {
checkScreenSize();
window.addEventListener('resize', checkScreenSize);
return () => window.removeEventListener('resize', checkScreenSize);
});
onMount(() => {
checkScreenSize();
window.addEventListener('resize', checkScreenSize);
return () => window.removeEventListener('resize', checkScreenSize);
});
</script>

<a
Expand All @@ -42,13 +42,17 @@
>
<div class="p-3 h-[300px] w-[300px] max-md:w-full max-md:h-auto max-md:p-2">
{#if imageURL || imageURL.length > 0}
<img src={imageURL} alt={title} width="276" height="276" class="w-[100%] rounded"/>
<img src={imageURL} alt={title} width="276" height="276" class="w-[100%] rounded" />
{:else}
<div class="w-[276px] h-[276px] max-md:w-full max-md:h-[124px] bg-gray-300 rounded animate-pulse"></div>
<div
class="w-[276px] h-[276px] max-md:w-full max-md:h-[124px] bg-gray-300 rounded animate-pulse"
></div>
{/if}
</div>

<div class="p-4 h-[150px] w-[300px] max-md:w-[140px] max-md:h-full max-md:p-2 max-md:pt-0 flex flex-col justify-between">
<div
class="p-4 h-[150px] w-[300px] max-md:w-[140px] max-md:h-full max-md:p-2 max-md:pt-0 flex flex-col justify-between"
>
<div
class={cn(
isMobile ? typography({ variant: 'body-small' }) : typography({ variant: 'body-medium' }),
Expand All @@ -62,7 +66,9 @@
<div class="flex justify-between mt-auto">
<div
class={cn(
isMobile ? typography({ variant: 'body-very-small' }) : typography({ variant: 'body-normal' }),
isMobile
? typography({ variant: 'body-very-small' })
: typography({ variant: 'body-normal' }),
'gap-[6px] h-auto',
isMobile ? 'leading-2' : 'leading-4'
)}
Expand All @@ -72,7 +78,9 @@

<div
class={cn(
isMobile ? typography({ variant: 'body-very-small' }) : typography({ variant: 'body-normal' }),
isMobile
? typography({ variant: 'body-very-small' })
: typography({ variant: 'body-normal' }),
'gap-[6px] h-auto',
isMobile ? 'leading-2' : 'leading-4'
)}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/Playground.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
});
annoucementCard.push({
imageURL: "",
imageURL: '',
title: 'ประกาศรับสมัครคณะกรรมาธิการวิสามัญพิจารณางบประมาณสโมสรนิสิตฯ',
createdAt: '2024-07-04',
createdBy: 'สภานิสิต',
Expand Down

0 comments on commit 3dd25d0

Please sign in to comment.