Skip to content
Open
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
16 changes: 14 additions & 2 deletions src/containers/ProDashboard/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { lazy, Suspense, useState } from 'react'
import { useRouter } from 'next/router'
import toast from 'react-hot-toast'
import { Icon } from '~/components/Icon'
import { BasicLink } from '~/components/Link'
import { LoadingSpinner } from '~/components/Loaders'
Expand Down Expand Up @@ -210,7 +211,7 @@ function ProDashboardContent() {
<Tooltip
content="Views"
render={<p />}
className="flex items-center gap-1 rounded-md border border-(--cards-border) px-1.5 py-1 text-xs text-(--text-disabled)"
Copy link
Contributor

Choose a reason for hiding this comment

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

why remove this color ? we use this text color to differentiate it from like button as this isn't clickable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason I removed it is to make it consistent with the other two buttons.

className="flex items-center gap-1 rounded-md border border-(--cards-border) px-1.5 py-1 text-xs"
>
<Icon name="eye" height={14} width={14} />
<span>{currentDashboard?.viewCount || 0}</span>
Expand Down Expand Up @@ -417,7 +418,18 @@ const LikeDashboardButton = ({
return (
<Tooltip
content={currentDashboard?.liked ? 'Unlike dashboard' : 'Like dashboard'}
render={<button onClick={() => toggleLike()} disabled={isLiking || !isAuthenticated} />}
render={
<button
onClick={() => {
if (isAuthenticated) {
toggleLike()
} else {
toast.error('Please sign in to like a dashboard')
}
}}
disabled={isLiking}
/>
}
className={`hover:not-disabled:pro-btn-blue focus-visible:not-disabled:pro-btn-blue flex items-center gap-1 rounded-md border border-(--form-control-border) px-1.5 py-1 text-xs hover:border-transparent focus-visible:border-transparent`}
Copy link
Contributor

Choose a reason for hiding this comment

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

user will also need to subscribe to like a dashboard, i don't think toast is helpful

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should we redirect users to the sign in page or show a better toast message? rn when someone clicks the like button, it’s disabled if they are not signed it, I felt it’s better to give feedback on what’s missing before they can like it.

>
{isLiking ? (
Expand Down