Skip to content

Commit

Permalink
Added no featured DAOs state.
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso committed Jul 16, 2023
1 parent 7792199 commit 5da91b9
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 18 deletions.
1 change: 1 addition & 0 deletions packages/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,7 @@
"noCompletedCyclesYet": "No completed cycles yet.",
"noDaosFollowedYet": "You have not yet followed any DAOs.",
"noDisplayName": "no display name",
"noFeaturedDaosYet": "There are no featured DAOs yet.",
"noFundsDuringInstantiation": "No funds will be transferred during instantiation.",
"noGovernanceProposalsNeedDeposit": "There are no governance proposals that need deposits.",
"noGovernanceProposalsOpenForVoting": "There are no governance proposals open for voting.",
Expand Down
50 changes: 33 additions & 17 deletions packages/stateless/components/HorizontalScroller.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { CheckBoxOutlineBlankRounded } from '@mui/icons-material'
import clsx from 'clsx'
import {
ComponentType,
Expand All @@ -7,11 +8,13 @@ import {
useRef,
useState,
} from 'react'
import { useTranslation } from 'react-i18next'
import { useInView } from 'react-intersection-observer'

import { LoadingData } from '@dao-dao/types'

import { Loader } from './logo'
import { NoContent } from './NoContent'

export interface HorizontalScrollerProps<P extends {}> {
Component: ComponentType<P>
Expand All @@ -28,6 +31,7 @@ export const HorizontalScroller = <P extends {}>({
containerClassName,
shadowClassName,
}: HorizontalScrollerProps<P>) => {
const { t } = useTranslation()
const [clonesWidth, setClonesWidth] = useState(0)
const [autoscroll, setAutoscroll] = useState(true)

Expand Down Expand Up @@ -90,16 +94,26 @@ export const HorizontalScroller = <P extends {}>({
return (
<div className={clsx('relative', containerClassName)}>
{/* Left shadow */}
<div
className={clsx('absolute top-0 bottom-0 left-0 z-10', shadowClassName)}
style={{
background:
'linear-gradient(to left, rgba(var(--color-background-base), 0), rgba(var(--color-background-base), 1) 100%)',
}}
></div>
{!items.loading && items.data.length > 0 && (
<div
className={clsx(
'absolute top-0 bottom-0 left-0 z-10 animate-fade-in',
shadowClassName
)}
style={{
background:
'linear-gradient(to left, rgba(var(--color-background-base), 0), rgba(var(--color-background-base), 1) 100%)',
}}
></div>
)}

{items.loading ? (
<Loader />
) : items.data.length === 0 ? (
<NoContent
Icon={CheckBoxOutlineBlankRounded}
body={t('info.noFeaturedDaosYet')}
/>
) : (
<div
className="no-scrollbar w-full overflow-scroll"
Expand Down Expand Up @@ -133,16 +147,18 @@ export const HorizontalScroller = <P extends {}>({
)}

{/* Right shadow */}
<div
className={clsx(
'absolute top-0 right-0 bottom-0 z-10',
shadowClassName
)}
style={{
background:
'linear-gradient(to right, rgba(var(--color-background-base), 0), rgba(var(--color-background-base), 1) 100%)',
}}
></div>
{!items.loading && items.data.length > 0 && (
<div
className={clsx(
'absolute top-0 right-0 bottom-0 z-10 animate-fade-in',
shadowClassName
)}
style={{
background:
'linear-gradient(to right, rgba(var(--color-background-base), 0), rgba(var(--color-background-base), 1) 100%)',
}}
></div>
)}
</div>
)
}
2 changes: 1 addition & 1 deletion packages/stateless/components/command/ContextPill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface ContextPillProps {
export const ContextPill = ({ imageUrl, name, onClose }: ContextPillProps) => (
<div
className={clsx(
'animate-fadein flex shrink-0 flex-row items-center gap-1.5 rounded-full bg-component-badge-primary p-1',
'flex shrink-0 animate-fade-in flex-row items-center gap-1.5 rounded-full bg-component-badge-primary p-1',
!imageUrl && 'pl-2',
!onClose && 'pr-2'
)}
Expand Down

3 comments on commit 5da91b9

@vercel
Copy link

@vercel vercel bot commented on 5da91b9 Jul 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 5da91b9 Jul 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 5da91b9 Jul 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.