Skip to content

Commit ec1cec5

Browse files
authored
Centering account pages and making them consistent (#1799)
* Small updates to the Settings page * Remove max-w-md from Members page * Removing max width from Profile page
1 parent 7b862b9 commit ec1cec5

File tree

3 files changed

+44
-28
lines changed
  • apps/webapp/app/routes

3 files changed

+44
-28
lines changed

apps/webapp/app/routes/_app.orgs.$organizationSlug.settings._index/route.tsx

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { Button } from "~/components/primitives/Buttons";
3131
import { Fieldset } from "~/components/primitives/Fieldset";
3232
import { FormButtons } from "~/components/primitives/FormButtons";
3333
import { FormError } from "~/components/primitives/FormError";
34-
import { Header2 } from "~/components/primitives/Headers";
34+
import { Header2, Header3 } from "~/components/primitives/Headers";
3535
import { Hint } from "~/components/primitives/Hint";
3636
import { Input } from "~/components/primitives/Input";
3737
import { InputGroup } from "~/components/primitives/InputGroup";
@@ -171,7 +171,7 @@ export const action: ActionFunction = async ({ request, params }) => {
171171
});
172172

173173
return redirectWithSuccessMessage(
174-
organizationPath({ slug: organizationSlug }),
174+
organizationSettingsPath({ slug: organizationSlug }),
175175
request,
176176
`Organization renamed to ${submission.value.organizationName}`
177177
);
@@ -226,7 +226,7 @@ export const action: ActionFunction = async ({ request, params }) => {
226226
return redirectWithSuccessMessage(
227227
organizationSettingsPath({ slug: organizationSlug }),
228228
request,
229-
`Updated logo`
229+
`Updated icon`
230230
);
231231
}
232232
}
@@ -286,17 +286,20 @@ export default function Page() {
286286

287287
<PageBody>
288288
<MainHorizontallyCenteredContainer>
289-
<div className="flex flex-col gap-4">
289+
<div className="mb-3 border-b border-grid-dimmed pb-3">
290+
<Header2>Settings</Header2>
291+
</div>
292+
<div className="flex flex-col gap-6">
290293
<div>
291294
<LogoForm organization={organization} />
292295
</div>
293296

294297
<div>
295298
<Form method="post" {...renameForm.props}>
296299
<input type="hidden" name="action" value="rename" />
297-
<Fieldset>
300+
<Fieldset className="gap-y-0">
298301
<InputGroup fullWidth>
299-
<Label htmlFor={organizationName.id}>Rename your organization</Label>
302+
<Label htmlFor={organizationName.id}>Organization name</Label>
300303
<Input
301304
{...conform.input(organizationName, { type: "text" })}
302305
defaultValue={organization.title}
@@ -310,13 +313,14 @@ export default function Page() {
310313
confirmButton={
311314
<Button
312315
type="submit"
313-
variant={"primary/small"}
316+
variant={"secondary/small"}
314317
disabled={isRenameLoading}
315318
LeadingIcon={isRenameLoading ? SpinnerWhite : undefined}
316319
>
317320
Rename organization
318321
</Button>
319322
}
323+
className="border-t-0"
320324
/>
321325
</Fieldset>
322326
</Form>
@@ -327,7 +331,7 @@ export default function Page() {
327331
<Form
328332
method="post"
329333
{...deleteForm.props}
330-
className="max-w-md rounded-sm border border-rose-500/40"
334+
className="w-full rounded-sm border border-rose-500/40"
331335
>
332336
<input type="hidden" name="action" value="delete" />
333337
<Fieldset className="p-4">
@@ -384,10 +388,10 @@ function LogoForm({ organization }: { organization: { avatar: Avatar } }) {
384388

385389
return (
386390
<Fieldset>
387-
<InputGroup>
388-
<Label>Logo</Label>
389-
<div className="flex items-end gap-2">
390-
<div className="grid size-20 place-items-center overflow-hidden rounded-sm border border-charcoal-700 bg-charcoal-850">
391+
<InputGroup fullWidth>
392+
<Label>Icon</Label>
393+
<div className="flex w-full items-end justify-between gap-2">
394+
<div className="grid place-items-center overflow-hidden rounded-sm border border-charcoal-750 bg-background-bright">
391395
<Avatar avatar={avatar} className="size-20" includePadding />
392396
</div>
393397
{/* Letters */}

apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.team/route.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,18 @@ export default function Page() {
164164
<PageBody>
165165
<MainHorizontallyCenteredContainer>
166166
<Header2>
167-
Members ({limits.used}/{limits.limit})
167+
Members{" "}
168+
<span className="font-normal text-text-dimmed">
169+
({limits.used}/{limits.limit})
170+
</span>
168171
</Header2>
169-
<ul className="divide-ui-border flex w-full max-w-md flex-col divide-y border-b border-grid-bright">
172+
<ul className="divide-ui-border mt-3 flex w-full flex-col divide-y border-y border-grid-bright">
170173
{members.map((member) => (
171174
<li key={member.user.id} className="flex items-center gap-x-4 py-4">
172175
<UserAvatar
173176
avatarUrl={member.user.avatarUrl}
174177
name={member.user.name}
175-
className="h-10 w-10"
178+
className="size-10"
176179
/>
177180
<div className="flex flex-col gap-0.5">
178181
<Header3>
@@ -194,8 +197,8 @@ export default function Page() {
194197

195198
{invites.length > 0 && (
196199
<>
197-
<Header2 className="mt-4">Pending invites</Header2>
198-
<ul className="flex w-full max-w-md flex-col divide-y divide-charcoal-800 border-b border-charcoal-800">
200+
<Header2 className="mb-3 mt-4">Pending invites</Header2>
201+
<ul className="flex w-full flex-col divide-y divide-charcoal-800 border-b border-grid-bright">
199202
{invites.map((invite) => (
200203
<li key={invite.id} className="flex items-center gap-4 py-4">
201204
<div className="rounded-md border border-charcoal-750 bg-charcoal-800 p-1.5">
@@ -225,18 +228,18 @@ export default function Page() {
225228
title="Unlock more team members"
226229
to={v3BillingPath(organization)}
227230
buttonLabel="Upgrade"
228-
panelClassName="mt-4 max-w-sm"
231+
panelClassName="mt-4"
229232
>
230233
<Paragraph variant="small">
231234
You've used all {limits.limit} of your available team members. Upgrade your plan to
232235
enable more.
233236
</Paragraph>
234237
</InfoPanel>
235238
) : (
236-
<div className="mt-4 flex max-w-md justify-end">
239+
<div className="mt-4 flex justify-end">
237240
<LinkButton
238241
to={inviteTeamMemberPath(organization)}
239-
variant={"primary/small"}
242+
variant={"secondary/small"}
240243
LeadingIcon={UserPlusIcon}
241244
>
242245
Invite a team member

apps/webapp/app/routes/account._index/route.tsx

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,18 @@ import { Form, type MetaFunction, useActionData } from "@remix-run/react";
55
import { type ActionFunction, json } from "@remix-run/server-runtime";
66
import { z } from "zod";
77
import { UserProfilePhoto } from "~/components/UserProfilePhoto";
8-
import { MainCenteredContainer, PageBody, PageContainer } from "~/components/layout/AppLayout";
8+
import {
9+
MainCenteredContainer,
10+
MainHorizontallyCenteredContainer,
11+
PageBody,
12+
PageContainer,
13+
} from "~/components/layout/AppLayout";
914
import { Button } from "~/components/primitives/Buttons";
1015
import { CheckboxWithLabel } from "~/components/primitives/Checkbox";
1116
import { Fieldset } from "~/components/primitives/Fieldset";
1217
import { FormButtons } from "~/components/primitives/FormButtons";
1318
import { FormError } from "~/components/primitives/FormError";
19+
import { Header2 } from "~/components/primitives/Headers";
1420
import { Hint } from "~/components/primitives/Hint";
1521
import { Input } from "~/components/primitives/Input";
1622
import { InputGroup } from "~/components/primitives/InputGroup";
@@ -138,14 +144,17 @@ export default function Page() {
138144
</NavBar>
139145

140146
<PageBody>
141-
<div className="grid place-items-center pt-12">
142-
<Form method="post" {...form.props} className="w-80 max-w-md">
147+
<MainHorizontallyCenteredContainer className="grid place-items-center">
148+
<div className="mb-3 w-full border-b border-grid-dimmed pb-3">
149+
<Header2>Profile</Header2>
150+
</div>
151+
<Form method="post" {...form.props} className="w-full">
143152
<InputGroup className="mb-4">
144153
<Label htmlFor={name.id}>Profile picture</Label>
145-
<UserProfilePhoto className="h-24 w-24" />
154+
<UserProfilePhoto className="size-24" />
146155
</InputGroup>
147156
<Fieldset>
148-
<InputGroup>
157+
<InputGroup fullWidth>
149158
<Label htmlFor={name.id}>Full name</Label>
150159
<Input
151160
{...conform.input(name, { type: "text" })}
@@ -156,7 +165,7 @@ export default function Page() {
156165
<Hint>Your teammates will see this</Hint>
157166
<FormError id={name.errorId}>{name.error}</FormError>
158167
</InputGroup>
159-
<InputGroup>
168+
<InputGroup fullWidth>
160169
<Label htmlFor={email.id}>Email address</Label>
161170
<Input
162171
{...conform.input(email, { type: "text" })}
@@ -180,14 +189,14 @@ export default function Page() {
180189

181190
<FormButtons
182191
confirmButton={
183-
<Button type="submit" variant={"primary/small"}>
192+
<Button type="submit" variant={"secondary/small"}>
184193
Update
185194
</Button>
186195
}
187196
/>
188197
</Fieldset>
189198
</Form>
190-
</div>
199+
</MainHorizontallyCenteredContainer>
191200
</PageBody>
192201
</PageContainer>
193202
);

0 commit comments

Comments
 (0)