Skip to content

Commit

Permalink
fix: address review issues
Browse files Browse the repository at this point in the history
  • Loading branch information
schmanu committed Jun 20, 2024
1 parent 38a8ae1 commit 87de24b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
19 changes: 10 additions & 9 deletions src/components/Points/ActivityPointsFeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,17 @@ export const ActivityPointsFeed = ({ campaign }: { campaign?: Campaign }) => {
const [showOverallPoints, setShowOverallPoints] = useState(false)

useEffect(() => {
if (ownEntry !== undefined || !isLoading || !isLatestUpdateLoading) {
const showBoostPointsTimeout = setTimeout(() => setShowBoostPoints(true), 1000)
const showTotalPointsTimeout = setTimeout(() => setShowTotalPoints(true), 2000)
const showOverallPointsTimeout = setTimeout(() => setShowOverallPoints(true), 3000)
if (ownEntry === undefined || isLoading || isLatestUpdateLoading) {
return
}
const showBoostPointsTimeout = setTimeout(() => setShowBoostPoints(true), 1000)
const showTotalPointsTimeout = setTimeout(() => setShowTotalPoints(true), 2000)
const showOverallPointsTimeout = setTimeout(() => setShowOverallPoints(true), 3000)

return () => {
clearTimeout(showBoostPointsTimeout)
clearTimeout(showTotalPointsTimeout)
clearTimeout(showOverallPointsTimeout)
}
return () => {
clearTimeout(showBoostPointsTimeout)
clearTimeout(showTotalPointsTimeout)
clearTimeout(showOverallPointsTimeout)
}
}, [ownEntry, isLoading, isLatestUpdateLoading])

Expand Down
2 changes: 1 addition & 1 deletion src/components/Points/TotalPoints.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const TotalPoints = () => {
)}
<Box display="flex" flexDirection="row" gap={1} alignItems="center">
<Typography color="text.secondary">Your total points</Typography>
<Tooltip title="All points collected form capaigns and regular Safe activities" arrow>
<Tooltip title="All points collected form campaigns and regular Safe activities" arrow>
<InfoOutlined fontSize="small" sx={{ color: ({ palette }) => palette.text.secondary }} />
</Tooltip>
</Box>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Points/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ const Points = () => {
{!isSmallScreen && (
<Typography variant="body2" color="text.secondary">
Earn points by engaging with Safe and our campaign partners. Depending on the campaign, you&apos;ll
be rewarded for various activities suggested by our partners. You can also earn points for Regular
Safe Activities.
be rewarded for various activities suggested by our partners. You can also earn points for regular
Safe activities.
</Typography>
)}
</Stack>
Expand Down

0 comments on commit 87de24b

Please sign in to comment.