-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: ✨ create group page #30
Changes from all commits
4eb315c
de5cf76
0d3e2ce
664cd77
19e1d01
61f2d7c
4477124
1b71e72
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<script lang="ts"> | ||
import { members } from "$lib/stores/groupStores"; | ||
</script> | ||
|
||
<div class="flex snap-x snap-mandatory gap-2 overflow-x-auto scroll-smooth md:gap-4"> | ||
{#each $members as member (member.id)} | ||
<a | ||
class="grid align-middle" | ||
href={member.profile_page} | ||
target="_blank" | ||
referrerpolicy="no-referrer" | ||
> | ||
<div | ||
class="card flex h-24 w-24 snap-start rounded-lg bg-cover bg-center px-2 md:h-40 md:w-40" | ||
style="background-image:url({member.profile_picture})" | ||
></div> | ||
<p | ||
class=" mt-auto line-clamp-2 max-h-12 text-left text-lg font-bold text-black hover:text-blue-500 md:text-xl" | ||
> | ||
@{member.username} | ||
</p> | ||
</a> | ||
{/each} | ||
</div> |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -2,15 +2,32 @@ | |||||
import { RadioGroup, RadioItem } from "@skeletonlabs/skeleton"; | ||||||
|
||||||
import { scheduledMeetings } from "$lib/stores/summaryStores"; | ||||||
import type { ScheduledMeeting } from "$lib/types/meetings"; | ||||||
import { | ||||||
convertIsoToWeekdayDate, | ||||||
convertTo12HourFormat, | ||||||
filterMeetingsByGroupID, | ||||||
groupAndSortScheduledMeetings, | ||||||
} from "$lib/utils/summary-helpers"; | ||||||
import LocationIcon from "~icons/material-symbols/location-on"; | ||||||
import ClockIcon from "~icons/material-symbols/nest-clock-farsight-analog-outline"; | ||||||
|
||||||
const sortedMeetings = groupAndSortScheduledMeetings($scheduledMeetings); | ||||||
export let groupID: number | undefined; | ||||||
// const modalStore = getModalStore(); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you remove the commented-out code? You can always go back to this PR and check the history if you want to refer to it in the future. |
||||||
|
||||||
const filtered = groupID | ||||||
? filterMeetingsByGroupID($scheduledMeetings, groupID) | ||||||
: $scheduledMeetings; | ||||||
const sortedMeetings = groupAndSortScheduledMeetings(filtered as ScheduledMeeting[]); | ||||||
|
||||||
// function modalComponentList(): void { | ||||||
// const modal: ModalSettings = { | ||||||
// type: "component", | ||||||
// component: "meetingUsers", | ||||||
// title: "Users Attending Meeting", | ||||||
// }; | ||||||
// modalStore.trigger(modal); | ||||||
// } | ||||||
</script> | ||||||
|
||||||
{#each Object.keys(sortedMeetings) as date} | ||||||
|
@@ -45,7 +62,7 @@ | |||||
</div> | ||||||
</div> | ||||||
|
||||||
<div class="flex w-full justify-center md:w-fit"> | ||||||
<div class="flex w-full justify-center md:w-fit" role="radiogroup" tabindex="0"> | ||||||
<RadioGroup | ||||||
class="flex h-fit w-fit items-center" | ||||||
active="variant-filled-primary" | ||||||
|
@@ -54,7 +71,7 @@ | |||||
<RadioItem bind:group={meeting.attending} name="justify" value={"Yes"} required | ||||||
>Yes</RadioItem | ||||||
> | ||||||
<RadioItem bind:group={meeting.attending} name="justify" value={"No"} required | ||||||
<RadioItem bind:group={meeting.attending} name="justify" value={"No"} required } | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
>No</RadioItem | ||||||
> | ||||||
<RadioItem bind:group={meeting.attending} name="justify" value={"Maybe"} required | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { writable } from "svelte/store"; | ||
|
||
import type { Member } from "$lib/types/members"; | ||
|
||
const exampleMembers: Member[] = [ | ||
{ | ||
id: "1", | ||
username: "georgeconstanza", | ||
email: "[email protected]", | ||
profile_picture: | ||
"https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?q=80&w=1287&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", | ||
profile_page: `/users/whodunit`, | ||
created_at: new Date(), | ||
}, | ||
{ | ||
id: "2", | ||
username: "randyalphari", | ||
email: "[email protected]", | ||
profile_picture: | ||
"https://images.unsplash.com/photo-1500648767791-00dcc994a43e?q=80&w=1287&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", | ||
profile_page: `/users/youserone`, | ||
created_at: new Date(), | ||
}, | ||
{ | ||
id: "3", | ||
username: "jamescohen", | ||
email: "[email protected]", | ||
profile_picture: | ||
"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?q=80&w=1160&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", | ||
profile_page: `/users/salaman`, | ||
created_at: new Date(), | ||
}, | ||
{ | ||
id: "4", | ||
username: "adamyoung", | ||
email: "[email protected]", | ||
profile_picture: | ||
"https://images.unsplash.com/photo-1633332755192-727a05c4013d?q=80&w=1160&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", | ||
profile_page: `/users/george42`, | ||
created_at: new Date(), | ||
}, | ||
{ | ||
id: "5", | ||
username: "davidli", | ||
email: "[email protected]", | ||
profile_picture: | ||
"https://images.unsplash.com/photo-1544168190-79c17527004f?q=80&w=1288&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", | ||
profile_page: `/users/ren2`, | ||
created_at: new Date(), | ||
}, | ||
{ | ||
id: "6", | ||
username: "christinej", | ||
email: "[email protected]", | ||
profile_picture: | ||
"https://images.unsplash.com/photo-1619895862022-09114b41f16f?q=80&w=1170&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", | ||
profile_page: `/users/chlo1`, | ||
created_at: new Date(), | ||
}, | ||
]; | ||
|
||
export const members = writable<Member[]>(exampleMembers); | ||
export const attendees = writable<Member[]>(exampleMembers); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is unused and should be deleted. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export type Member = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be called |
||
id: string; | ||
username: string; | ||
email: string; | ||
profile_picture: string; | ||
profile_page: string; | ||
created_at: Date; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,12 @@ export function groupAndSortScheduledMeetings(scheduledMeetings: ScheduledMeetin | |
return groupedMeetings; | ||
} | ||
|
||
export function filterMeetingsByGroupID( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please move this (and other relevant function(s)) to the component in which it's used, if it's only used in one. |
||
meetings: UnscheduledMeeting[] | ScheduledMeeting[], | ||
groupID: number, | ||
) { | ||
return meetings.filter((s) => s.groupID == groupID); | ||
} | ||
export function sortScheduledMeetingsByDateAndTime(scheduledMeetings: ScheduledMeeting[]) { | ||
return scheduledMeetings.sort((a, b) => { | ||
const dateComparison = a.date.localeCompare(b.date); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export function load({ params }) { | ||
const groupID = Number(params.groupID); | ||
|
||
return { groupID }; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<script lang="ts"> | ||
import { TabGroup, Tab } from "@skeletonlabs/skeleton"; | ||
|
||
import MembersList from "$lib/components/groups/MembersCarousel.svelte"; | ||
import ScheduledMeetingsList from "$lib/components/summary/ScheduledMeetingsList.svelte"; | ||
import UnscheduledMeetingsList from "$lib/components/summary/UnscheduledMeetingsList.svelte"; | ||
import { groups } from "$lib/stores/summaryStores"; | ||
|
||
export let data; | ||
const groupID = data.groupID; | ||
const group = $groups.find((g) => g.id === groupID)!; | ||
|
||
let tabSet: number = 0; | ||
</script> | ||
|
||
<div class="flex flex-col gap-8 px-4 pb-2 pt-6 md:px-32"> | ||
<div | ||
class="grid-rows-[100px_minmax(0, 1fr)] grid grid-cols-[120px_minmax(0,1fr)] content-start md:grid-cols-2 md:gap-4" | ||
> | ||
<img | ||
src={group.img} | ||
alt="A cute dog" | ||
class="row-start-1 row-end-2 h-24 w-24 object-cover object-center md:row-start-2 md:row-end-3 md:h-40 md:w-40 lg:h-64 lg:w-64" | ||
/> | ||
<h1 | ||
class="self-center overflow-visible text-3xl font-bold sm:col-start-2 sm:col-end-3 md:col-span-2 md:text-5xl lg:text-6xl" | ||
> | ||
{group.name} | ||
</h1> | ||
</div> | ||
|
||
<div class="flex flex-col gap-4"> | ||
<h1 class="border-surface-400-500-token border-b text-4xl font-bold">Members</h1> | ||
<MembersList /> | ||
</div> | ||
|
||
<div class="flex flex-col gap-4"> | ||
<TabGroup> | ||
<div class="flex w-full flex-col gap-x-10 gap-y-2"> | ||
<h1 class="text-4xl font-bold">Meetings</h1> | ||
<div class="flex justify-center gap-5"> | ||
<Tab bind:group={tabSet} name="scheduledTab" value={0}>Scheduled</Tab> | ||
<Tab bind:group={tabSet} name="unscheduledTab" value={1}>Unscheduled</Tab> | ||
</div> | ||
</div> | ||
|
||
<svelte:fragment slot="panel"> | ||
{#if tabSet === 0} | ||
<div class="flex flex-col gap-4"><ScheduledMeetingsList {groupID} /></div> | ||
{:else if tabSet === 1} | ||
<div class="flex flex-col gap-2"> | ||
<UnscheduledMeetingsList {groupID} /> | ||
</div> | ||
{/if} | ||
</svelte:fragment> | ||
</TabGroup> | ||
</div> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.