-
Notifications
You must be signed in to change notification settings - Fork 33
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
dominhquang
committed
Dec 30, 2024
1 parent
61832c2
commit 5355218
Showing
22 changed files
with
379 additions
and
233 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
36 changes: 36 additions & 0 deletions
36
src/components/common/SelectModal/parts/AccountProxySelectItem.tsx
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 AccountItemWithName from 'components/common/Account/Item/AccountItemWithName'; | ||
import React from 'react'; | ||
import { AccountProxyItem } from 'screens/Account/AccountsScreen'; | ||
|
||
interface Props<T> { | ||
item: T; | ||
selectedValueMap: Record<string, boolean>; | ||
onSelectItem?: (item: T) => void; | ||
onCloseModal?: () => void; | ||
showAccountSignModeIcon?: boolean; | ||
} | ||
|
||
export function AccountProxySelectItem<T>({ | ||
item, | ||
selectedValueMap, | ||
onSelectItem, | ||
onCloseModal, | ||
showAccountSignModeIcon, | ||
}: Props<T>) { | ||
const { id, name } = item as AccountProxyItem; | ||
|
||
return ( | ||
<AccountItemWithName | ||
customStyle={{ container: { marginBottom: 8, marginHorizontal: 16 } }} | ||
avatarSize={24} | ||
address={id} | ||
accountName={name} | ||
isSelected={!!selectedValueMap[id]} | ||
showAccountSignModeIcon={showAccountSignModeIcon} | ||
onPress={() => { | ||
onSelectItem && onSelectItem(item); | ||
onCloseModal && onCloseModal(); | ||
}} | ||
/> | ||
); | ||
} |
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.