-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33665 from ishpaul777/new-feat/actionable-whispers
New Feature: Create the UI for Actionable Mention Whispers
- Loading branch information
Showing
8 changed files
with
160 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from 'react'; | ||
import {View} from 'react-native'; | ||
import Button from '@components/Button'; | ||
import useLocalize from '@hooks/useLocalize'; | ||
import useThemeStyles from '@hooks/useThemeStyles'; | ||
import type {TranslationPaths} from '@src/languages/types'; | ||
|
||
type ActionableItem = { | ||
isPrimary?: boolean; | ||
key: string; | ||
onPress: () => void; | ||
text: TranslationPaths; | ||
}; | ||
|
||
type ActionableItemButtonsProps = { | ||
items: ActionableItem[]; | ||
}; | ||
|
||
function ActionableItemButtons(props: ActionableItemButtonsProps) { | ||
const styles = useThemeStyles(); | ||
const {translate} = useLocalize(); | ||
|
||
return ( | ||
<View style={[styles.flexRow, styles.gap4]}> | ||
{props.items?.map((item) => ( | ||
<Button | ||
key={item.key} | ||
style={[styles.mt2]} | ||
onPress={item.onPress} | ||
text={translate(item.text)} | ||
small | ||
success={item.isPrimary} | ||
/> | ||
))} | ||
</View> | ||
); | ||
} | ||
|
||
ActionableItemButtons.displayName = 'ActionableItemButtton'; | ||
|
||
export default ActionableItemButtons; | ||
export type {ActionableItem}; |
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