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

feat: add sticky header #271

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const Header = React.forwardRef<HTMLDivElement, IHeader>((props, ref) => {
<div
ref={ref}
className={cn(
'bg-red-600 flex h-[56px] justify-between items-center text-white p-3 gap-2 w-full z-[60]',
'bg-red-600 flex h-[56px] justify-between items-center text-white p-3 gap-2 w-full z-[60] sticky top-0',
className
)}
{...rest}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/AboutUs/AboutUs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const AboutUs = () => {
);

return (
<div className="flex flex-col h-screen items-center">
<div className="flex flex-col h-screen items-center overflow-y-scroll">
<Header title="SOS Rio Grande do Sul" startAdornment={<BurgerMenu />} />
<div className="flex flex-col gap-4 p-4 max-w-4xl pb-8 w-full">
<h2 className="text-4xl pt-4 font-semibold !text-zinc-900">
Expand Down
2 changes: 1 addition & 1 deletion src/pages/CreateShelter/CreateShelter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const CreateShelterComponent = () => {
}, [cepData, setFieldValue, setErrors]);

return (
<div className="flex flex-col h-screen items-center">
<div className="flex flex-col h-screen items-center overflow-y-scroll">
<Header
title="Cadastrar novo abrigo"
className="bg-white [&_*]:text-zinc-800 border-b-[1px] border-b-border"
Expand Down
2 changes: 1 addition & 1 deletion src/pages/CreateSupply/CreateSupply.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const CreateSupply = () => {
if (loading) return <LoadingScreen />;

return (
<div className="flex flex-col h-screen items-center">
<div className="flex flex-col h-screen items-center overflow-y-scroll">
<Header
title="Cadastrar novo item"
className="bg-white [&_*]:text-zinc-800 border-b-[1px] border-b-border"
Expand Down
2 changes: 1 addition & 1 deletion src/pages/EditShelterSupply/EditShelterSupply.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const EditShelterSupply = () => {
{...modalData}
/>
)}
<div className="flex flex-col h-screen items-center">
<div className="flex flex-col h-screen items-center overflow-y-scroll">
<Header
title="Editar Itens"
className="bg-white [&_*]:text-zinc-800 border-b-[1px] border-b-border"
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const Home = () => {
}, [refresh, filterData, shelters.filters, shelters.page, shelters.perPage]);

return (
<div className="flex flex-col h-screen items-center">
<div className="flex flex-col h-screen items-center overflow-y-scroll">
{isModalOpen && (
<Filter
open={isModalOpen}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/PrivacyPolicy/PrivacyPolicy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { BurgerMenu, Header } from '@/components';

const PrivacyPolicy = () => {
return (
<div className="flex flex-col h-screen items-center">
<div className="flex flex-col h-screen items-center overflow-y-scroll">
<Header title="SOS Rio Grande do Sul" startAdornment={<BurgerMenu />} />
<div className="w-full flex flex-col gap-4 p-4 max-w-4xl [&_*]:text-zinc-500 pb-8">
<h3 className="text-4xl pt-4 font-bold !text-zinc-900">
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Shelter/Shelter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const Shelter = () => {
if (loading) return <LoadingScreen />;

return (
<div className="flex flex-col h-screen items-center">
<div className="flex flex-col h-screen items-center overflow-y-scroll">
<Header
title={shelter.name}
startAdornment={
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Supporters/Supporters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const Supporters = () => {
if (loading) return <LoadingScreen />;

return (
<div className="flex flex-col h-screen items-center bg-gray-50 overflow-auto">
<div className="flex flex-col h-screen items-center bg-gray-50 overflow-auto overflow-y-scroll">
<Header title="SOS Rio Grande do Sul" startAdornment={<BurgerMenu />} />
<div className="flex flex-col gap-4 p-4 max-w-5xl pb-8 w-full">
<h2 className="text-4xl pt-4 font-semibold !text-zinc-900">
Expand Down
2 changes: 1 addition & 1 deletion src/pages/UpdateShelter/UpdateShelter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const UpdateShelter = () => {
if (loading) return <LoadingScreen />;

return (
<div className="flex flex-col h-screen items-center">
<div className="flex flex-col h-screen items-center overflow-y-scroll">
<Header
title="Atualização cadastral"
className="bg-white [&_*]:text-zinc-800 border-b-[1px] border-b-border"
Expand Down