-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Break projects grid into its own component
- Loading branch information
Morgan Brown
committed
Jan 14, 2025
1 parent
fb58fef
commit 806a7b4
Showing
5 changed files
with
51 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/routes/(pages)/app/(app)/components/projects-grid.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<script lang="ts"> | ||
import PrimaryColorThemer from '$lib/components/primary-color-themer/primary-color-themer.svelte'; | ||
import ProjectCard from '$lib/components/project-card/project-card.svelte'; | ||
import filterCurrentChainData from '$lib/utils/filter-current-chain-data'; | ||
import isClaimed from '$lib/utils/project/is-claimed'; | ||
import type { DefaultExplorePageFeaturedProjectFragment } from './__generated__/gql.generated'; | ||
import getProjectColor from './project-color'; | ||
export let projects: DefaultExplorePageFeaturedProjectFragment[]; | ||
</script> | ||
|
||
<div class="projects-grid"> | ||
{#each projects as project} | ||
<div> | ||
{#if isClaimed(filterCurrentChainData(project.chainData))} | ||
<PrimaryColorThemer colorHex={getProjectColor(project)}> | ||
<ProjectCard {project} /> | ||
</PrimaryColorThemer> | ||
{/if} | ||
</div> | ||
{/each} | ||
</div> | ||
|
||
<style> | ||
.projects-grid { | ||
display: grid; | ||
grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); | ||
gap: 1rem; | ||
max-width: 100%; | ||
position: relative; | ||
padding: 4px; | ||
} | ||
@media (max-width: 767px) { | ||
.projects-grid { | ||
display: flex; | ||
gap: 1rem; | ||
padding: 4px; | ||
} | ||
.projects-grid > div { | ||
width: 14rem; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.