-
Notifications
You must be signed in to change notification settings - Fork 0
feat: schedule module #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,40 @@ | ||
| <template> | ||
| <ul | ||
| v-if="filteredLinks.length > 0" | ||
| class="flex flex-row flex-wrap gap-x-15 gap-y-2" | ||
| :class="{ | ||
| 'justify-start': align === 'start', | ||
| 'justify-center': align === 'center', | ||
| }" | ||
| > | ||
| <li v-for="(link, index) in filteredLinks" :key="link.url ?? index"> | ||
| <InlineLink | ||
| :href="link.fileDownload?.url ?? link.url ?? ''" | ||
| :external="link.external" | ||
| :show-external-icon="false" | ||
| :icon="link.icon" | ||
| class="no-underline text-foreground hover:text-accent font-semibold text-xl py-2 items-center" | ||
| > | ||
| {{ link.text }} | ||
| <template #trailing> | ||
| <IconArrowForward | ||
| class="text-action group-hover:translate-x-2 transition-transform duration-default ease-default" | ||
| /> | ||
| </template> | ||
| </InlineLink> | ||
| </li> | ||
| </ul> | ||
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
| import type { LinkFragment } from "~~/shared/types/graphql"; | ||
|
|
||
| const { links, align = "start" } = defineProps<{ | ||
| links: (LinkFragment | null)[] | undefined; | ||
| align?: "start" | "center"; | ||
| }>(); | ||
|
|
||
| const filteredLinks = computed(() => | ||
| (links ?? []).filter((link) => link !== null), | ||
| ); | ||
| </script> |
This file contains hidden or 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 hidden or 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 hidden or 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,53 @@ | ||
| <template> | ||
| <ContentContainer | ||
| as="section" | ||
| class="pb-vertical md:pb-vertical-lg gap-y-7 md:gap-y-10" | ||
| grid | ||
| > | ||
| <div class="col-span-full max-w-copy mx-auto text-center"> | ||
| <Heading as="h2" class="mb-6">{{ data.heading }}</Heading> | ||
| <RichTextRenderer :json="data?.copy?.json" class="type-body text-muted" /> | ||
| </div> | ||
|
|
||
| <div | ||
| v-if="data.eventDate" | ||
| class="col-span-full mx-auto text-center flex flex-col items-center gap-y-6" | ||
| > | ||
| <Heading as="h3" variant="h4">{{ data.eventDate }}</Heading> | ||
| <div class="divider" /> | ||
| </div> | ||
|
|
||
| <div | ||
| class="col-span-full grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6" | ||
| > | ||
| <div | ||
| v-for="(event, index) in events" | ||
| :key="index" | ||
| class="rounded-xl p-6 text-center bg-secondary" | ||
| > | ||
| <Heading as="h4" class="mb-2">{{ event.title }}</Heading> | ||
| <RichTextRenderer | ||
| :json="event.copy?.json" | ||
| class="type-body text-muted" | ||
| /> | ||
| </div> | ||
| </div> | ||
|
|
||
| <LinkCollection | ||
| :links="data.callToActionCollection?.items" | ||
| align="center" | ||
| class="col-span-full mx-auto md:px-side" | ||
| /> | ||
| </ContentContainer> | ||
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
| import type { ModuleProps } from "~/types/module"; | ||
| import type { ScheduleFragment } from "~~/shared/types/graphql"; | ||
|
|
||
| const { data } = defineProps<ModuleProps<ScheduleFragment>>(); | ||
|
|
||
| const events = computed( | ||
| () => data.eventsCollection?.items.filter((item) => item !== null) ?? [], | ||
| ); | ||
| </script> |
This file contains hidden or 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,22 @@ | ||
| <template> | ||
| <component :is="Icon" v-if="Icon" class="size-5 shrink-0" /> | ||
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
| import { IconApple, IconDownload, IconGoogle } from "#components"; | ||
| export type IconType = "Download" | "Apple" | "Google"; | ||
|
|
||
| const icons: Record<IconType, Component> = { | ||
| Download: IconDownload, | ||
| Apple: IconApple, | ||
| Google: IconGoogle, | ||
| }; | ||
| const props = defineProps<{ | ||
| icon: IconType | null | undefined; | ||
| }>(); | ||
|
|
||
| const Icon = computed(() => { | ||
| if (!props.icon) return null; | ||
| return icons[props.icon]; | ||
| }); | ||
| </script> | ||
This file contains hidden or 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 hidden or 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,12 @@ | ||
| <template> | ||
| <svg | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| xml:space="preserve" | ||
| viewBox="0 0 814 1000" | ||
| fill="currentColor" | ||
| > | ||
| <path | ||
| d="M788.1 340.9c-5.8 4.5-108.2 62.2-108.2 190.5 0 148.4 130.3 200.9 134.2 202.2-.6 3.2-20.7 71.9-68.7 141.9-42.8 61.6-87.5 123.1-155.5 123.1s-85.5-39.5-164-39.5c-76.5 0-103.7 40.8-165.9 40.8s-105.6-57-155.5-127C46.7 790.7 0 663 0 541.8c0-194.4 126.4-297.5 250.8-297.5 66.1 0 121.2 43.4 162.7 43.4 39.5 0 101.1-46 176.3-46 28.5 0 130.9 2.6 198.3 99.2zm-234-181.5c31.1-36.9 53.1-88.1 53.1-139.3 0-7.1-.6-14.3-1.9-20.1-50.6 1.9-110.8 33.7-147.1 75.8-28.5 32.4-55.1 83.6-55.1 135.5 0 7.8 1.3 15.6 1.9 18.1 3.2.6 8.4 1.3 13.6 1.3 45.4 0 102.5-30.4 135.5-71.3z" | ||
| /> | ||
| </svg> | ||
| </template> |
This file contains hidden or 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,11 @@ | ||
| <template> | ||
| <svg | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| viewBox="0 -960 960 960" | ||
| fill="currentColor" | ||
| > | ||
| <path | ||
| d="M647-440H160v-80h487L423-744l57-56 320 320-320 320-57-56 224-224Z" | ||
| /> | ||
| </svg> | ||
| </template> |
This file contains hidden or 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,11 @@ | ||
| <template> | ||
| <svg | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| viewBox="0 -960 960 960" | ||
| fill="currentColor" | ||
| > | ||
| <path | ||
| d="M480-320 280-520l56-58 104 104v-326h80v326l104-104 56 58-200 200ZM240-160q-33 0-56.5-23.5T160-240v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-160H240Z" | ||
| /> | ||
| </svg> | ||
| </template> |
This file contains hidden or 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,11 @@ | ||
| <template> | ||
| <svg | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| viewBox="0 0 488 512" | ||
| fill="currentColor" | ||
| > | ||
| <path | ||
| d="M488 261.8C488 403.3 391.1 504 248 504 110.8 504 0 393.2 0 256S110.8 8 248 8c66.8 0 123 24.5 166.3 64.9l-67.5 64.9C258.5 52.6 94.3 116.6 94.3 256c0 86.5 69.1 156.6 153.7 156.6 98.2 0 135-70.4 140.8-106.9H248v-85.3h236.1c2.3 12.7 3.9 24.9 3.9 41.4z" | ||
| /> | ||
| </svg> | ||
| </template> |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -5,5 +5,9 @@ export const LINK_FRAGMENT = gql` | |
| text | ||
| url | ||
| external | ||
| icon | ||
| fileDownload { | ||
| url | ||
| } | ||
| } | ||
| `; | ||
This file contains hidden or 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 hidden or 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,26 @@ | ||
| import { gql } from "graphql-request"; | ||
|
|
||
| export const SCHEDULE_FRAGMENT = gql` | ||
| fragment Schedule on ModuleSchedule { | ||
| heading | ||
| copy { | ||
| json | ||
| } | ||
| eventDate | ||
| callToActionCollection(limit: 3) { | ||
| items { | ||
| ...Link | ||
| } | ||
| } | ||
| eventsCollection(limit: 15) { | ||
| items { | ||
| ... on ComponentTitleCopy { | ||
| title | ||
| copy { | ||
| json | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| `; |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.