Skip to content

Commit

Permalink
Merge pull request #1308 from tapexyz/cleanup
Browse files Browse the repository at this point in the history
chore: remove unwanted headings
  • Loading branch information
sasicodes authored Feb 14, 2024
2 parents b4cd344 + 788bf45 commit 3580ab4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 15 deletions.
6 changes: 2 additions & 4 deletions apps/web/src/components/Common/CategoryFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ import HorizantalScroller from './HorizantalScroller'

type Props = {
heading?: string
subheading?: string
}

const CategoryFilters: FC<Props> = ({ heading, subheading }) => {
const CategoryFilters: FC<Props> = ({ heading }) => {
const sectionRef = useRef<HTMLDivElement>(null)
const { activeTagFilter, setActiveTagFilter } = useAppStore()

Expand All @@ -26,11 +25,10 @@ const CategoryFilters: FC<Props> = ({ heading, subheading }) => {
<HorizantalScroller
sectionRef={sectionRef}
heading={heading ?? 'Explore'}
subheading={subheading ?? 'Categories'}
/>
<div
ref={sectionRef}
className="no-scrollbar laptop:pt-6 flex items-center overflow-x-auto scroll-smooth pt-4 md:mx-auto"
className="no-scrollbar flex items-center overflow-x-auto scroll-smooth pt-4 md:mx-auto"
>
<button
className={tw(
Expand Down
6 changes: 2 additions & 4 deletions apps/web/src/components/Common/HorizantalScroller.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ import React from 'react'

type Props = {
heading: string
subheading: string
sectionRef: RefObject<HTMLDivElement>
}

const HorizantalScroller: FC<Props> = ({ heading, subheading, sectionRef }) => {
const HorizantalScroller: FC<Props> = ({ heading, sectionRef }) => {
const sectionOffsetWidth = sectionRef.current?.offsetWidth ?? 1000
const scrollOffset = sectionOffsetWidth / 1.2

Expand All @@ -21,8 +20,7 @@ const HorizantalScroller: FC<Props> = ({ heading, subheading, sectionRef }) => {
return (
<div className="flex items-center justify-between">
<div className="flex items-center space-x-3 text-xl">
<h1 className="text-brand-500 font-bold">{heading}</h1>
<p>{subheading}</p>
<h1 className="font-bold">{heading}</h1>
</div>
<div className="space-x-2">
<button
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/Explore/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Explore = () => {
return (
<div className="max-w-screen-ultrawide container mx-auto">
<MetaTags title="Explore" />
<CategoryFilters subheading="Everything" />
<CategoryFilters heading="Everything" />
<ExploreFeed />
</div>
)
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/Feed/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const Feed = () => {
return (
<div className="max-w-screen-ultrawide container mx-auto">
<MetaTags title="Your Feed" />
<CategoryFilters heading="Feed" subheading="Your Friends' Stories" />
<CategoryFilters heading="Your Feed" />
{loading && <TimelineShimmer className="laptop:pt-6 pt-4" />}
{!loading && !feedItems?.length ? (
<NoDataFound
Expand Down
6 changes: 1 addition & 5 deletions apps/web/src/components/Home/TopSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ const TopSection = () => {

return (
<div className="flex flex-col">
<HorizantalScroller
sectionRef={sectionRef}
heading="Today"
subheading="New & Trending"
/>
<HorizantalScroller sectionRef={sectionRef} heading="New & Trending" />
<div
ref={sectionRef}
className="no-scrollbar laptop:pt-6 relative flex items-start space-x-4 overflow-x-auto overflow-y-hidden scroll-smooth pt-4"
Expand Down

0 comments on commit 3580ab4

Please sign in to comment.