Skip to content

Commit d0a2208

Browse files
authored
feat: Improved layout styling, and other tales (#114)
This was mainly a sweep of uses of `h-screen`, as it was breaking on viewports shorter than the page contents, which was particularly nasty on the Pricing page, which is long. I've also: * Tweaked how the rooster shows up on small-width screens * Made the "Terms of Service" text on the login screen black rather than white for readability * Made the hamburger menu icon red rather than write for readability * Changed "w3up" to "Storacha" Unfortunately, we don't have Storybook and Chromatic (or similar) to see all the diffs, but I've screenshotted what I could. Note that these are all full-page screenshots; the fact that the befores are cut off at the top is exactly the problem I was solving here. 🙂 Plenty of this is subjective; thoughts, feedback, and corrections are more than welcome. ### Before ![screencapture-localhost-3000-2024-08-02-16_00_56](https://github.com/user-attachments/assets/8f29fe4a-d078-4271-a3de-75ba30bbf67e) ![screencapture-localhost-3000-2024-08-02-16_02_16](https://github.com/user-attachments/assets/3b9f7b06-0d4d-401e-a90e-144d724f614a) ![screencapture-localhost-3000-2024-08-02-16_15_53](https://github.com/user-attachments/assets/78f31bfa-301c-440e-bdcf-e25962dd766a) ![screencapture-localhost-3000-2024-08-02-16_16_38](https://github.com/user-attachments/assets/a3c09240-a1d4-4029-81c0-6df4a3943a27) ![screencapture-localhost-3000-2024-08-02-16_27_53](https://github.com/user-attachments/assets/1fc08c56-0a58-46aa-939d-7b9aab5eafad) ### After ![screencapture-localhost-3000-2024-08-02-16_01_30](https://github.com/user-attachments/assets/39ec5a46-2dd2-407e-afc9-746e7288447b) ![screencapture-localhost-3000-2024-08-02-16_07_23](https://github.com/user-attachments/assets/78435c8c-d862-4051-ad2a-f51f3bb87a16) ![screencapture-localhost-3000-2024-08-02-16_16_06](https://github.com/user-attachments/assets/365539c3-5966-4885-bd63-dd51f4cfa3f7) ![screencapture-localhost-3000-2024-08-02-16_16_56](https://github.com/user-attachments/assets/dfdb7587-f06f-48cc-9dee-dcc1fff77a99) ![screencapture-localhost-3000-2024-08-02-16_28_11](https://github.com/user-attachments/assets/850af45e-b073-4a09-a420-79245a354c45)
1 parent 434ae17 commit d0a2208

7 files changed

+19
-107
lines changed

src/app/globals.css

+7-3
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@
1919
}
2020
.bg-racha-fire {
2121
background: var(--hot-red-light) url("/racha-fire.png") bottom left;
22-
background-size: cover;
22+
background-size: 100% auto;
23+
background-position: bottom;
24+
background-repeat: no-repeat;
2325
}
2426
.bg-racha-fire\/50 {
2527
background: transparent url("/racha-fire-opacity-50.png") bottom left;
26-
background-size: cover;
28+
background-size: 100% auto;
29+
background-position: bottom;
30+
background-repeat: no-repeat;
2731
}
2832
.bg-hot-red,
2933
.hover\:bg-hot-red:hover {
@@ -88,7 +92,7 @@
8892
}
8993

9094
.authenticator {
91-
@apply bg-racha-fire w-full h-screen flex flex-col justify-center items-center;
95+
@apply bg-racha-fire w-full min-h-screen flex flex-col justify-center items-center py-4;
9296
}
9397

9498
@keyframes bgPosDrift {

src/components/Authenticator.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function AuthenticationForm (): JSX.Element {
2929
</button>
3030
</div>
3131
</AuthCore.Form>
32-
<p className='text-xs text-white/80 italic max-w-xs text-center mt-6'>
32+
<p className='text-xs text-black/80 italic max-w-xs text-center mt-6'>
3333
By registering with storacha.network, you agree to the storacha.network <a className='underline' href='https://web3.storage/docs/terms/'>Terms of Service</a>.
3434
</p>
3535
</div>

src/components/Layout.tsx

-90
This file was deleted.

src/components/Loader.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default function DefaultLoader({ className = '' }: { className?: string }
77
}
88

99
export const TopLevelLoader = () => (
10-
<div className='h-screen flex items-center justify-center'>
10+
<div className='min-h-screen flex items-center justify-center'>
1111
<DefaultLoader className='h-12 w-12 text-black' />
1212
</div>
1313
)

src/components/PlanGate.tsx

+3-5
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ export function PlanGate ({ children }: { children: ReactNode }): ReactNode {
1616

1717
if (!plan?.product) {
1818
return (
19-
<div className="flex flex-col justify-center items-center h-screen">
19+
<div className="flex flex-col justify-center items-center min-h-screen">
2020
<div className='my-6'><Logo /></div>
21-
<div className="max-w-screen-lg font-epilogue text-black text-center bg-white border border-hot-red rounded-2xl p5">
21+
<div className="max-w-screen-lg font-epilogue text-black text-center bg-white border border-hot-red rounded-2xl overflow-hidden p5 mx-4 mb-4">
2222
<div className='px-6 py-6 lg:px-24'>
2323
<h1 className="my-4 font-bold">Welcome {accounts[0]?.toEmail()}!</h1>
2424
<p className='my-4'>
@@ -30,9 +30,7 @@ export function PlanGate ({ children }: { children: ReactNode }): ReactNode {
3030
Pick a plan below and complete the Stripe signup flow to get started!
3131
</p>
3232
</div>
33-
<div className='rounded-lg overflow-hidden'>
34-
<StripePricingTable />
35-
</div>
33+
<StripePricingTable />
3634
</div>
3735
</div>
3836
)

src/components/SidebarLayout.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function Sidebar ({ sidebar = <div></div> }: SidebarComponentProps): JSX.Element
3636
router.push(`/space/${s.did()}`)
3737
}
3838
return (
39-
<nav className='flex-none w-64 bg-hot-yellow text-hot-red px-5 pb-5 border-r border-hot-red h-screen'>
39+
<nav className='flex-none w-64 bg-hot-yellow text-hot-red px-5 pb-5 border-r border-hot-red min-h-screen'>
4040
<div className='flex flex-col justify-between h-full'>
4141
<div>
4242
<header className='opacity-0 lg:opacity-100 my-8'>
@@ -77,7 +77,7 @@ export default function SidebarLayout ({ children }: LayoutComponentProps): JSX.
7777
<AuthenticationEnsurer>
7878
<MaybePlanGate>
7979
<SpaceEnsurer>
80-
<div className='flex min-h-full w-full text-white'>
80+
<div className='flex min-h-screen w-full text-white'>
8181
{/* dialog sidebar for narrow browsers */}
8282
<Transition.Root show={sidebarOpen} >
8383
<Dialog onClose={() => setSidebarOpen(false)} as='div' className='relative z-50'>
@@ -112,10 +112,10 @@ export default function SidebarLayout ({ children }: LayoutComponentProps): JSX.
112112
<div className='hidden lg:block'>
113113
<Sidebar />
114114
</div>
115-
<div className='bg-racha-fire/50 w-full h-screen overflow-scroll text-white'>
115+
<div className='bg-racha-fire/50 w-full'>
116116
{/* top nav bar for narrow browsers, mainly to have a place to put the hamburger */}
117117
<div className='lg:hidden flex justify-between pt-4 px-4'>
118-
<Bars3Icon className='w-6 h-6' onClick={() => setSidebarOpen(true)} />
118+
<Bars3Icon className='text-hot-red w-6 h-6' onClick={() => setSidebarOpen(true)} />
119119
<Logo className='w-full' />
120120
</div>
121121
<main className='grow text-black p-12'>

src/components/SpaceEnsurer.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ export function SpaceEnsurer ({
1414
return children;
1515
}
1616
return (
17-
<div className="flex flex-col justify-center items-center h-screen bg-racha-fire">
18-
<div className='text-zinc-950 bg-white rounded-2xl border border-hot-red shadow-md px-10 pt-8 pb-8'>
17+
<div className="flex flex-col justify-center items-center min-h-screen bg-racha-fire">
18+
<div className='text-zinc-950 bg-white rounded-2xl border border-hot-red shadow-md px-10 pt-8 pb-8 my-4'>
1919
<div className='flex flex-row gap-4 mb-8 justify-center'>
2020
<Logo className='w-36' />
2121
</div>
2222
<h1 className='text-xl font-epilogue'>Welcome{accounts[0] ? ` ${accounts[0]?.toEmail()}` : ''}!</h1>
2323
<p className='my-2 font-epilogue'>
24-
To get started with w3up you&apos;ll need to create a space.
24+
To get started with Storacha, you&apos;ll need to create a space.
2525
</p>
2626
<p className='my-2 font-epilogue'>
2727
Give it a name and hit create!

0 commit comments

Comments
 (0)