@dcrackel/meyersquaredui 1.0.68 → 1.0.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,64 @@
1
+ const mockGetTournamentId =
2
+ {
3
+ "TournamentId": 37,
4
+ "Name": "Pumpkin Slice",
5
+ "StartDate": "2024-10-27",
6
+ "EndDate": "2024-10-28",
7
+ "RegistrationCutOff": "2024-10-27",
8
+ "Description": "<p>We are gathering at the Coombs Fairgrounds &amp; Event Centre on October 27th, 2023 for an Open Steel Messer tournament. This will be the second iteration, official, but spiritually, the third, as it was inspired by the Spooky Scary Messer tournament held by THCC in Vancouver.</p>",
9
+ "HostedOnM2": true,
10
+ "TotalParticipants": 0,
11
+ "Events": [],
12
+ "Club": {
13
+ "Name": "Comox Valley Combat Guild",
14
+ "ClubId": 356,
15
+ "Images": [
16
+ {
17
+ "ImageId": 46,
18
+ "URL": "https://meyersquared.com/uploads/CVCG+Logo+2024.png",
19
+ "AltText": "This is alt text"
20
+ }
21
+ ]
22
+ },
23
+ "Address": {
24
+ "Name": "Coombs Fairgrounds & Event Center",
25
+ "City": "Coombs",
26
+ "State": "BC",
27
+ "Address1": "1014 Ford Rd",
28
+ "Zip": 12345,
29
+ "Coordinates": "49.303763,-124.419878"
30
+ },
31
+ "Images": [
32
+ {
33
+ "ImageId": 45,
34
+ "URL": "https://meyersquared.com/uploads/t-23ee43e9.png",
35
+ "AltText": "Pumpkin Slice image"
36
+ }
37
+ ],
38
+ "PrimaryContact": {
39
+ "PersonId": 0,
40
+ "DisplayName": "Not Assigned",
41
+ "Images": []
42
+ },
43
+ "SocialMedia": [
44
+ {
45
+ "Link": "https://www.facebook.com/events/654044546924140/",
46
+ "Type": "Facebook",
47
+ "Label": "Registration Link"
48
+ },
49
+ {
50
+ "Link": "https://www.facebook.com/events/654044546924140/",
51
+ "Type": "Registration",
52
+ "Label": "Registration Link"
53
+ },
54
+ {
55
+ "Link": "https://www.facebook.com/events/654044546924140/",
56
+ "Type": "Rules",
57
+ "Label": "Rules Link"
58
+ }
59
+ ],
60
+ "TotalEvents": 0,
61
+ "Status": "completed"
62
+ };
63
+
64
+ export default mockGetTournamentId;
@@ -5,7 +5,7 @@
5
5
  </div>
6
6
 
7
7
  <div class="flex justify-end items-center w-full md:h-10 rounded-md p-2">
8
- <BaseText color="primary" size="md" weight="normal" class="mr-2">Share</BaseText>
8
+ <BaseText v-if="shareLinks && shareLinks.length > 0" color="primary" size="md" weight="normal" class="mr-2 mt-0.5">Share</BaseText>
9
9
  <a
10
10
  v-for="link in shareLinks"
11
11
  :key="link.name"
@@ -13,7 +13,7 @@
13
13
  target="_blank"
14
14
  class="mx-2 hover:text-accent transition duration-200"
15
15
  >
16
- <Icon type="fa-brands" color="primary" :icon="link.icon" size="md" />
16
+ <Icon type="fa-brands" color="primary" :icon="link.icon" size="md" class="hover:text-accent" />
17
17
  </a>
18
18
  </div>
19
19
 
@@ -45,14 +45,17 @@ export default {
45
45
  type: String,
46
46
  default: '<p>This is a sample tournament description. It can be long and may contain HTML.</p>',
47
47
  },
48
- },
49
- data() {
50
- return {
51
- shareLinks: [
48
+ shareLinks: {
49
+ type: Array,
50
+ default: () => [
52
51
  { name: 'Facebook', url: 'https://facebook.com', icon: 'fa-facebook' },
53
52
  { name: 'Instagram', url: 'https://twitter.com', icon: 'fa-instagram' },
54
53
  { name: 'Discord', url: 'https://linkedin.com', icon: 'fa-discord' },
55
54
  ],
55
+ },
56
+ },
57
+ data() {
58
+ return {
56
59
  };
57
60
  },
58
61
  };
@@ -28,6 +28,7 @@
28
28
 
29
29
  <div class="flex justify-center">
30
30
  <BaseButton
31
+ v-if="rulesLink"
31
32
  backgroundColor="secondary"
32
33
  color="primary"
33
34
  border="primary"
@@ -85,6 +86,10 @@ export default {
85
86
  type: Number,
86
87
  default: 0,
87
88
  },
89
+ rulesLink: {
90
+ type: String,
91
+ default: '',
92
+ },
88
93
  apiKey: {
89
94
  type: String,
90
95
  default: '',
@@ -1,31 +1,35 @@
1
1
  <template>
2
- <section :class="topClasses">
3
- <div :class="headerClasses">
4
- <BaseText color="primary" size="xl" tag="h3" weight="bold">{{ title }}</BaseText>
2
+ <section class="w-full flex justify-center mx-auto">
3
+ <section>
4
+ <div :class="topClasses" class="flex flex-col">
5
+ <div :class="headerClasses">
6
+ <BaseText color="primary" size="xl" tag="h3" weight="bold">{{ title }}</BaseText>
7
+ </div>
8
+ <div :class="gridClasses">
9
+ <component
10
+ v-for="(item, index) in items"
11
+ :is="cardComponent"
12
+ :key="index"
13
+ :data="item"
14
+ :index="index"
15
+ :isLoading="isLoading"
16
+ @grid-card-click="handleTournamentCardClick"
17
+ />
18
+ </div>
5
19
  </div>
6
- <div :class="gridClasses">
7
- <component
8
- v-for="(item, index) in items"
9
- :is="cardComponent"
10
- :key="index"
11
- :data="item"
12
- :index="index"
13
- :isLoading="isLoading"
14
- @grid-card-click="handleTournamentCardClick"
20
+ <div v-if="!whiteStyle && moreButtonLabel" class="w-full flex justify-center pb-28 pt-10 md:pt-14">
21
+ <BaseButton
22
+ backgroundColor="secondary"
23
+ border="primary"
24
+ size="xs"
25
+ color="primary"
26
+ hoverColor="secondary"
27
+ :label="moreButtonLabel"
28
+ @click="onClick"
15
29
  />
16
30
  </div>
31
+ </section>
17
32
  </section>
18
- <div v-if="!whiteStyle && moreButtonLabel" class="w-full flex justify-center pb-28 pt-10 md:pt-14">
19
- <BaseButton
20
- backgroundColor="secondary"
21
- border="primary"
22
- size="xs"
23
- color="primary"
24
- hoverColor="secondary"
25
- :label="moreButtonLabel"
26
- @click="onClick"
27
- />
28
- </div>
29
33
  </template>
30
34
 
31
35
  <script>
@@ -34,7 +34,7 @@
34
34
  </section>
35
35
 
36
36
  <!-- Mobile Overlay -->
37
- <div v-if="isMobile" class="flex justify-center text-left w-full px-6 mt-10">
37
+ <div v-if="isMobile" class="flex justify-center text-left w-full px-6 mt-12">
38
38
  <div class="w-full">
39
39
  <BaseText color="secondary" tag="h1" size="lg" weight="bold" class="mb-2">{{ formattedDate }}</BaseText>
40
40
  <BaseText color="secondary" tag="h1" size="xl" weight="bold" class="mb-2">{{ title }}</BaseText>
@@ -1,6 +1,5 @@
1
1
  import HomePage from './TournamentDetailPage.vue';
2
- import mockTournamentDetails from "../../../mocks/getTouranmentDetailsMock.js";
3
-
2
+ import mockGetTournamentId from "../../../mocks/getTournamentById.js";
4
3
  export default {
5
4
  title: 'Templates/TournamentDetailsPage',
6
5
  component: HomePage,
@@ -15,9 +14,9 @@ export default {
15
14
 
16
15
  export const Default = {
17
16
  args: {
18
- title: mockTournamentDetails.Name,
17
+ title: mockGetTournamentId.Name,
19
18
  imageSrc: 'https://meyersquared.com/images/banners/thinbanner01.jpg',
20
- tournament: mockTournamentDetails,
19
+ tournament: mockGetTournamentId,
21
20
  apiKey: 'AIzaSyC5kuJeMLopgjHDqsQPjRZ6Fkg3PFydw9Q',
22
21
  },
23
22
  };
@@ -26,7 +25,7 @@ export const AllLoading = {
26
25
  args: {
27
26
  title: 'Discover, Compete, Connect',
28
27
  imageSrc: 'https://meyersquared.com/images/banners/thinbanner01.jpg',
29
- tournament: mockTournamentDetails,
28
+ tournament: mockGetTournamentId,
30
29
  apiKey: 'AIzaSyC5kuJeMLopgjHDqsQPjRZ6Fkg3PFydw9Q',
31
30
  },
32
31
  };
@@ -3,7 +3,7 @@
3
3
  <Header/>
4
4
  <TournamentDetailsBanner :title="title"
5
5
  :imageSrc="imageSrc"
6
- :club-logo="tournament.Club.Images[0].URL"
6
+ :club-logo="ClubLogo"
7
7
  :hosting-club-name="tournament.Club.Name"
8
8
  :tournament-start-date="tournament.StartDate"
9
9
  />
@@ -14,10 +14,12 @@
14
14
  <TournamentDetails
15
15
  :imageSrc="tournament.Images[0].URL"
16
16
  :description="tournament.Description"
17
+ :shareLinks="ShareLinks"
17
18
  />
18
19
  </div>
19
20
  <div class="w-full max-w-4xl mx-auto md:p-4">
20
21
  <GridLayout
22
+ v-if="tournament.Events.length > 0"
21
23
  :cardComponent="EventListCard"
22
24
  :items="tournament.Events"
23
25
  :maxColumns="1"
@@ -26,17 +28,18 @@
26
28
  :title="'Events'"
27
29
  />
28
30
  </div>
29
- <div class="w-full flex justify-center md:mb-20">
30
- <BaseButton label="Register" backgroundColor="secondary" border="primary" class="w-40 mx-auto mt-10"/>
31
+ <div v-if="RegistrationLink" class="w-full flex justify-center md:mb-20">
32
+ <BaseButton label="Register" backgroundColor="secondary" border="primary" class="w-40 mx-auto mt-10" @click="handleRegistrationClick"/>
31
33
  </div>
32
34
  </section>
33
35
  <section class="mt-8 md:mt-16">
34
36
  <HostColumn
35
- :organizerName="tournament.PrimaryContact.DisplayName"
36
- :organizerPortrait="tournament.PrimaryContact.Images[0].URL"
37
+ :organizerName="ContactName"
38
+ :organizerPortrait="ContactImage"
37
39
  :address="tournament.Address"
38
40
  :fencersGoing="tournament.TotalParticipants"
39
41
  :bookmarksCount="tournament.TotalBookmarks"
42
+ :rulesLink="RulesLink"
40
43
  :apiKey="apiKey"
41
44
  @rulesClick="onRulesClick"
42
45
  />
@@ -57,6 +60,7 @@ import EventListCard from "../../Organisms/Cards/EventListCard/EventListCard.vue
57
60
  import BaseText from "../../Atoms/BaseText/BaseText.vue";
58
61
  import BaseButton from "../../Atoms/BaseButton/BaseButton.vue";
59
62
  import HostColumn from "../../Organisms/Column/HostColumn.vue";
63
+ import protrait1 from "../../../assets/images/portrait1.png";
60
64
 
61
65
  export default {
62
66
  name: 'TournamentDetailPage',
@@ -106,14 +110,56 @@ export default {
106
110
  },
107
111
  limitedTournaments() {
108
112
  return this.tournaments;
113
+ },
114
+ ClubLogo() {
115
+ return this.tournament?.Club?.Images?.[0]?.URL || this.defaultPortrait;
116
+ },
117
+ ContactName() {
118
+ return this.tournament.PrimaryContact.DisplayName === 'BYE' ? 'Contact Not Assigned' : this.tournament.PrimaryContact.DisplayName;
119
+ },
120
+ ContactImage() {
121
+ return this.tournament?.PrimaryContact?.Images?.[0]?.URL || this.defaultPortrait;
122
+ },
123
+ RulesLink() {
124
+ const rulesLink = this.tournament.SocialMedia.find(social => social.Type === 'Rules');
125
+ return rulesLink ? rulesLink.Link : '';
126
+ },
127
+ RegistrationLink() {
128
+ const registrationLink = this.tournament.SocialMedia.find(social => social.Type === 'Registration');
129
+ return registrationLink ? registrationLink.Link : '';
130
+ },
131
+ ShareLinks() {
132
+ const iconMap = {
133
+ Facebook: 'fa-facebook',
134
+ Instagram: 'fa-instagram',
135
+ Twitter: 'fa-twitter',
136
+ Discord: 'fa-discord',
137
+ YouTube: 'fa-youtube',
138
+ TikTok: 'fa-tiktok'
139
+ };
140
+
141
+ return this.tournament.SocialMedia
142
+ .filter(social => social.Type !== 'Rules' && social.Type !== 'Registration') // Exclude Rules and Registration
143
+ .map(social => {
144
+ return {
145
+ name: social.Type,
146
+ url: social.Link,
147
+ icon: iconMap[social.Type] || 'fa-link'
148
+ };
149
+ });
109
150
  }
110
151
  },
111
152
  data() {
112
- return {}
153
+ return {
154
+ defaultPortrait: protrait1
155
+ }
113
156
  },
114
157
  methods: {
115
158
  onRulesClick() {
116
- this.$emit('rules-click');
159
+ this.$emit('rules-click', this.RulesLink);
160
+ },
161
+ handleRegistrationClick() {
162
+ this.$emit('registration-click', this.RegistrationLink);
117
163
  }
118
164
  }
119
165
  }