Skip to content

Commit

Permalink
fixed homepage horizontal scroller shadows
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso committed Sep 25, 2024
1 parent 0f43901 commit b480b57
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 8 additions & 1 deletion packages/stateless/components/HorizontalScroller.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface HorizontalScrollerProps<P extends {}> {
itemClassName?: string
containerClassName?: string
shadowClassName?: string
contentContainerClassName?: string
}

export const HorizontalScroller = <P extends {}>({
Expand All @@ -22,6 +23,7 @@ export const HorizontalScroller = <P extends {}>({
itemClassName,
containerClassName,
shadowClassName,
contentContainerClassName,
}: HorizontalScrollerProps<P>) => {
const { t } = useTranslation()

Expand Down Expand Up @@ -76,7 +78,12 @@ export const HorizontalScroller = <P extends {}>({
className="no-scrollbar w-full overflow-scroll"
ref={scrollableContainerRef}
>
<div className="flex w-max flex-row gap-2 py-1 sm:gap-3">
<div
className={clsx(
'flex w-max flex-row gap-2 py-1 sm:gap-3',
contentContainerClassName
)}
>
{items.loading
? [...Array(5)].map((_, index) => (
<div key={index} className={itemClassName}>
Expand Down
9 changes: 4 additions & 5 deletions packages/stateless/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,10 @@ export const Home = ({
(chainGovDaos.loading || chainGovDaos.data.length > 0) &&
UNDO_PAGE_PADDING_HORIZONTAL_CLASSES
)}
// Margin offsets container padding.
contentContainerClassName="px-6"
itemClassName="w-64"
items={chainGovDaos}
// Max width of 5xl = 64rem, container padding of 6 = 1.5rem
shadowClassName="w-[max((100%-64rem)/2,1.5rem)]"
shadowClassName="w-6"
/>
</div>
)}
Expand Down Expand Up @@ -206,10 +205,10 @@ export const Home = ({
(featuredDaos.loading || featuredDaos.data.length > 0) &&
UNDO_PAGE_PADDING_HORIZONTAL_CLASSES
)}
contentContainerClassName="px-6"
itemClassName="w-64"
items={featuredDaos}
// Max width of 5xl = 64rem, container padding of 6 = 1.5rem
shadowClassName="w-[max((100%-64rem)/2,1.5rem)]"
shadowClassName="w-6"
/>
</div>
</>
Expand Down

0 comments on commit b480b57

Please sign in to comment.