* add team profile * first version for team members page * finish up design of member list item * fix dialog buttons * add missing seats and upgrading information * add v2 dialog for changing role * finish basic version of member's schedule * remove modalContainer * design fixes team profile page * show only team info to non admins * allow all member to check availabilities * make time available heading sticky * add dropdown for mobile view * create team appearance view * finish appearance page * use settings layout and add danger zone for member * add fallback logo * Add teams to sidebar and fix UI * add team invitations * Clean up * code clean up * add impersontation and disable autofocus on calendar * improve team info * refactor teaminvitelist code and fix leaving a team * add team pages to settings shell * add link to create new team * small fixes * clean up comments * V2 Multi-select (Team Select) (#4324) * --init * design improved * further fine tuning * more fixes * removed extra JSX tag * added story * NIT * revert to use of CheckedTeamSelect * Removes comments Co-authored-by: Peer Richelsen <peeroke@gmail.com> * fix: toggle alligment (#4361) * fix: add checked tranform for switch (#4357) * fixed input size on mobile, fixed settings (#4360) * fix image uploader button in safari * code clean up * fixing type errors * Moved v2 team components to features Adds deprecation notices * Update SettingsLayout.tsx * Migrated to features and build fixes Co-authored-by: CarinaWolli <wollencarina@gmail.com> Co-authored-by: Joe Au-Yeung <j.auyeung419@gmail.com> Co-authored-by: Syed Ali Shahbaz <52925846+alishaz-polymath@users.noreply.github.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com> Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com> Co-authored-by: zomars <zomars@me.com>
38 lines
1.3 KiB
TypeScript
38 lines
1.3 KiB
TypeScript
import { MembershipRole } from "@prisma/client";
|
|
import classNames from "classnames";
|
|
|
|
import { useLocale } from "@lib/hooks/useLocale";
|
|
|
|
type PillColor = "blue" | "green" | "red" | "yellow";
|
|
|
|
interface Props {
|
|
text: string;
|
|
color?: PillColor;
|
|
}
|
|
|
|
/** @deprecated Use `packages/features/ee/teams/components/TeamPill.tsx` */
|
|
export default function TeamPill(props: Props) {
|
|
return (
|
|
<div
|
|
className={classNames("self-center rounded-md border px-3 py-1 text-xs capitalize ltr:mr-2 rtl:ml-2", {
|
|
"border-gray-200 bg-gray-50 text-gray-700": !props.color,
|
|
"border-blue-200 bg-blue-50 text-blue-700": props.color === "blue",
|
|
"border-red-200 bg-red-50 text-red-700": props.color === "red",
|
|
"border-yellow-200 bg-yellow-50 text-yellow-700": props.color === "yellow",
|
|
"border-green-200 bg-green-50 text-green-600": props.color === "green",
|
|
})}>
|
|
{props.text}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export function TeamRole(props: { role: MembershipRole }) {
|
|
const { t } = useLocale();
|
|
const keys: Record<MembershipRole, PillColor | undefined> = {
|
|
[MembershipRole.OWNER]: undefined,
|
|
[MembershipRole.ADMIN]: "red",
|
|
[MembershipRole.MEMBER]: "blue",
|
|
};
|
|
return <TeamPill text={t(props.role.toLowerCase())} color={keys[props.role]} />;
|
|
}
|