-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:MetaMask/metamask-mobile into appro…
…ve_transaction_review_cleanup
- Loading branch information
Showing
346 changed files
with
4,519 additions
and
2,638 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# ENV vars for e2e tests to run on Bitrise CI | ||
export MM_TEST_ACCOUNT_SRP='word1 word... word12' | ||
export MM_TEST_ACCOUNT_ADDRESS='0x...' | ||
export MM_TEST_ACCOUNT_PRIVATE_KEY='' |
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,17 @@ | ||
# Fails the pull request if it has the "DO-NOT-MERGE" label | ||
|
||
name: ci / check all branches | ||
|
||
on: | ||
pull_request: | ||
types: [opened, reopened, labeled, unlabeled, synchronize] | ||
|
||
jobs: | ||
do-not-merge: | ||
runs-on: ubuntu-latest | ||
if: ${{ contains(github.event.pull_request.labels.*.name, 'DONOTMERGE') }} | ||
steps: | ||
- name: 'Check for label "DONOTMERGE"' | ||
run: | | ||
echo 'This check fails PRs with the "DONOTMERGE" label to block merging' | ||
exit 1 |
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 |
---|---|---|
@@ -1 +1 @@ | ||
v14 | ||
v16 |
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
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
16 changes: 15 additions & 1 deletion
16
app/component-library/components/Buttons/Button/Button.constants.ts
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 |
---|---|---|
@@ -1,8 +1,22 @@ | ||
/* eslint-disable import/prefer-default-export */ | ||
|
||
// External dependencies. | ||
import { SAMPLE_BUTTONSECONDARY_PROPS } from './variants/ButtonSecondary/ButtonSecondary.constants'; | ||
|
||
// Internal dependencies. | ||
import { ButtonSize, ButtonWidthTypes } from './Button.types'; | ||
import { | ||
ButtonSize, | ||
ButtonWidthTypes, | ||
ButtonProps, | ||
ButtonVariants, | ||
} from './Button.types'; | ||
|
||
// Defaults | ||
export const DEFAULT_BUTTON_SIZE = ButtonSize.Md; | ||
export const DEFAULT_BUTTON_WIDTH = ButtonWidthTypes.Auto; | ||
|
||
// Samples | ||
export const SAMPLE_BUTTON_PROPS: ButtonProps = { | ||
variant: ButtonVariants.Secondary, | ||
...SAMPLE_BUTTONSECONDARY_PROPS, | ||
}; |
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
113 changes: 113 additions & 0 deletions
113
app/component-library/components/Buttons/Button/README.md
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,113 @@ | ||
# Button | ||
|
||
Buttons allow users to take actions, and make choices, with a single tap. | ||
This component is a union component, which consists of [ButtonLink](./variants/ButtonLink/ButtonLink.tsx), [ButtonPrimary](./variants/ButtonPrimary/ButtonPrimary.tsx), and [ButtonSecondary](./variants/ButtonSecondary/ButtonSecondary.tsx). | ||
|
||
## ButtonLink Props | ||
|
||
### `textVariant` | ||
|
||
Optional props to configure text component variants. | ||
|
||
| <span style="color:gray;font-size:14px">TYPE</span> | <span style="color:gray;font-size:14px">REQUIRED</span> | | ||
| :-------------------------------------------------- | :------------------------------------------------------ | | ||
| [TextVariant](../../../../Texts/Text/Text.types.ts) | No | | ||
|
||
## Common Props | ||
|
||
### `label` | ||
|
||
ButtonBase text. | ||
|
||
| <span style="color:gray;font-size:14px">TYPE</span> | <span style="color:gray;font-size:14px">REQUIRED</span> | | ||
| :-------------------------------------------------- | :------------------------------------------------------ | | ||
| string | Yes | | ||
|
||
### `size` | ||
|
||
Optional prop for the size of the button. | ||
|
||
| <span style="color:gray;font-size:14px">TYPE</span> | <span style="color:gray;font-size:14px">REQUIRED</span> | <span style="color:gray;font-size:14px">DEFAULT</span> | | ||
| :-------------------------------------------------- | :------------------------------------------------------ | :----------------------------------------------------- | | ||
| [ButtonSize](../../Button.types.ts) | Yes | Md | | ||
|
||
### `onPress` | ||
|
||
Function to trigger when pressing the button. | ||
|
||
| <span style="color:gray;font-size:14px">TYPE</span> | <span style="color:gray;font-size:14px">REQUIRED</span> | | ||
| :-------------------------------------------------- | :------------------------------------------------------ | | ||
| Function | Yes | | ||
|
||
### `startIconName` | ||
|
||
Optional prop for the icon name of the icon that will be displayed before the label. | ||
|
||
| <span style="color:gray;font-size:14px">TYPE</span> | <span style="color:gray;font-size:14px">REQUIRED</span> | | ||
| :-------------------------------------------------- | :------------------------------------------------------ | | ||
| [IconName](../Icons/Icon.types.ts) | No | | ||
|
||
### `endIconName` | ||
|
||
Optional prop for the icon name of the icon that will be displayed after the label. | ||
|
||
| <span style="color:gray;font-size:14px">TYPE</span> | <span style="color:gray;font-size:14px">REQUIRED</span> | | ||
| :-------------------------------------------------- | :------------------------------------------------------ | | ||
| [IconName](../Icons/Icon.types.ts) | No | | ||
|
||
### `isDanger` | ||
|
||
Optional boolean to show the danger state of the button. | ||
|
||
| <span style="color:gray;font-size:14px">TYPE</span> | <span style="color:gray;font-size:14px">REQUIRED</span> | <span style="color:gray;font-size:14px">DEFAULT</span> | | ||
| :-------------------------------------------------- | :------------------------------------------------------ | :----------------------------------------------------- | | ||
| boolean | No | false | | ||
|
||
### `width` | ||
|
||
Optional param to control the width of the button. | ||
|
||
| <span style="color:gray;font-size:14px">TYPE</span> | <span style="color:gray;font-size:14px">REQUIRED</span> | <span style="color:gray;font-size:14px">DEFAULT</span> | | ||
| :-------------------------------------------------- | :------------------------------------------------------ | :----------------------------------------------------- | | ||
| [ButtonWidthTypes](../../Button.types.ts) or number | No | ButtonWidthTypes.Auto | | ||
|
||
## Usage | ||
|
||
```javascript | ||
// ButtonLink | ||
<Button | ||
variant={ButtonVariants.Link} | ||
label={SAMPLE_LABEL} | ||
startIconName={IconName.Bank} | ||
endIconName={IconName.Bank} | ||
size={ButtonSize.Md} | ||
onPress={SAMPLE_ONPRESS_HANDLER} | ||
isDanger | ||
width={ButtonWidthTypes.Auto} | ||
textVariant={TextVariant.DisplayMD} | ||
/>; | ||
|
||
// ButtonPrimary | ||
<Button | ||
variant={ButtonVariants.Primary} | ||
label={SAMPLE_LABEL} | ||
startIconName={IconName.Bank} | ||
endIconName={IconName.Bank} | ||
size={ButtonSize.Md} | ||
onPress={SAMPLE_ONPRESS_HANDLER} | ||
isDanger | ||
width={ButtonWidthTypes.Auto} | ||
/>; | ||
|
||
// ButtonSecondary | ||
<Button | ||
variant={ButtonVariants.Secondary} | ||
label={SAMPLE_LABEL} | ||
startIconName={IconName.Bank} | ||
endIconName={IconName.Bank} | ||
size={ButtonSize.Md} | ||
onPress={SAMPLE_ONPRESS_HANDLER} | ||
isDanger | ||
width={ButtonWidthTypes.Auto} | ||
/>; | ||
``` |
Oops, something went wrong.