forked from BlueWallet/BlueWallet
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
59 changed files
with
1,638 additions
and
1,338 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,97 @@ | ||
name: Lock Files Update | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
pod-update: | ||
runs-on: macos-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
|
||
- name: Checkout master branch | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: master # Ensures we're checking out the master branch | ||
fetch-depth: 0 # Ensures full history to enable branch deletion and recreation | ||
|
||
- name: Delete existing branch | ||
run: | | ||
git push origin --delete pod-update-branch || echo "Branch does not exist, continuing..." | ||
git branch -D pod-update-branch || echo "Local branch does not exist, continuing..." | ||
- name: Create new branch from master | ||
run: git checkout -b pod-update-branch # Create a new branch from the master branch | ||
|
||
- name: Specify node version | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Install node modules | ||
run: npm install | ||
|
||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 3.1.6 | ||
bundler-cache: true | ||
|
||
- name: Install and update Ruby Gems | ||
run: | | ||
bundle install | ||
- name: Install CocoaPods Dependencies | ||
run: | | ||
cd ios | ||
pod install | ||
pod update | ||
- name: Check for changes | ||
id: check-changes | ||
run: | | ||
git diff --quiet package-lock.json ios/Podfile.lock || echo "Changes detected" | ||
continue-on-error: true | ||
|
||
- name: Stop job if no changes | ||
if: steps.check-changes.outcome == 'success' | ||
run: | | ||
echo "No changes detected in package-lock.json or Podfile.lock. Stopping the job." | ||
exit 0 | ||
- name: Commit changes | ||
if: steps.check-changes.outcome != 'success' | ||
run: | | ||
git add package-lock.json ios/Podfile.lock | ||
git commit -m "Update lock files" | ||
# Step 10: Get the list of changed files for PR description | ||
- name: Get changed files for PR description | ||
id: get-changes | ||
if: steps.check-changes.outcome != 'success' | ||
run: | | ||
git diff --name-only HEAD^ HEAD > changed_files.txt | ||
echo "CHANGES=$(cat changed_files.txt)" >> $GITHUB_ENV | ||
# Step 11: Push the changes and create the PR using the LockFiles PAT | ||
- name: Push and create PR | ||
if: steps.check-changes.outcome != 'success' | ||
run: | | ||
git push origin pod-update-branch | ||
gh pr create --title "Lock Files Updates" --body "The following lock files were updated:\n\n${{ env.CHANGES }}" --base master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.LOCKFILES_WORKFLOW }} # Use the LockFiles PAT for PR creation | ||
|
||
cleanup: | ||
runs-on: macos-latest | ||
if: github.event.pull_request.merged == true || github.event.pull_request.state == 'closed' | ||
needs: pod-update | ||
steps: | ||
|
||
- name: Delete branch after PR merge/close | ||
run: | | ||
git push origin --delete pod-update-branch |
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,53 @@ | ||
import React, { useCallback, useMemo } from 'react'; | ||
import { StyleSheet, TouchableOpacity, GestureResponderEvent } from 'react-native'; | ||
import { Icon } from '@rneui/themed'; | ||
import { useTheme } from './themes'; | ||
import ToolTipMenu from './TooltipMenu'; | ||
import { CommonToolTipActions } from '../typings/CommonToolTipActions'; | ||
import loc from '../loc'; | ||
import { navigationRef } from '../NavigationService'; | ||
|
||
type AddWalletButtonProps = { | ||
onPress?: (event: GestureResponderEvent) => void; | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
ball: { | ||
width: 30, | ||
height: 30, | ||
borderRadius: 15, | ||
justifyContent: 'center', | ||
alignContent: 'center', | ||
}, | ||
}); | ||
|
||
const AddWalletButton: React.FC<AddWalletButtonProps> = ({ onPress }) => { | ||
const { colors } = useTheme(); | ||
const stylesHook = StyleSheet.create({ | ||
ball: { | ||
backgroundColor: colors.buttonBackgroundColor, | ||
}, | ||
}); | ||
|
||
const onPressMenuItem = useCallback((action: string) => { | ||
switch (action) { | ||
case CommonToolTipActions.ImportWallet.id: | ||
navigationRef.current?.navigate('AddWalletRoot', { screen: 'ImportWallet' }); | ||
break; | ||
default: | ||
break; | ||
} | ||
}, []); | ||
|
||
const actions = useMemo(() => [CommonToolTipActions.ImportWallet], []); | ||
|
||
return ( | ||
<ToolTipMenu accessibilityRole="button" accessibilityLabel={loc.wallets.add_title} onPressMenuItem={onPressMenuItem} actions={actions}> | ||
<TouchableOpacity style={[styles.ball, stylesHook.ball]} onPress={onPress}> | ||
<Icon name="add" size={22} type="ionicons" color={colors.foregroundColor} /> | ||
</TouchableOpacity> | ||
</ToolTipMenu> | ||
); | ||
}; | ||
|
||
export default AddWalletButton; |
Oops, something went wrong.