Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: broken mobile styling of the library redirect banner #259

Merged
merged 3 commits into from
Aug 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 21 additions & 17 deletions app/components/RedirectVersionBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export function RedirectVersionBanner(props: {

if (![latestVersion, 'latest'].includes(version) && showModal) {
return (
<div className="p-4 bg-white/70 text-black dark:bg-gray-500/40 dark:text-white shadow-xl shadow-black/20 flex items-center justify-center gap-4 fixed top-4 left-1/2 bottom-auto backdrop-blur-sm z-20 -translate-x-1/2 rounded-full overflow-hidden">
<div>
<div className="p-4 bg-white/70 text-black dark:bg-gray-500/40 dark:text-white shadow-xl shadow-black/20 flex items-center justify-center gap-2.5 lg:gap-4 fixed top-4 left-1/2 bottom-auto backdrop-blur-sm z-20 -translate-x-1/2 rounded-3xl lg:rounded-full overflow-hidden w-[80%] lg:w-auto">
<p className="block">
You are currently reading <strong>{version}</strong> docs. Redirect to{' '}
<Link
params={{
Expand All @@ -33,23 +33,27 @@ export function RedirectVersionBanner(props: {
latest
</Link>{' '}
version?
</p>
<div className="flex gap-2 flex-col lg:flex-row items-center">
<Link
params={{
version: 'latest',
}}
replace
className="bg-black dark:bg-white dark:text-black text-white w-full lg:w-auto py-1 px-2 rounded-md uppercase font-black text-xs"
>
Latest
</Link>
<button
onClick={() => setShowModal(false)}
className="bg-black dark:bg-white dark:text-black text-white w-full lg:w-auto py-1 px-2 rounded-md uppercase font-black text-xs"
>
Hide
</button>
</div>
<Link
params={{
version: 'latest',
}}
replace
className="bg-black dark:bg-white dark:text-black text-white py-1 px-2 rounded-md uppercase font-black text-xs"
>
Latest
</Link>
<button
onClick={() => setShowModal(false)}
className="bg-black dark:bg-white dark:text-black text-white py-1 px-2 rounded-md uppercase font-black text-xs"
>
Hide
</button>
</div>
)
}

return null
}
Loading