-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #249 from Perdolique/246-brands-list
Brands list
- Loading branch information
Showing
31 changed files
with
2,037 additions
and
253 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
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 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 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,66 @@ | ||
<template> | ||
<button | ||
:class="$style.component" | ||
@click="onCardClick" | ||
> | ||
<div :class="$style.name"> | ||
{{ name }} | ||
</div> | ||
|
||
<BrandInfo | ||
:equipment-count="equipmentCount" | ||
:website-url="websiteUrl" | ||
/> | ||
</button> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import type { BrandModel } from '~/models/brand'; | ||
import BrandInfo from './BrandInfo.vue'; | ||
interface Props extends BrandModel {} | ||
const { id } = defineProps<Props>() | ||
const router = useRouter() | ||
function onCardClick() { | ||
router.push(`/brands/details/${id}`) | ||
} | ||
</script> | ||
|
||
<style lang="scss" module> | ||
@mixin focusStyle { | ||
background-color: var(--accent-100); | ||
border-color: var(--accent-300); | ||
} | ||
.component { | ||
display: grid; | ||
outline: none; | ||
justify-content: space-between; | ||
text-align: left; | ||
row-gap: var(--spacing-24); | ||
background-color: var(--accent-50); | ||
border: 1px solid var(--accent-200); | ||
border-radius: var(--border-radius-8); | ||
padding: var(--spacing-16); | ||
transition: | ||
background-color var(--transition-time-quick) ease-out, | ||
border-color var(--transition-time-quick) ease-out; | ||
@media (hover: hover) { | ||
&:hover { | ||
@include focusStyle(); | ||
} | ||
} | ||
&:focus-visible { | ||
@include focusStyle(); | ||
} | ||
} | ||
.name { | ||
grid-area: 1 / 1 / 2 / 2; | ||
font-weight: var(--font-weight-medium); | ||
} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<template> | ||
<div :class="$style.component"> | ||
<BrandCard | ||
v-for="brand in brands" | ||
:id="brand.id" | ||
:key="brand.id" | ||
:name="brand.name" | ||
:website-url="brand.websiteUrl" | ||
:equipment-count="brand.equipmentCount" | ||
/> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import type { BrandModel } from '~/models/brand'; | ||
import BrandCard from './BrandCard.vue'; | ||
interface Props { | ||
readonly brands: BrandModel[]; | ||
} | ||
defineProps<Props>(); | ||
</script> | ||
|
||
<style lang="scss" module> | ||
.component { | ||
display: grid; | ||
row-gap: var(--spacing-8); | ||
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); | ||
gap: var(--spacing-8); | ||
@include mobileLarge { | ||
display: none; | ||
} | ||
} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<template> | ||
<div :class="$style.component"> | ||
<BrandInfoItem icon="tabler:package"> | ||
{{ equipmentCount }} | ||
</BrandInfoItem> | ||
|
||
<BrandInfoItem | ||
v-if="websiteUrl" | ||
icon="tabler:world" | ||
> | ||
<PerdLink | ||
:to="websiteUrl" | ||
target="_blank" | ||
@click.stop | ||
> | ||
Website | ||
</PerdLink> | ||
</BrandInfoItem> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import PerdLink from '~/components/PerdLink.vue'; | ||
import BrandInfoItem from './BrandInfoItem.vue'; | ||
interface Props { | ||
readonly equipmentCount: number; | ||
readonly websiteUrl: string | null; | ||
} | ||
defineProps<Props>(); | ||
</script> | ||
|
||
<style module> | ||
.component { | ||
display: flex; | ||
column-gap: var(--spacing-12); | ||
} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<template> | ||
<span :class="$style.component"> | ||
<Icon | ||
:name="icon" | ||
size="1.25em" | ||
/> | ||
|
||
<slot /> | ||
</span> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
interface Props { | ||
readonly icon: string; | ||
} | ||
defineProps<Props>(); | ||
</script> | ||
|
||
<style module> | ||
.component { | ||
font-size: var(--font-size-14); | ||
display: flex; | ||
align-items: center; | ||
column-gap: var(--spacing-4); | ||
color: var(--text-500); | ||
} | ||
</style> |
Oops, something went wrong.