forked from TalentLayer-Labs/starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 4
WIP - Mission milestone 2 #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Gathin23
wants to merge
21
commits into
v2
Choose a base branch
from
Mission-Milestone-2
base: v2
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 17 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
6021497
Filter popup UI
Gathin23 565c5ba
Rate hook update
Gathin23 3b5cc89
Filter by token
Gathin23 87562fa
Basic rate filter & token filter function
Gathin23 34a6852
Working token filter & modified rate amount
Gathin23 3b2d708
Working Rate Filter
Gathin23 aa143e2
Working Token & Rate Filter
Gathin23 bba2598
Added rating filter
Gathin23 63ca363
No services found exception
Gathin23 566a571
Bug-fix
Gathin23 b3472f3
Popup Component
Gathin23 b43606d
Initial-test migration of token filter
Gathin23 616ce58
Token filtering from hardcoded array
Gathin23 6b58987
Working - Token Filter
Gathin23 db9589a
Upd: UI popup
Gathin23 a8855ea
Upd: Tokens filter -> Token Filter
Gathin23 dec5e49
Updated Token, rating and rate
Gathin23 c93f933
Updates state multiple -> single
Gathin23 e172fbb
Merge branch 'v2' into Mission-Milestone-2
Gathin23 5f415a2
Post merge fixes
Gathin23 0416b16
Post merge fix2
Gathin23 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,94 @@ | ||
| import React from 'react'; | ||
| import useAllowedTokens from '../hooks/useAllowedTokens'; | ||
| import { IToken, ServiceFilterPopupProps } from '../types'; | ||
|
|
||
| function ServiceFilterPopup({ | ||
| minRate, | ||
| maxRate, | ||
| selectedToken, | ||
| selectedRatings, | ||
| setMinRate, | ||
| setMaxRate, | ||
| setSelectedToken, | ||
| setSelectedRatings, | ||
| handleResetFilter, | ||
| }: ServiceFilterPopupProps) { | ||
| const allowedTokens = useAllowedTokens(); | ||
|
|
||
| const handleReset = () => { | ||
| handleResetFilter(); | ||
| }; | ||
| return ( | ||
| <div className='absolute bg-base-200 border border-3 border-gray-300 text-base-content p-4 shadow-lg rounded-lg mt-2 ml-2 right-0 z-50'> | ||
| <div className='flex flex-col'> | ||
| {/* <label className='text-sm mt-1 font-bold'>Rate</label> | ||
| <div className='flex flex-row gap-2'> | ||
| <input | ||
| type='number' | ||
| value={minRate} | ||
| onChange={e => setMinRate(e.target.value)} | ||
| className='border border-3 border-gray-300 p-2 rounded w-24' | ||
| placeholder='Min' | ||
| /> | ||
| <input | ||
| type='number' | ||
| value={maxRate} | ||
| onChange={e => setMaxRate(e.target.value)} | ||
| className='border border-3 border-gray-300 p-2 rounded w-24' | ||
| placeholder='Max' | ||
| /> | ||
| </div> */} | ||
| <label className='text-sm mt-3 font-bold'>Token</label> | ||
| <div className='flex flex-col'> | ||
| {allowedTokens.map((token: IToken) => ( | ||
| <div className='flex items-center gap-2' key={token.address}> | ||
| <input | ||
| type='radio' | ||
| name='token' | ||
| value={token.address} | ||
| checked={selectedToken === token.address} | ||
| onChange={e => { | ||
| const tokenName = e.target.value; | ||
| if (e.target.checked) { | ||
| setSelectedToken(tokenName); | ||
| } | ||
| }} | ||
| /> | ||
| <label>{token.symbol}</label> | ||
| </div> | ||
| ))} | ||
| </div> | ||
| {/* <label className='text-sm mt-3 font-bold'>Rating</label> | ||
| <div className='flex flex-col'> | ||
| {Array.from({ length: 5 }, (_, i) => i + 1).map((rating, i) => ( | ||
| <div className='flex items-center gap-2' key={i}> | ||
| <input | ||
| type='checkbox' | ||
| value={rating.toString()} | ||
| checked={selectedRatings.includes(rating.toString())} | ||
| onChange={e => { | ||
| const rating = e.target.value; | ||
| setSelectedRatings(prevState => | ||
| prevState.includes(rating) | ||
| ? prevState.filter(r => r !== rating) | ||
| : [...prevState, rating], | ||
| ); | ||
| }} | ||
| /> | ||
| <label> | ||
| {rating} star{rating == 1 ? '' : 's'} | ||
| </label> | ||
| </div> | ||
| ))} | ||
| </div> */} | ||
| </div> | ||
| <div className='mt-4'> | ||
| <button className='px-5 py-2 border border-black rounded-lg' onClick={handleReset}> | ||
| Reset | ||
| </button> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| export default ServiceFilterPopup; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.