Fix: Position of the "Add" button (#6110)

Fixes https://github.com/calcom/cal.com/issues/6104
pull/6111/head
Nafees Nazik 2022-12-19 23:23:46 +05:30 committed by GitHub
parent 795574ef88
commit 533e208643
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 15 deletions

View File

@ -46,7 +46,25 @@ const MembersView = () => {
return (
<>
<Meta title={t("team_members")} description={t("members_team_description")} />
<Meta
title={t("team_members")}
description={t("members_team_description")}
CTA={
isAdmin ? (
<Button
type="button"
color="primary"
StartIcon={Icon.FiPlus}
className="ml-auto"
onClick={() => setShowMemberInvitationModal(true)}
data-testid="new-member-button">
{t("add")}
</Button>
) : (
<></>
)
}
/>
{!isLoading && (
<>
<div>
@ -68,19 +86,6 @@ const MembersView = () => {
)}
</>
)}
{isAdmin && (
<div className="relative mb-5 flex w-full items-center ">
<Button
type="button"
color="primary"
StartIcon={Icon.FiPlus}
className="ml-auto"
onClick={() => setShowMemberInvitationModal(true)}
data-testid="new-member-button">
{t("add")}
</Button>
</div>
)}
<div>
<ul className="divide-y divide-gray-200 rounded-md border ">
{team?.members.map((member) => {

View File

@ -46,7 +46,7 @@ export default function Meta({ title, description, backButton, CTA }: MetaType)
/* @TODO: maybe find a way to have this data on first render to prevent flicker */
useEffect(() => {
if (meta.title !== title || meta.description !== description) {
if (meta.title !== title || meta.description !== description || meta.CTA !== CTA) {
setMeta({ title, description, backButton, CTA });
}
// eslint-disable-next-line react-hooks/exhaustive-deps