-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use carrousel in datahub record API and links lists
- Loading branch information
Showing
4 changed files
with
67 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
this computes the space outside of the main column when using `container-lg px-4` | ||
FIXME: this component is dependant on the datahub context and should be in the app instead | ||
*/ | ||
:host { | ||
--container-outside-width: calc(50vw - 1024px / 2); | ||
} | ||
@media (max-width: 1024px) { | ||
:host { | ||
--container-outside-width: 1rem; | ||
} | ||
} | ||
|
||
gn-ui-carousel { | ||
display: block; | ||
margin-left: calc(-1 * var(--container-outside-width)); | ||
margin-right: calc(-1 * var(--container-outside-width)); | ||
} |
21 changes: 15 additions & 6 deletions
21
libs/feature/record/src/lib/data-apis/data-apis.component.html
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 |
---|---|---|
@@ -1,16 +1,25 @@ | ||
<p | ||
class="font-title text-[28px] font-medium mt-8 text-title text-center sm:mt-12 sm:text-left" | ||
class="font-title text-[28px] font-medium mt-8 mb-5 text-title text-center sm:mt-12 sm:mb-[-22px] sm:text-left" | ||
translate | ||
> | ||
record.metadata.api | ||
</p> | ||
<div | ||
class="mb-4 -ml-4 px-4 sm:pt-4 pt-2 justify-center flex flex-row flex-wrap sm:gap-4 sm:justify-start md:flex-nowrap md:items-stretch md:overflow-x-auto md:overflow-y-visible" | ||
<gn-ui-carousel | ||
containerClass="gap-4 py-10" | ||
stepsContainerClass="right-[var(--container-outside-width)] bottom-[calc(100%-12px)] top-auto" | ||
> | ||
<gn-ui-api-card | ||
*ngFor="let link of facade.apiLinks$ | async" | ||
class="shrink w-80 my-2" | ||
*ngFor=" | ||
let link of facade.apiLinks$ | async; | ||
let first = first; | ||
let last = last | ||
" | ||
[link]="link" | ||
class="w-80" | ||
[ngClass]="{ | ||
'mr-[var(--container-outside-width)]': last, | ||
'ml-[var(--container-outside-width)]': first | ||
}" | ||
> | ||
</gn-ui-api-card> | ||
</div> | ||
</gn-ui-carousel> |
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,18 @@ | ||
/* | ||
this computes the space outside of the main column when using `container-lg px-4` | ||
FIXME: this component is dependant on the datahub context and should be in the app instead | ||
*/ | ||
:host { | ||
--container-outside-width: calc(50vw - 1024px / 2); | ||
} | ||
@media (max-width: 1024px) { | ||
:host { | ||
--container-outside-width: 1rem; | ||
} | ||
} | ||
|
||
gn-ui-carousel { | ||
display: block; | ||
margin-left: calc(-1 * var(--container-outside-width)); | ||
margin-right: calc(-1 * var(--container-outside-width)); | ||
} |
20 changes: 16 additions & 4 deletions
20
libs/feature/record/src/lib/data-otherlinks/data-otherlinks.component.html
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 |
---|---|---|
@@ -1,13 +1,25 @@ | ||
<p | ||
class="font-title text-[28px] font-medium mt-8 mb-6 text-title text-center sm:mt-12 sm:mb-4 sm:text-left" | ||
class="font-title text-[28px] font-medium mt-8 mb-5 text-title text-center sm:mt-12 sm:mb-[-22px] sm:text-left" | ||
translate | ||
> | ||
record.metadata.links | ||
</p> | ||
<div class="grid gap-2 grid-cols-1 sm:gap-6 sm:grid-cols-2 lg:grid-cols-3"> | ||
<gn-ui-carousel | ||
containerClass="gap-4 py-10" | ||
stepsContainerClass="right-[var(--container-outside-width)] bottom-[calc(100%-12px)] top-auto" | ||
> | ||
<gn-ui-link-card | ||
*ngFor="let link of facade.otherLinks$ | async" | ||
*ngFor=" | ||
let link of facade.otherLinks$ | async; | ||
let first = first; | ||
let last = last | ||
" | ||
[link]="link" | ||
class="w-80" | ||
[ngClass]="{ | ||
'mr-[var(--container-outside-width)]': last, | ||
'ml-[var(--container-outside-width)]': first | ||
}" | ||
> | ||
</gn-ui-link-card> | ||
</div> | ||
</gn-ui-carousel> |