Skip to content

Commit b84ec82

Browse files
committed
feat: restructure app components and implement secure storage functionality
- Refactored the project structure to separate components into a dedicated directory. - Introduced a new App component with secure storage capabilities using react-native-sensitive-info. - Added ActionButton, ActionsPanel, Card, Header, ModeSelector, SecretForm, SecretsList components for improved UI and functionality. - Implemented secure storage logic including saving, revealing, removing, and clearing secrets. - Enhanced user experience with loading states and error handling. - Updated configuration files for Babel, Metro, and React Native. - Added utility functions for error formatting and constants for default values. - Improved ESLint and Prettier configurations for better code quality.
1 parent 3842e1d commit b84ec82

23 files changed

+938
-689
lines changed

.prettierrc.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
module.exports = {
22
singleQuote: true,
3-
trailingComma: 'all',
4-
printWidth: 100,
3+
semi: true,
4+
tabWidth: 2,
5+
trailingComma: 'es5',
6+
useTabs: false,
7+
quoteProps: 'consistent',
58
};

app.plugin.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,43 @@ const {
22
createRunOncePlugin,
33
withGradleProperties,
44
withPodfileProperties,
5-
} = require('@expo/config-plugins')
5+
} = require('@expo/config-plugins');
66

7-
const pkg = require('./package.json')
7+
const pkg = require('./package.json');
88

99
function ensureGradleProperty(gradleProperties, name, value) {
10-
const property = gradleProperties.find((item) => item.name === name)
10+
const property = gradleProperties.find((item) => item.name === name);
1111
if (property) {
12-
property.value = value
12+
property.value = value;
1313
} else {
14-
gradleProperties.push({ type: 'property', name, value })
14+
gradleProperties.push({ type: 'property', name, value });
1515
}
1616
}
1717

1818
function withAndroidNewArchitecture(config) {
1919
return withGradleProperties(config, (modConfig) => {
20-
ensureGradleProperty(modConfig.modResults, 'newArchEnabled', 'true')
21-
ensureGradleProperty(modConfig.modResults, 'expo.jsEngine', 'hermes')
22-
return modConfig
23-
})
20+
ensureGradleProperty(modConfig.modResults, 'newArchEnabled', 'true');
21+
ensureGradleProperty(modConfig.modResults, 'expo.jsEngine', 'hermes');
22+
return modConfig;
23+
});
2424
}
2525

2626
function withIosNewArchitecture(config) {
2727
return withPodfileProperties(config, (modConfig) => {
28-
modConfig.modResults.new_arch_enabled = 'true'
29-
modConfig.modResults.RCT_NEW_ARCH_ENABLED = '1'
30-
return modConfig
31-
})
28+
modConfig.modResults.new_arch_enabled = 'true';
29+
modConfig.modResults.RCT_NEW_ARCH_ENABLED = '1';
30+
return modConfig;
31+
});
3232
}
3333

3434
function withSensitiveInfoExpo(config) {
35-
config = withAndroidNewArchitecture(config)
36-
config = withIosNewArchitecture(config)
37-
return config
35+
config = withAndroidNewArchitecture(config);
36+
config = withIosNewArchitecture(config);
37+
return config;
3838
}
3939

4040
module.exports = createRunOncePlugin(
4141
withSensitiveInfoExpo,
4242
pkg.name,
4343
pkg.version
44-
)
44+
);

babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
22
plugins: ['babel-plugin-react-compiler'],
33
presets: ['module:@react-native/babel-preset'],
4-
}
4+
};

eslint.config.mts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,31 @@ export default [
6262
},
6363

6464
rules: {
65-
'prettier/prettier': 'error',
65+
'prettier/prettier': [
66+
'error',
67+
{
68+
singleQuote: true,
69+
semi: true,
70+
tabWidth: 2,
71+
trailingComma: 'es5',
72+
useTabs: false,
73+
quoteProps: 'consistent',
74+
},
75+
],
6676
'import/extensions': 'off',
77+
'react/function-component-definition': [
78+
'error',
79+
{
80+
namedComponents: 'arrow-function',
81+
unnamedComponents: 'arrow-function',
82+
},
83+
],
84+
'react/jsx-filename-extension': [
85+
'error',
86+
{
87+
extensions: ['.jsx', '.tsx'],
88+
},
89+
],
6790
},
6891
},
6992
];

0 commit comments

Comments
 (0)