minor style changes to team pages (#639)
* minor style changes to team pages * more minor changes to team dashboard, added badge variant = gray * added border to dropdown and removed blue focus ring on hover
This commit is contained in:
1 parent
47b6e29333
commit
52e3b78875
8 files changed
+220
-41
No files matched your search
@@ -36,6 +36,7 @@ import createEventType from "@lib/mutations/event-types/create-event-type";
|
||||
import { HttpError } from "@lib/core/http/error";
|
||||
import { asStringOrNull } from "@lib/asStringOrNull";
|
||||
import AvatarGroup from "@components/ui/AvatarGroup";
|
||||
import Badge from "@components/ui/Badge";
|
||||
|
||||
const EventTypesPage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
const CreateFirstEventTypeView = () => (
|
||||
@@ -53,18 +54,31 @@ const EventTypesPage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
);
|
||||
|
||||
const EventTypeListHeading = ({ profile, membershipCount }) => (
|
||||
<div className="flex mb-3">
|
||||
<Avatar displayName={profile.name} imageSrc={profile.image} size="8" className="mt-1 inline mr-2" />
|
||||
<div className="flex mb-4">
|
||||
<Link href="/settings/teams">
|
||||
<a>
|
||||
<Avatar displayName={profile.name} imageSrc={profile.image} size={8} className="mt-1 inline mr-2" />
|
||||
</a>
|
||||
</Link>
|
||||
<div>
|
||||
<span className="font-bold">{profile.name}</span>
|
||||
<Link href="/settings/teams">
|
||||
<a className="font-bold">{profile.name}</a>
|
||||
</Link>
|
||||
{membershipCount && (
|
||||
<span className="text-neutral-500 ml-2">
|
||||
<UsersIcon className="w-4 h-4 inline" /> {membershipCount}
|
||||
<span className="text-xs text-neutral-500 ml-2 -top-px relative">
|
||||
<Link href="/settings/teams">
|
||||
<a>
|
||||
<Badge variant="gray">
|
||||
<UsersIcon className="w-3 h-3 inline -mt-px mr-1" />
|
||||
{membershipCount}
|
||||
</Badge>
|
||||
</a>
|
||||
</Link>
|
||||
</span>
|
||||
)}
|
||||
{typeof window !== "undefined" && (
|
||||
<Link href={profile.slug}>
|
||||
<a className="block text-neutral-500 leading-none">{`${window.location.host}/${profile.slug}`}</a>
|
||||
<a className="block text-xs text-neutral-500">{`${window.location.host}/${profile.slug}`}</a>
|
||||
</Link>
|
||||
)}
|
||||
</div>
|
||||
@@ -80,7 +94,7 @@ const EventTypesPage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
readOnly: boolean;
|
||||
types: EventType[];
|
||||
}) => (
|
||||
<div className="bg-white border border-gray-200 rounded-sm overflow-hidden -mx-4 sm:mx-0 mb-4">
|
||||
<div className="bg-white border border-gray-200 rounded-sm overflow-hidden -mx-4 sm:mx-0 mb-16">
|
||||
<ul className="divide-y divide-neutral-200" data-testid="event-types">
|
||||
{types.map((type) => (
|
||||
<li
|
||||
@@ -330,7 +344,7 @@ const CreateNewEventDialog = ({ profiles, canAddEvents }) => {
|
||||
{profiles.map((profile) => (
|
||||
<DropdownMenu.Item
|
||||
key={profile.slug}
|
||||
className="px-3 py-2 cursor-pointer hover:bg-neutral-100"
|
||||
className="px-3 py-2 cursor-pointer hover:bg-neutral-100 focus:outline-none"
|
||||
onSelect={() =>
|
||||
router.push({
|
||||
pathname: router.pathname,
|
||||
|
||||
+32
-15
@@ -12,6 +12,7 @@ import EventTypeDescription from "@components/eventtype/EventTypeDescription";
|
||||
import Team from "@components/team/screens/Team";
|
||||
import { useToggleQuery } from "@lib/hooks/useToggleQuery";
|
||||
import AvatarGroup from "@components/ui/AvatarGroup";
|
||||
import Button from "@components/ui/Button";
|
||||
|
||||
function TeamPage({ team }: InferGetServerSidePropsType<typeof getServerSideProps>) {
|
||||
const { isReady } = useTheme();
|
||||
@@ -25,20 +26,22 @@ function TeamPage({ team }: InferGetServerSidePropsType<typeof getServerSideProp
|
||||
className="group relative dark:bg-neutral-900 dark:border-0 dark:hover:border-neutral-600 bg-white hover:bg-gray-50 border border-neutral-200 hover:border-black rounded-sm">
|
||||
<ArrowRightIcon className="absolute transition-opacity h-4 w-4 right-3 top-3 text-black dark:text-white opacity-0 group-hover:opacity-100" />
|
||||
<Link href={`${team.slug}/${type.slug}`}>
|
||||
<a className="block px-6 py-4 flex space-x-2 items-center">
|
||||
<a className="px-6 py-4 flex justify-between">
|
||||
<div className="flex-shrink">
|
||||
<h2 className="font-semibold text-neutral-900 dark:text-white">{type.title}</h2>
|
||||
<EventTypeDescription className="text-sm" eventType={type} />
|
||||
</div>
|
||||
<AvatarGroup
|
||||
truncateAfter={4}
|
||||
className="flex-shrink-0"
|
||||
size={10}
|
||||
items={type.users.map((user) => ({
|
||||
alt: user.name,
|
||||
image: user.avatar,
|
||||
}))}
|
||||
/>
|
||||
<div className="mt-1">
|
||||
<AvatarGroup
|
||||
truncateAfter={4}
|
||||
className="flex-shrink-0"
|
||||
size={10}
|
||||
items={type.users.map((user) => ({
|
||||
alt: user.name,
|
||||
image: user.avatar,
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
</a>
|
||||
</Link>
|
||||
</li>
|
||||
@@ -63,12 +66,26 @@ function TeamPage({ team }: InferGetServerSidePropsType<typeof getServerSideProp
|
||||
{!showMembers.isOn && team.eventTypes.length && (
|
||||
<div className="mx-auto max-w-3xl">
|
||||
{eventTypes}
|
||||
|
||||
<div className="relative mt-12">
|
||||
<div className="absolute inset-0 flex items-center" aria-hidden="true">
|
||||
<div className="w-full border-t border-gray-200 dark:border-gray-900" />
|
||||
</div>
|
||||
<div className="relative flex justify-center">
|
||||
<span className="px-2 bg-gray-100 text-sm text-gray-500 dark:bg-black dark:text-gray-500">
|
||||
OR
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<aside className="text-center dark:text-white mt-8">
|
||||
<Link href={`/team/${team.slug}?members=1`} shallow={true}>
|
||||
<a>
|
||||
Book a team member <ArrowRightIcon className="h-6 w-6 inline text-neutral-500" />
|
||||
</a>
|
||||
</Link>
|
||||
<Button
|
||||
color="secondary"
|
||||
EndIcon={ArrowRightIcon}
|
||||
href={`/team/${team.slug}?members=1`}
|
||||
shallow={true}>
|
||||
Book a team member instead
|
||||
</Button>
|
||||
</aside>
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user