Skip to content

Commit

Permalink
refactor: ui updates from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
theClarkSell committed Nov 30, 2023
1 parent 01d0716 commit 7703b5f
Show file tree
Hide file tree
Showing 12 changed files with 214 additions and 120 deletions.
14 changes: 14 additions & 0 deletions src/_elements/buttons/ActionShell.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<div
class="focus:bg-thatBlue-300focus:text-white whitespace-nowrap rounded-md border-2
border-thatBlue-500 bg-thatBlue-500
px-8 py-2 text-base font-medium
leading-6 text-white
shadow transition duration-150 ease-in-out
hover:border-thatBlue-300
hover:bg-thatBlue-300 hover:text-white
md:px-10 md:text-lg
">
<div class="flex h-full w-full items-center justify-center">
<slot />
</div>
</div>
1 change: 1 addition & 0 deletions src/_elements/buttons/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ export { default as StandardShell } from './StandardShell.svelte';
export { default as Highlight } from './Highlight.svelte';
export { default as HighlightShell } from './HighlightShell.svelte';
export { default as DisabledShell } from './DisabledShell.svelte';
export { default as ActionShell } from './ActionShell.svelte';
4 changes: 2 additions & 2 deletions src/routes/(admin my)/my/_components/PageLayout.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<main class="relative flex-grow">
<div class="mx-auto max-w-7xl pb-12">
<main class="relative mb-24 mt-12 flex-grow">
<div class="mx-auto max-w-7xl">
<slot name="header" />

<div id="content-block" class="mt-12 rounded-lg bg-gray-100 px-5 py-6 shadow sm:px-6">
Expand Down
15 changes: 0 additions & 15 deletions src/routes/(admin my)/my/_elements/RowButton.svelte

This file was deleted.

27 changes: 17 additions & 10 deletions src/routes/(admin my)/my/_elements/ShareDetailsModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
import sharingSchema from '$lib/formSchemas/sharingForm';
import defaultConfig from '$lib/config.public';
import buildImageSrc from '$lib/image';
import RowButton from './RowButton.svelte';
import { Standard as StandardButton, ActionShell } from '$elements/buttons';
const dispatch = createEventDispatcher();
let { profileImage } = sharedWithMeProfile ?? {};
Expand Down Expand Up @@ -51,10 +52,10 @@
}
);
const stopSharingAction = () => {
function handleStopSharing() {
dispatch('stopSharing', rowIndex);
dispatch('closeDetail');
};
}
</script>
<div>
Expand Down Expand Up @@ -100,24 +101,30 @@
{/if}
<form use:enhance method="POST">
<div class="mt-4">
<label for="notes" class="block text-sm font-medium text-gray-500"
>Private notes</label>
<label for="notes" class="my-2 block text-sm font-medium text-gray-500"
>Your private notes:</label>
<textarea
name="notes"
id="notes"
bind:value={$form.notes}
type="text"
rows="6"
class="w-full rounded-md border-gray-500 p-2"
placeholder="We met at THAT Conference discussing..." />
placeholder="E.g. We met at THAT Conference discussing..." />
{#if $errors.notes}
<small class="max-md text-red-500">{$errors.notes}</small>
{/if}
</div>
<div class="mt-2 flex space-x-4">
<RowButton on:click={() => stopSharingAction()}>Stop Sharing</RowButton>
<RowButton disabled={$allErrors?.length > 0} type={'submit'}
>Update Notes</RowButton>
<div class="mt-2 flex flex-row-reverse space-x-4 space-x-reverse">
<button disabled={$allErrors?.length > 0} type="submit">
<ActionShell>Update Notes</ActionShell>
</button>
<StandardButton on:click={handleStopSharing}>
<div class="flex items-center space-x-4">
<span>Stop Sharing</span>
</div>
</StandardButton>
</div>
</form>
</div>
Expand Down
94 changes: 46 additions & 48 deletions src/routes/(admin my)/my/_elements/SharingRow.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
export let share;
import { createEventDispatcher } from 'svelte';
import RowButton from './RowButton.svelte';
import { Share2, Settings } from 'lucide-svelte';
import { Standard as StandardButton } from '$elements/buttons';
import ShareDetailsModal from './ShareDetailsModal.svelte';
const dispatch = createEventDispatcher();
let showDetailsModal = false;
let notes = share.meSharing?.notes ?? '';
let shareWithId = share.meSharing?.id ?? null;
Expand All @@ -33,60 +37,54 @@
on:closeDetail={() => (showDetailsModal = false)}
on:stopSharing={(event) => dispatch('stopSharing', event.detail)}></ShareDetailsModal>
{/if}
<div class="flex items-center px-4 py-4 sm:px-6">
<div class="flex min-w-0 flex-1 items-center">
<div class="min-w-0 flex-1 items-center px-4 md:grid md:grid-cols-2 md:gap-4">
<div>
{#if share.sharingWithMe}
<div class="flex items-center justify-between px-6 py-4">
<div class="grid w-full grid-cols-7 gap-4 px-4">
<div class="col-span-3">
{#if share.sharingWithMe}
<div>
<p class="truncate text-sm font-medium text-thatBlue-800">
{`${share.sharingWithMe.firstName} ${share.sharingWithMe.lastName}`}
</p>
<p class="mt-0 text-sm text-gray-500">{share.sharingWithMe.email}</p>
{:else}
</div>
{:else}
<div>
<p class="truncate text-sm font-medium text-thatBlue-800">Not sharing with you</p>
{/if}
</div>
<div class="mt-4 md:mt-0">
<div class="flex justify-start space-x-4">
{#if share.meSharing}
<div class="max-w-full">
<p class="truncate text-sm font-medium text-thatBlue-800">
{`${share.meSharing.firstName} ${
share.meSharing.lastName ?? share.meSharing.lastInitial
}`}
</p>
<p class="mt-0 truncate text-sm text-gray-500">
{notes}
</p>
</div>
{:else}
<div>
<p>
<RowButton on:click={() => dispatch('shareBack', rowIndex)}>Share Back</RowButton>
</p>
</div>
{/if}
</div>
<div class="col-span-3 ml-4">
{#if share.meSharing}
<div>
<p class="truncate text-sm font-medium text-thatBlue-800">
{`${share.meSharing.firstName} ${
share.meSharing.lastName ?? share.meSharing.lastInitial
}`}
</p>
<p class="truncate text-sm text-gray-500">
{notes}
</p>
</div>
{:else}
<div>
<StandardButton on:click={() => dispatch('shareBack', rowIndex)}>
<div class="flex items-center space-x-4">
<Share2 />
<span>Share Back</span>
</div>
{/if}
</StandardButton>
</div>
</div>
{/if}
</div>
<div class="flex place-self-center">
{#if share.meSharing}
<button
class="text-thatBlue-500 hover:text-thatBlue-300"
on:click={() => (showDetailsModal = true)}>
<Settings />
</button>
{/if}
</div>
</div>
<div>
<!-- Heroicon name: pencil-square -->
{#if share.meSharing}
<button on:click={() => (showDetailsModal = true)}>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
class="h-5 w-5 text-thatBlue-500 hover:text-thatOrange-500">
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10" />
</svg>
</button>
{/if}
</div>
</div>
82 changes: 75 additions & 7 deletions src/routes/(admin my)/my/member-sharing/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,14 +1,82 @@
<script>
import { Standard as StandardLink } from '$elements/links';
import seoMetaTags from '$lib/seo/metaTags';
import Seo from '$components/Seo.svelte';
import { events } from '$lib/config.public';
const metaTags = ((title = `Member Sharing - THAT Conference`) => ({
title,
tags: seoMetaTags({
title,
description: 'Helping you grow your network while at THAT Conference.',
openGraph: {
type: 'website',
url: `https://thatconference.com/my/member-sharing`
}
})
}))();
</script>

<div class="mx-auto max-w-md px-4 sm:px-6 lg:px-8">
<h1 class="mt-2 text-xl font-bold leading-6 text-thatBlue-800">THAT Contact Exchange</h1>
<p>Select an event</p>
<Seo title={metaTags.title} tags={metaTags.tags} />

<div class="relative overflow-x-hidden">
<div class="mx-auto mb-24 mt-12 max-w-screen-xl px-4 sm:px-6">
<header>
<h2 class="font-extrabold uppercase tracking-wider text-thatRed-500">My Network</h2>
<h1
class="text mb-8 mt-8 text-4xl font-bold leading-8 tracking-tight text-thatBlue-700 sm:text-5xl sm:leading-10">
Growing Your Network
</h1>

<p class="mt-6 text-2xl text-gray-500">
What good is going to a conference is you don't connect new people? THAT Conference is all
about community and helping one another grow. We've made it easy to connect with other
campers and sponsors.
</p>
</header>

<div class="relative py-12">
<div class="absolute inset-0 flex items-center" aria-hidden="true">
<div class="w-full border-t border-gray-300"></div>
</div>
</div>

<div class="mt-10 flex flex-col space-x-0 space-y-2 sm:flex-row sm:space-x-8 sm:space-y-0">
<StandardLink href="/my/member-sharing/{events.next.wi.id}">Wisconsin</StandardLink>
<StandardLink href="/my/member-sharing/{events.next.tx.id}">Texas</StandardLink>
<main class="flex flex-col lg:grid lg:grid-cols-7">
<div class="col-span-4 space-y-4">
<h2 class="text-xl font-bold leading-6 text-gray-900">Select An Event</h2>
<p class="prose mt-4">
Getting connected is as easy as using a campers pin number. Select the event you're
currently at, then enter the pin number of the person you want to connect with. Upon doing
so, your <a href="/my/profiles/shared">shared profile</a> will be sent to them where they have
the option to share back.
</p>

<div class="prose">
<a href="/my/network">View My Existing Connections</a>
</div>

<div class="flex flex-wrap pt-12">
<a href="/my/member-sharing/{events.next.wi.id}" class="anchorButton m-2 grow">
<div class="uppercase">THAT Conference Wisconsin</div>
</a>
<a href="/my/member-sharing/{events.next.tx.id}" class="anchorButton m-2 grow">
<div class="uppercase">THAT Conference Texas</div>
</a>
</div>
</div>
</main>
</div>
</div>

<style lang="postcss">
.anchorButton {
@apply rounded-md bg-thatBlue-500 px-4 py-4 text-center font-medium tracking-wide text-white shadow-md md:text-xl;
}
.anchorButton:hover {
@apply bg-thatBlue-400 transition duration-150 ease-in-out;
}
.anchorButton:focus {
@apply underline underline-offset-4;
}
</style>
10 changes: 5 additions & 5 deletions src/routes/(admin my)/my/member-sharing/[eventId]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@
<textarea
name="messageToShareWith"
type="textarea"
rows="4"
rows="5"
multiline={true}
bind:value={messageToShareWith}
class="form-input w-full rounded-md border border-gray-300 hover:border-gray-700 sm:text-sm sm:leading-5"
placeholder="Add a custom message along with the share notification. &#13;E.g. It was great meeting you at THAT, let's discus more about Sveltekit." />
placeholder="Add a custom message along with the share notification. &#13;&#13;E.g. It was great meeting you at THAT, let's discus more about Sveltekit." />
</div>

<div class="flex">
Expand All @@ -178,7 +178,7 @@
disabled={pinNumber.length < 1}
type="button"
class="w-full py-4 text-sm font-medium leading-5"
on:click={() => handleContactShare()}>
on:click={handleContactShare}>
<span class="text-lg">Connect</span>
</button>
</Shell>
Expand All @@ -188,11 +188,11 @@
<textarea
name="notes"
type="textarea"
rows="6"
rows="5"
multiline={true}
bind:value={privateNotes}
class="form-input w-full rounded-md border border-gray-300 hover:border-gray-700 sm:text-sm sm:leading-5"
placeholder="Add any private notes here. &#13;E.g. Great Sveltekit discussion with Jane." />
placeholder="Add any private notes here. &#13;&#13;E.g. Great Sveltekit discussion with Jane." />
</div>
</div>
{/if}
Expand Down
Loading

0 comments on commit 7703b5f

Please sign in to comment.