Skip to content

Commit 5db0927

Browse files
committed
cloud: add disabled signup button
1 parent 8259eac commit 5db0927

File tree

2 files changed

+58
-7
lines changed

2 files changed

+58
-7
lines changed

assets/css/app.css

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,3 +252,42 @@
252252
@apply bg-background text-foreground;
253253
}
254254
}
255+
256+
@layer utilities {
257+
.tooltip {
258+
position: relative;
259+
}
260+
261+
.tooltip:hover::after {
262+
content: attr(data-tooltip);
263+
position: absolute;
264+
bottom: calc(100% + 8px);
265+
left: 50%;
266+
transform: translateX(-50%);
267+
background-color: white;
268+
color: #374151;
269+
border: 1px solid #d1d5db;
270+
padding: 8px 12px;
271+
border-radius: 3px;
272+
font-size: 14px;
273+
font-weight: 500;
274+
white-space: nowrap;
275+
z-index: 1000;
276+
pointer-events: none;
277+
box-shadow:
278+
0 4px 6px -1px rgba(0, 0, 0, 0.1),
279+
0 2px 4px -1px rgba(0, 0, 0, 0.06);
280+
}
281+
282+
.tooltip:hover::before {
283+
content: "";
284+
position: absolute;
285+
bottom: calc(100% + 2px);
286+
left: 50%;
287+
transform: translateX(-50%);
288+
border: 6px solid transparent;
289+
border-top-color: #d1d5db;
290+
z-index: 1000;
291+
pointer-events: none;
292+
}
293+
}

lib/sequin_web/live/user_login_live.ex

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,24 @@ defmodule SequinWeb.UserLoginLive do
9898
</.simple_form>
9999
</div>
100100
101-
<%= if @account_self_signup? do %>
102-
<p class="mt-6 text-center text-sm">
103-
Don't have an account?
104-
<.link navigate={~p"/register"} class="font-semibold text-brand hover:underline">
105-
Sign up
106-
</.link>
107-
</p>
101+
<%= cond do %>
102+
<% @account_self_signup? -> %>
103+
<p class="mt-6 text-center text-sm">
104+
Don't have an account?
105+
<.link navigate={~p"/register"} class="font-semibold text-brand hover:underline">
106+
Sign up
107+
</.link>
108+
</p>
109+
<% not @account_self_signup? and not @self_hosted -> %>
110+
<p class="mt-6 text-center text-sm">
111+
<.button
112+
disabled
113+
data-tooltip="Signups for Sequin Cloud are disabled."
114+
class="w-full !bg-gray-400 hover:bg-gray-300 cursor-not-allowed tooltip"
115+
>
116+
Sign up
117+
</.button>
118+
</p>
108119
<% end %>
109120
</div>
110121
</div>
@@ -135,6 +146,7 @@ defmodule SequinWeb.UserLoginLive do
135146
|> assign(accepting_invite?: accepting_invite?(session))
136147
|> assign(accepting_team_invite?: accepting_team_invite?(session))
137148
|> assign(account_self_signup?: accepting_team_invite?(session) || Sequin.feature_enabled?(:account_self_signup))
149+
|> assign(self_hosted: Application.fetch_env!(:sequin, :self_hosted))
138150
|> assign(display_default_user_login?: Sequin.Accounts.only_default_user_and_first_login?())
139151

140152
{:ok, socket, temporary_assigns: [form: form]}

0 commit comments

Comments
 (0)