-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
614 additions
and
510 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import type { FC } from 'react'; | ||
|
||
import { TIP_API_URL } from '@hey/data/constants'; | ||
import getCurrentSession from '@lib/getCurrentSession'; | ||
import { useQuery } from '@tanstack/react-query'; | ||
import axios from 'axios'; | ||
import { useTipsStore } from 'src/store/non-persisted/useTipsStore'; | ||
|
||
const TipsProvider: FC = () => { | ||
const { id: sessionProfileId } = getCurrentSession(); | ||
const { setAllowance, setAllowanceResetsAt } = useTipsStore(); | ||
|
||
const fetchTipsAllowance = async () => { | ||
try { | ||
const response = await axios.get(`${TIP_API_URL}/profile`, { | ||
params: { profileId: sessionProfileId } | ||
}); | ||
const { data } = response; | ||
setAllowance(data?.allowance || null); | ||
setAllowanceResetsAt(new Date(data?.resetAt * 1000)); | ||
return true; | ||
} catch { | ||
return false; | ||
} | ||
}; | ||
|
||
useQuery({ | ||
enabled: Boolean(sessionProfileId), | ||
queryFn: fetchTipsAllowance, | ||
queryKey: ['fetchTipsAllowance', sessionProfileId || ''] | ||
}); | ||
|
||
return null; | ||
}; | ||
|
||
export default TipsProvider; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127 changes: 0 additions & 127 deletions
127
apps/web/src/components/Composer/Actions/OpenActionSettings/Config/Tip.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
be7a011
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
web – ./apps/web
web-git-main-heyxyz.vercel.app
heyxyz.vercel.app
web-heyxyz.vercel.app
hey.xyz