Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore: update Member invite to be more accessible

Jonathan Summers-Muir5b6890496c65
diff --git a/studio/components/interfaces/Authentication/Users/InviteUserModal.tsx b/studio/components/interfaces/Authentication/Users/InviteUserModal.tsx
index f3d27cbd51b..23185950f55 100644
--- a/studio/components/interfaces/Authentication/Users/InviteUserModal.tsx
+++ b/studio/components/interfaces/Authentication/Users/InviteUserModal.tsx
@@ -72,29 +72,35 @@ const InviteUserModal = () => {
size="small"
key="invite-user-modal"
visible={visible}
- title="Invite new user"
+ header="Invite new user"
hideFooter
onCancel={handleToggle}
closable
>
- <Input
- label="User email"
- icon={<IconMail />}
- autoFocus
- // @ts-ignore
- ref={inputRef}
- value={emailValue}
- onChange={onInputChange}
- type="text"
- name="email"
- id="email"
- placeholder="User email"
- className="w-full"
- />
-
- <Button onClick={onInviteUser} loading={loading} disabled={loading} block>
- Invite user
- </Button>
+ <div className="py-4 space-y-6">
+ <Modal.Content>
+ <Input
+ label="User email"
+ icon={<IconMail />}
+ descriptionText="Type in the full email address"
+ autoFocus
+ // @ts-ignore
+ ref={inputRef}
+ value={emailValue}
+ onChange={onInputChange}
+ type="email"
+ name="email"
+ id="email"
+ placeholder="User email"
+ className="w-full"
+ />
+ </Modal.Content>
+ <Modal.Content>
+ <Button onClick={onInviteUser} size="small" loading={loading} disabled={loading} block>
+ Invite user
+ </Button>
+ </Modal.Content>
+ </div>
</Modal>
</div>
)
diff --git a/studio/components/interfaces/Billing/Subscription/UpgradeButton.tsx b/studio/components/interfaces/Billing/Subscription/UpgradeButton.tsx
index 4fcce39815d..6c0a12b12f9 100644
--- a/studio/components/interfaces/Billing/Subscription/UpgradeButton.tsx
+++ b/studio/components/interfaces/Billing/Subscription/UpgradeButton.tsx
@@ -55,7 +55,7 @@ const UpgradeButton: FC<Props> = ({ projectRef, paid, subscriptionStats }) => {
function handleUpgradeButton() {
if (paid) {
- if (freeProjectsOwned >= freeProjectsLimit) {
+ if (freeProjectsOwned >= DEFAULT_FREE_PROJECTS_LIMIT) {
setShowFreeProjectLimitWarning(true)
} else {
setExitSurveyVisible(true)
@@ -76,7 +76,7 @@ const UpgradeButton: FC<Props> = ({ projectRef, paid, subscriptionStats }) => {
closable
visible={showFreeProjectLimitWarning}
onCancel={() => setShowFreeProjectLimitWarning(false)}
- title="Free project limit reached"
+ header="Free project limit reached"
description="Please delete one of your free projects to downgrade this project back to free tier"
size="tiny"
showIcon
@@ -92,7 +92,13 @@ const UpgradeButton: FC<Props> = ({ projectRef, paid, subscriptionStats }) => {
</Button>
</div>
}
- />
+ >
+ <Modal.Content>
+ <p className="text-sm text-scale-1100 py-4">
+ Please delete one of your free projects to downgrade this project back to free tier
+ </p>
+ </Modal.Content>
+ </Modal>
<div className="flex flex-col items-end space-y-2">
<Button
disabled={!isOrgOwner}
@@ -158,6 +164,7 @@ function UnsubcribeExitSurvey({ visible, setVisible, handleDowngrade }: any) {
return (
<Modal
+ header="Reason for cancelling"
loading={loading}
visible={visible}
closable
@@ -165,23 +172,24 @@ function UnsubcribeExitSurvey({ visible, setVisible, handleDowngrade }: any) {
hideFooter
onCancel={() => setVisible(false)}
>
- <div>
- <div className="px-6 pb-4">
- <Typography.Title level={3} className="m-0">
- Reason for cancelling
- </Typography.Title>
- </div>
- <Divider light />
- <div className="px-6 py-4 space-y-4">
- <Typography.Text type="secondary" className="mb-2">
- <p>We always strive to improve Supabase as much as we can.</p>
- </Typography.Text>
- <Typography.Text type="secondary">
- <p>
- please let us know the reasons you are cancelling your subscription so we can improve
- in the future.
- </p>
- </Typography.Text>
+ <div className="py-4 space-y-4">
+ <Modal.Content>
+ <div className="">
+ <div>
+ <p className="text-base text-scale-1200">
+ <p>We always strive to improve Supabase as much as we can.</p>
+ </p>
+ <p className="text-sm text-scale-1100">
+ <p>
+ please let us know the reasons you are cancelling your subscription so we can
+ improve in the future.
+ </p>
+ </p>
+ </div>
+ </div>
+ </Modal.Content>
+ <Modal.Seperator />
+ <Modal.Content>
<div className="flex flex-wrap gap-2" data-toggle="buttons">
{CancellationReasons.map((option) => {
const active = selectedCancellationReasons.find((x) => x === option)
@@ -194,8 +202,8 @@ function UnsubcribeExitSurvey({ visible, setVisible, handleDowngrade }: any) {
duration-100 cursor-pointer text-sm
${
active
- ? ` opacity-100 bg-white text-typography-body-light hover:bg-opacity-75`
- : ` bg-gray-500 opacity-25 hover:opacity-50 text-typography-body-dark`
+ ? ` opacity-100 bg-white text-scale-100 hover:bg-opacity-75`
+ : ` bg-scale-1200 opacity-25 hover:opacity-50 text-scale-100`
}
`}
>
@@ -211,9 +219,9 @@ function UnsubcribeExitSurvey({ visible, setVisible, handleDowngrade }: any) {
)
})}
</div>
- </div>
- <Divider light />
- <div className="px-6 py-4 space-y-4">
+ </Modal.Content>
+ <Modal.Seperator />
+ <Modal.Content>
<Input.TextArea
id="feedback"
onChange={(e) => setAdditionalFeedback(e.target.value)}
@@ -221,9 +229,9 @@ function UnsubcribeExitSurvey({ visible, setVisible, handleDowngrade }: any) {
label="Anything else we can improve on?"
placeholder="Anything else we should know, or could improve on?"
/>
- </div>
- <Divider light />
- <div className="flex justify-end px-6 py-6 w-full space-x-2">
+ </Modal.Content>
+ <Modal.Seperator />
+ <div className="flex gap-2 justify-end px-6 w-full">
<Button type="default" onClick={() => setVisible(false)}>
Cancel
</Button>
diff --git a/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.tsx b/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.tsx
index 0cddda4b493..2efd9fe712d 100644
--- a/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.tsx
+++ b/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.tsx
@@ -260,7 +260,7 @@ const SidePanelEditor: FC<Props> = ({
/>
<ConfirmationModal
visible={isClosingPanel}
- title="Confirm to close"
+ header="Confirm to close"
buttonLabel="Confirm"
onSelectCancel={() => setIsClosingPanel(false)}
onSelectConfirm={() => {
diff --git a/studio/components/to-be-cleaned/ModalsDeprecated/InviteMemberModal.js b/studio/components/to-be-cleaned/ModalsDeprecated/InviteMemberModal.js
index 3658d226002..2540a49ed6c 100644
--- a/studio/components/to-be-cleaned/ModalsDeprecated/InviteMemberModal.js
+++ b/studio/components/to-be-cleaned/ModalsDeprecated/InviteMemberModal.js
@@ -95,26 +95,30 @@ function InviteMemberModal({ organization, members = [] }) {
icon={<IconKey size="xlarge" background="brand" />}
visible={isOpen}
onCancel={toggle}
- title="Invite a member to organization"
+ header="Invite a member to organization"
description="Members you'd like to invite must already be registered on Supabase"
layout="vertical"
hideFooter
>
- <div className="w-full">
- <div className="mt-3 text-center sm:mt-5">
- <InputSearchWithResults className="mt-2" />
- </div>
-
- <div className="mt-5">
- <Button
- onClick={addMember}
- loading={PageState.addMemberLoading}
- disabled={PageState.addBtnDisable}
- block
- >
- {PageState.addBtnText}
- </Button>
- </div>
+ <div className="w-full py-4 space-y-4">
+ <Modal.Content>
+ <div className="text-center">
+ <InputSearchWithResults className="" />
+ </div>
+ </Modal.Content>
+ <Modal.Seperator />
+ <Modal.Content>
+ <div className="">
+ <Button
+ onClick={addMember}
+ loading={PageState.addMemberLoading}
+ disabled={PageState.addBtnDisable}
+ block
+ >
+ {PageState.addBtnText}
+ </Button>
+ </div>
+ </Modal.Content>
</div>
</Modal>
</PageContext.Provider>
@@ -171,25 +175,25 @@ const InputSearchWithResults = observer(({ className }) => {
}`
return (
<div className={className}>
- <div className="flex px-6 py-4 rounded-md bg-green-100">
+ <div className="flex px-6 py-2 items-center rounded bg-scale-400 border">
<div className="flex-grow text-left">
- <p className="text-green-800 leading-6 font-medium">
- {PageState.selectedProfile.username}
- </p>
- <p className="text-sm leading-5 text-green-800">
+ <p className="text-scale-1200 font-medium">{PageState.selectedProfile.username}</p>
+ <p className="text-sm leading-5 text-scale-1100">
{fullName !== ' ' ? `${fullName} • Invite collaborator` : 'Invite collaborator'}
</p>
</div>
- <div className="m-auto">
- <button className="text-green-500 hover:text-green-900">
- <IconX strokeWidth={1} onClick={reset} />
- </button>
- </div>
+ <button className="text-scale-900 hover:text-scale-1200">
+ <IconX strokeWidth={2} onClick={reset} />
+ </button>
</div>
</div>
)
}
+ const onSelectDropdownOption = (e, option) => {
+ if (!option.isMember) PageState.selectedProfile = option
+ }
+
return (
<div className={className}>
<div className="relative rounded-md shadow-sm">
@@ -201,13 +205,55 @@ const InputSearchWithResults = observer(({ className }) => {
className="form-input"
onChange={onInputChange}
autoComplete="off"
+ value={PageState.keywords}
placeholder="search by username or email"
/>
<div className="absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none">
{loading && <IconLoader className="animate-spin" size={16} />}
</div>
</div>
- <ProfileDropdown className="relative w-full mt-1 z-10" />
+ {PageState.profiles && PageState.profiles.length !== 0 ? (
+ <>
+ <div className="flex flex-col gap-1 py-4">
+ {PageState.profiles.map((profile, i) => {
+ const { first_name, last_name, username, isMember } = profile
+ const fullName = `${first_name || ''} ${last_name || ''}`
+ let subText = isMember ? 'Already in this organization' : 'Invite collaborator'
+ if (fullName !== ' ') subText = `${fullName} • ${subText}`
+ return (
+ <Button
+ block
+ key={`option_${i}`}
+ className={`px-3 py-1 ${
+ isMember
+ ? 'cursor-not-allowed opacity-50'
+ : 'cursor-pointer hover:bg-bg-alt-light dark:hover:bg-bg-alt-dark'
+ } first:rounded-t-md last:rounded-b-md`}
+ onClick={(e) => onSelectDropdownOption(e, profile)}
+ type="default"
+ style={{ justifyContent: 'flex-start' }}
+ size="medium"
+ >
+ <div className="flex items-center gap-2">
+ <span className="block truncate">{username}</span>
+ <span className="text-scale-900 block truncate" type="secondary">
+ {subText}
+ </span>
+ </div>
+ </Button>
+ )
+ })}
+ </div>
+ </>
+ ) : PageState.profiles &&
+ PageState.profiles.length === 0 &&
+ !loading &&
+ PageState.keywords ? (
+ <>
+ <p className="text-sm text-scale-1200 mt-4">Could not find account.</p>
+ <p className="text-sm text-scale-1100">Has the user already signed up?</p>
+ </>
+ ) : null}
</div>
)
})
@@ -231,7 +277,7 @@ const ProfileDropdown = observer(({ className }) => {
leaveFrom="transform opacity-100 scale-100"
leaveTo="transform opacity-0 scale-95"
>
- <div className="origin-top-right absolute w-full max-h-48 rounded-md shadow-lg overflow-y-auto">
+ <div className="origin-top-right w-full max-h-48 rounded-md shadow-lg overflow-y-auto z-100 fixed">
<div className="rounded-md bg-white dark:bg-gray-800 ring-1 ring-black ring-opacity-5 text-left">
<div
className="py-1"