add english, remove restriction
This commit is contained in:
parent
01aee2cab9
commit
98927b855f
68
App.js
68
App.js
@ -7,27 +7,17 @@
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import {
|
||||
SafeAreaView,
|
||||
StyleSheet,
|
||||
ScrollView,
|
||||
View,
|
||||
Text,
|
||||
StatusBar,
|
||||
} from 'react-native';
|
||||
|
||||
import {
|
||||
Header,
|
||||
LearnMoreLinks,
|
||||
Colors,
|
||||
DebugInstructions,
|
||||
ReloadInstructions,
|
||||
} from 'react-native/Libraries/NewAppScreen';
|
||||
import { createAppContainer } from 'react-navigation';
|
||||
import { createStackNavigator } from 'react-navigation-stack';
|
||||
|
||||
import MainScreen from './src/screen/MainScreen';
|
||||
import CardEditScreen from './src/screen/CardEditScreen';
|
||||
|
||||
import * as RNLocalize from 'react-native-localize';
|
||||
import i18n from 'i18n-js';
|
||||
import en from './src/locales/en';
|
||||
import ko from './src/locales/ko';
|
||||
|
||||
const MainNavigator = createStackNavigator({
|
||||
Home: {
|
||||
screen: MainScreen,
|
||||
@ -41,17 +31,45 @@ const MainNavigator = createStackNavigator({
|
||||
{
|
||||
initialRouteName: 'Home',
|
||||
}
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
const AppContainer = createAppContainer(MainNavigator);
|
||||
|
||||
const App: () => React$Node = () => {
|
||||
return (
|
||||
<>
|
||||
<AppContainer/>
|
||||
</>
|
||||
);
|
||||
const setI18nConfig = () => {
|
||||
const fallback = { languageTag: 'en' };
|
||||
const { languageTag } = RNLocalize.findBestAvailableLanguage(['en', 'ko']) || fallback;
|
||||
|
||||
i18n.translations = {
|
||||
en,
|
||||
ko,
|
||||
};
|
||||
i18n.locale = languageTag;
|
||||
};
|
||||
|
||||
export default App;
|
||||
export default class App extends React.Component{
|
||||
constructor(props) {
|
||||
super(props);
|
||||
setI18nConfig();
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
RNLocalize.addEventListener('change', this.handleLocalizationChange)
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
RNLocalize.removeEventListener('change', this.handleLocalizationChange)
|
||||
}
|
||||
|
||||
handleLocalizationChange = () => {
|
||||
setI18nConfig();
|
||||
this.forceUpdate();
|
||||
};
|
||||
|
||||
render(){
|
||||
return (
|
||||
<>
|
||||
<AppContainer/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
@ -133,8 +133,8 @@ android {
|
||||
applicationId "tk.nulldori.eamemu"
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode 202
|
||||
versionName "2.0.2"
|
||||
versionCode 210
|
||||
versionName "2.1.0"
|
||||
vectorDrawables.useSupportLibrary = true
|
||||
|
||||
}
|
||||
|
BIN
app-release.apk
BIN
app-release.apk
Binary file not shown.
301
package-lock.json
generated
301
package-lock.json
generated
@ -13,27 +13,131 @@
|
||||
}
|
||||
},
|
||||
"@babel/core": {
|
||||
"version": "7.8.4",
|
||||
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.8.4.tgz",
|
||||
"integrity": "sha512-0LiLrB2PwrVI+a2/IEskBopDYSd8BCb3rOvH7D5tzoWd696TBEduBvuLVm4Nx6rltrLZqvI3MCalB2K2aVzQjA==",
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.10.0.tgz",
|
||||
"integrity": "sha512-FGgV2XyPoVtYDvbFXlukEWt13Afka4mBRQ2CoTsHxpgVGO6XfgtT6eI+WyjQRGGTL90IDkIVmme8riFCLZ8lUw==",
|
||||
"requires": {
|
||||
"@babel/code-frame": "^7.8.3",
|
||||
"@babel/generator": "^7.8.4",
|
||||
"@babel/helpers": "^7.8.4",
|
||||
"@babel/parser": "^7.8.4",
|
||||
"@babel/template": "^7.8.3",
|
||||
"@babel/traverse": "^7.8.4",
|
||||
"@babel/types": "^7.8.3",
|
||||
"@babel/generator": "^7.10.0",
|
||||
"@babel/helper-module-transforms": "^7.9.0",
|
||||
"@babel/helpers": "^7.10.0",
|
||||
"@babel/parser": "^7.10.0",
|
||||
"@babel/template": "^7.10.0",
|
||||
"@babel/traverse": "^7.10.0",
|
||||
"@babel/types": "^7.10.0",
|
||||
"convert-source-map": "^1.7.0",
|
||||
"debug": "^4.1.0",
|
||||
"gensync": "^1.0.0-beta.1",
|
||||
"json5": "^2.1.0",
|
||||
"json5": "^2.1.2",
|
||||
"lodash": "^4.17.13",
|
||||
"resolve": "^1.3.2",
|
||||
"semver": "^5.4.1",
|
||||
"source-map": "^0.5.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/generator": {
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.0.tgz",
|
||||
"integrity": "sha512-ThoWCJHlgukbtCP79nAK4oLqZt5fVo70AHUni/y8Jotyg5rtJiG2FVl+iJjRNKIyl4hppqztLyAoEWcCvqyOFQ==",
|
||||
"requires": {
|
||||
"@babel/types": "^7.10.0",
|
||||
"jsesc": "^2.5.1",
|
||||
"lodash": "^4.17.13",
|
||||
"source-map": "^0.5.0"
|
||||
}
|
||||
},
|
||||
"@babel/helper-function-name": {
|
||||
"version": "7.9.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.9.5.tgz",
|
||||
"integrity": "sha512-JVcQZeXM59Cd1qanDUxv9fgJpt3NeKUaqBqUEvfmQ+BCOKq2xUgaWZW2hr0dkbyJgezYuplEoh5knmrnS68efw==",
|
||||
"requires": {
|
||||
"@babel/helper-get-function-arity": "^7.8.3",
|
||||
"@babel/template": "^7.8.3",
|
||||
"@babel/types": "^7.9.5"
|
||||
}
|
||||
},
|
||||
"@babel/helper-member-expression-to-functions": {
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.10.0.tgz",
|
||||
"integrity": "sha512-xKLTpbMkJcvwEsDaTfs9h0IlfUiBLPFfybxaPpPPsQDsZTRg+UKh+86oK7sctHF3OUiRQkb10oS9MXSqgyV6/g==",
|
||||
"requires": {
|
||||
"@babel/types": "^7.10.0"
|
||||
}
|
||||
},
|
||||
"@babel/helper-module-transforms": {
|
||||
"version": "7.9.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.9.0.tgz",
|
||||
"integrity": "sha512-0FvKyu0gpPfIQ8EkxlrAydOWROdHpBmiCiRwLkUiBGhCUPRRbVD2/tm3sFr/c/GWFrQ/ffutGUAnx7V0FzT2wA==",
|
||||
"requires": {
|
||||
"@babel/helper-module-imports": "^7.8.3",
|
||||
"@babel/helper-replace-supers": "^7.8.6",
|
||||
"@babel/helper-simple-access": "^7.8.3",
|
||||
"@babel/helper-split-export-declaration": "^7.8.3",
|
||||
"@babel/template": "^7.8.6",
|
||||
"@babel/types": "^7.9.0",
|
||||
"lodash": "^4.17.13"
|
||||
}
|
||||
},
|
||||
"@babel/helper-optimise-call-expression": {
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.0.tgz",
|
||||
"integrity": "sha512-HgMd8QKA8wMJs5uK/DYKdyzJAEuGt1zyDp9wLMlMR6LitTQTHPUE+msC82ZsEDwq+U3/yHcIXIngRm9MS4IcIg==",
|
||||
"requires": {
|
||||
"@babel/types": "^7.10.0"
|
||||
}
|
||||
},
|
||||
"@babel/helper-replace-supers": {
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.0.tgz",
|
||||
"integrity": "sha512-erl4iVeiANf14JszXP7b69bSrz3e3+qW09pVvEmTWwzRQEOoyb1WFlYCA8d/VjVZGYW8+nGpLh7swf9CifH5wg==",
|
||||
"requires": {
|
||||
"@babel/helper-member-expression-to-functions": "^7.10.0",
|
||||
"@babel/helper-optimise-call-expression": "^7.10.0",
|
||||
"@babel/traverse": "^7.10.0",
|
||||
"@babel/types": "^7.10.0"
|
||||
}
|
||||
},
|
||||
"@babel/parser": {
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.0.tgz",
|
||||
"integrity": "sha512-fnDUl1Uy2gThM4IFVW4ISNHqr3cJrCsRkSCasFgx0XDO9JcttDS5ytyBc4Cu4X1+fjoo3IVvFbRD6TeFlHJlEQ=="
|
||||
},
|
||||
"@babel/template": {
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.0.tgz",
|
||||
"integrity": "sha512-aMLEQn5tcG49LEWrsEwxiRTdaJmvLem3+JMCMSeCy2TILau0IDVyWdm/18ACx7XOCady64FLt6KkHy28tkDQHQ==",
|
||||
"requires": {
|
||||
"@babel/code-frame": "^7.8.3",
|
||||
"@babel/parser": "^7.10.0",
|
||||
"@babel/types": "^7.10.0"
|
||||
}
|
||||
},
|
||||
"@babel/traverse": {
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.10.0.tgz",
|
||||
"integrity": "sha512-NZsFleMaLF1zX3NxbtXI/JCs2RPOdpGru6UBdGsfhdsDsP+kFF+h2QQJnMJglxk0kc69YmMFs4A44OJY0tKo5g==",
|
||||
"requires": {
|
||||
"@babel/code-frame": "^7.8.3",
|
||||
"@babel/generator": "^7.10.0",
|
||||
"@babel/helper-function-name": "^7.9.5",
|
||||
"@babel/helper-split-export-declaration": "^7.8.3",
|
||||
"@babel/parser": "^7.10.0",
|
||||
"@babel/types": "^7.10.0",
|
||||
"debug": "^4.1.0",
|
||||
"globals": "^11.1.0",
|
||||
"lodash": "^4.17.13"
|
||||
}
|
||||
},
|
||||
"@babel/types": {
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.0.tgz",
|
||||
"integrity": "sha512-t41W8yWFyQFPOAAvPvjyRhejcLGnJTA3iRpFcDbEKwVJ3UnHQePFzLk8GagTsucJlImyNwrGikGsYURrWbQG8w==",
|
||||
"requires": {
|
||||
"@babel/helper-validator-identifier": "^7.9.5",
|
||||
"lodash": "^4.17.13",
|
||||
"to-fast-properties": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"debug": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
|
||||
@ -253,6 +357,11 @@
|
||||
"@babel/types": "^7.8.3"
|
||||
}
|
||||
},
|
||||
"@babel/helper-validator-identifier": {
|
||||
"version": "7.9.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz",
|
||||
"integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g=="
|
||||
},
|
||||
"@babel/helper-wrap-function": {
|
||||
"version": "7.8.3",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.8.3.tgz",
|
||||
@ -265,13 +374,85 @@
|
||||
}
|
||||
},
|
||||
"@babel/helpers": {
|
||||
"version": "7.8.4",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.8.4.tgz",
|
||||
"integrity": "sha512-VPbe7wcQ4chu4TDQjimHv/5tj73qz88o12EPkO2ValS2QiQS/1F2SsjyIGNnAD0vF/nZS6Cf9i+vW6HIlnaR8w==",
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.10.0.tgz",
|
||||
"integrity": "sha512-lQtFJoDZAGf/t2PgR6Z59Q2MwjvOGGsxZ0BAlsrgyDhKuMbe63EfbQmVmcLfyTBj8J4UtiadQimcotvYVg/kVQ==",
|
||||
"requires": {
|
||||
"@babel/template": "^7.8.3",
|
||||
"@babel/traverse": "^7.8.4",
|
||||
"@babel/types": "^7.8.3"
|
||||
"@babel/template": "^7.10.0",
|
||||
"@babel/traverse": "^7.10.0",
|
||||
"@babel/types": "^7.10.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/generator": {
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.0.tgz",
|
||||
"integrity": "sha512-ThoWCJHlgukbtCP79nAK4oLqZt5fVo70AHUni/y8Jotyg5rtJiG2FVl+iJjRNKIyl4hppqztLyAoEWcCvqyOFQ==",
|
||||
"requires": {
|
||||
"@babel/types": "^7.10.0",
|
||||
"jsesc": "^2.5.1",
|
||||
"lodash": "^4.17.13",
|
||||
"source-map": "^0.5.0"
|
||||
}
|
||||
},
|
||||
"@babel/helper-function-name": {
|
||||
"version": "7.9.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.9.5.tgz",
|
||||
"integrity": "sha512-JVcQZeXM59Cd1qanDUxv9fgJpt3NeKUaqBqUEvfmQ+BCOKq2xUgaWZW2hr0dkbyJgezYuplEoh5knmrnS68efw==",
|
||||
"requires": {
|
||||
"@babel/helper-get-function-arity": "^7.8.3",
|
||||
"@babel/template": "^7.8.3",
|
||||
"@babel/types": "^7.9.5"
|
||||
}
|
||||
},
|
||||
"@babel/parser": {
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.0.tgz",
|
||||
"integrity": "sha512-fnDUl1Uy2gThM4IFVW4ISNHqr3cJrCsRkSCasFgx0XDO9JcttDS5ytyBc4Cu4X1+fjoo3IVvFbRD6TeFlHJlEQ=="
|
||||
},
|
||||
"@babel/template": {
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.0.tgz",
|
||||
"integrity": "sha512-aMLEQn5tcG49LEWrsEwxiRTdaJmvLem3+JMCMSeCy2TILau0IDVyWdm/18ACx7XOCady64FLt6KkHy28tkDQHQ==",
|
||||
"requires": {
|
||||
"@babel/code-frame": "^7.8.3",
|
||||
"@babel/parser": "^7.10.0",
|
||||
"@babel/types": "^7.10.0"
|
||||
}
|
||||
},
|
||||
"@babel/traverse": {
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.10.0.tgz",
|
||||
"integrity": "sha512-NZsFleMaLF1zX3NxbtXI/JCs2RPOdpGru6UBdGsfhdsDsP+kFF+h2QQJnMJglxk0kc69YmMFs4A44OJY0tKo5g==",
|
||||
"requires": {
|
||||
"@babel/code-frame": "^7.8.3",
|
||||
"@babel/generator": "^7.10.0",
|
||||
"@babel/helper-function-name": "^7.9.5",
|
||||
"@babel/helper-split-export-declaration": "^7.8.3",
|
||||
"@babel/parser": "^7.10.0",
|
||||
"@babel/types": "^7.10.0",
|
||||
"debug": "^4.1.0",
|
||||
"globals": "^11.1.0",
|
||||
"lodash": "^4.17.13"
|
||||
}
|
||||
},
|
||||
"@babel/types": {
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.0.tgz",
|
||||
"integrity": "sha512-t41W8yWFyQFPOAAvPvjyRhejcLGnJTA3iRpFcDbEKwVJ3UnHQePFzLk8GagTsucJlImyNwrGikGsYURrWbQG8w==",
|
||||
"requires": {
|
||||
"@babel/helper-validator-identifier": "^7.9.5",
|
||||
"lodash": "^4.17.13",
|
||||
"to-fast-properties": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"debug": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
|
||||
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
|
||||
"requires": {
|
||||
"ms": "^2.1.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@babel/highlight": {
|
||||
@ -713,11 +894,18 @@
|
||||
}
|
||||
},
|
||||
"@babel/runtime": {
|
||||
"version": "7.8.4",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.8.4.tgz",
|
||||
"integrity": "sha512-neAp3zt80trRVBI1x0azq6c57aNBqYZH8KhMm3TaB7wEI5Q4A2SHfBHE8w9gOhI/lrqxtEbXZgQIrHP+wvSGwQ==",
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.10.0.tgz",
|
||||
"integrity": "sha512-tgYb3zVApHbLHYOPWtVwg25sBqHhfBXRKeKoTIyoheIxln1nA7oBl7SfHfiTG2GhDPI8EUBkOD/0wJCP/3HN4Q==",
|
||||
"requires": {
|
||||
"regenerator-runtime": "^0.13.2"
|
||||
"regenerator-runtime": "^0.13.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"regenerator-runtime": {
|
||||
"version": "0.13.5",
|
||||
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz",
|
||||
"integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"@babel/template": {
|
||||
@ -775,6 +963,14 @@
|
||||
"minimist": "^1.2.0"
|
||||
}
|
||||
},
|
||||
"@egjs/hammerjs": {
|
||||
"version": "2.0.17",
|
||||
"resolved": "https://registry.npmjs.org/@egjs/hammerjs/-/hammerjs-2.0.17.tgz",
|
||||
"integrity": "sha512-XQsZgjm2EcVUiZQf11UBJQfmZeEmOW8DpI1gsFeln6w0ae0ii4dMQEQ0kjl6DspdWX1aGY1/loyXnP0JS06e/A==",
|
||||
"requires": {
|
||||
"@types/hammerjs": "^2.0.36"
|
||||
}
|
||||
},
|
||||
"@hapi/address": {
|
||||
"version": "2.1.4",
|
||||
"resolved": "https://registry.npmjs.org/@hapi/address/-/address-2.1.4.tgz",
|
||||
@ -1099,9 +1295,9 @@
|
||||
}
|
||||
},
|
||||
"@react-native-community/masked-view": {
|
||||
"version": "0.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@react-native-community/masked-view/-/masked-view-0.1.6.tgz",
|
||||
"integrity": "sha512-PpMoeXwPUoldCRKDuSi+zK5rT+sJTW6ri6RdGPkSKRzU77Q1d9IaR0O5IKvBj0XSdL3p+dcOa05gk35aGDffBQ=="
|
||||
"version": "0.1.10",
|
||||
"resolved": "https://registry.npmjs.org/@react-native-community/masked-view/-/masked-view-0.1.10.tgz",
|
||||
"integrity": "sha512-rk4sWFsmtOw8oyx8SD3KSvawwaK7gRBSEIy2TAwURyGt+3TizssXP1r8nx3zY+R7v2vYYHXZ+k2/GULAT/bcaQ=="
|
||||
},
|
||||
"@react-navigation/core": {
|
||||
"version": "3.5.2",
|
||||
@ -1170,6 +1366,11 @@
|
||||
"integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/hammerjs": {
|
||||
"version": "2.0.36",
|
||||
"resolved": "https://registry.npmjs.org/@types/hammerjs/-/hammerjs-2.0.36.tgz",
|
||||
"integrity": "sha512-7TUK/k2/QGpEAv/BCwSHlYu3NXZhQ9ZwBYpzr9tjlPIL2C5BeGhH3DmVavRx3ZNyELX5TLC91JTz/cen6AAtIQ=="
|
||||
},
|
||||
"@types/istanbul-lib-coverage": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz",
|
||||
@ -2346,11 +2547,6 @@
|
||||
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.8.19.tgz",
|
||||
"integrity": "sha512-7kqOoj3oQSmqbvtvGFLU5iYqies+SqUiEGNT0UtUPPxcPYgY1BrkXR0Cq2R9HYSimBXN+xHkEN4Hi399W+Ovlg=="
|
||||
},
|
||||
"debounce": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.0.tgz",
|
||||
"integrity": "sha512-mYtLl1xfZLi1m4RtQYlZgJUNQjl4ZxVnHzIR8nLLgi4q1YT8o/WM+MK/f8yfcc9s5Ir5zRaPZyZU6xs1Syoocg=="
|
||||
},
|
||||
"debug": {
|
||||
"version": "2.6.9",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||
@ -4017,11 +4213,6 @@
|
||||
"resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz",
|
||||
"integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE="
|
||||
},
|
||||
"hammerjs": {
|
||||
"version": "2.0.8",
|
||||
"resolved": "https://registry.npmjs.org/hammerjs/-/hammerjs-2.0.8.tgz",
|
||||
"integrity": "sha1-BO93hiz/K7edMPdpIJWTAiK/YPE="
|
||||
},
|
||||
"har-schema": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz",
|
||||
@ -5359,11 +5550,18 @@
|
||||
"dev": true
|
||||
},
|
||||
"json5": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/json5/-/json5-2.1.1.tgz",
|
||||
"integrity": "sha512-l+3HXD0GEI3huGq1njuqtzYK8OYJyXMkOLtQ53pjWh89tvWS2h6l+1zMkYWqlb57+SiQodKZyvMEFb2X+KrFhQ==",
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz",
|
||||
"integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==",
|
||||
"requires": {
|
||||
"minimist": "^1.2.0"
|
||||
"minimist": "^1.2.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"minimist": {
|
||||
"version": "1.2.5",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
|
||||
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"jsonfile": {
|
||||
@ -6990,11 +7188,11 @@
|
||||
}
|
||||
},
|
||||
"react-native-gesture-handler": {
|
||||
"version": "1.5.3",
|
||||
"resolved": "https://registry.npmjs.org/react-native-gesture-handler/-/react-native-gesture-handler-1.5.3.tgz",
|
||||
"integrity": "sha512-y2/jw0uHAQtEPR02PHAah6tdMymrVtZFoHqjlEWdhK807w2sgU5CySYINK/nOTczd+zB4GMX+9euA3VfbGJ5aA==",
|
||||
"version": "1.6.1",
|
||||
"resolved": "https://registry.npmjs.org/react-native-gesture-handler/-/react-native-gesture-handler-1.6.1.tgz",
|
||||
"integrity": "sha512-gQgIKhDiYf754yzhhliagLuLupvGb6ZyBdzYzr7aus3Fyi87TLOw63ers+r4kGw0h26oAWTAdHd34JnF4NeL6Q==",
|
||||
"requires": {
|
||||
"hammerjs": "^2.0.8",
|
||||
"@egjs/hammerjs": "^2.0.17",
|
||||
"hoist-non-react-statics": "^2.3.1",
|
||||
"invariant": "^2.2.4",
|
||||
"prop-types": "^15.7.2"
|
||||
@ -7039,12 +7237,9 @@
|
||||
}
|
||||
},
|
||||
"react-native-screens": {
|
||||
"version": "2.0.0-alpha.32",
|
||||
"resolved": "https://registry.npmjs.org/react-native-screens/-/react-native-screens-2.0.0-alpha.32.tgz",
|
||||
"integrity": "sha512-dMw+dGL8UfcS+RQXfUGpdduSkmQN/8l3CJg9+YAwgrgejUpE1YYFnr2gP4GPhie0sBLBdfLj0svNwY1vhnO0Tg==",
|
||||
"requires": {
|
||||
"debounce": "^1.2.0"
|
||||
}
|
||||
"version": "2.8.0",
|
||||
"resolved": "https://registry.npmjs.org/react-native-screens/-/react-native-screens-2.8.0.tgz",
|
||||
"integrity": "sha512-fUCIQLZX+5XB0ypWX038P3zso54IFFjTsQUZJWEsjC3pp5rPItAt5SzqtJn+uVjcJaczZ+dpIuvj6IFLqkWLZQ=="
|
||||
},
|
||||
"react-native-vector-icons": {
|
||||
"version": "6.6.0",
|
||||
@ -7174,9 +7369,9 @@
|
||||
}
|
||||
},
|
||||
"react-navigation-stack": {
|
||||
"version": "2.0.16",
|
||||
"resolved": "https://registry.npmjs.org/react-navigation-stack/-/react-navigation-stack-2.0.16.tgz",
|
||||
"integrity": "sha512-l6Fqvz0tvs7i9+KHZDW9hdQbzzgE78bq85pLALllyiHBfz/aFAaoNG4RUWNSen+54uU4xLC5uioowxTJPRLQWQ==",
|
||||
"version": "2.5.1",
|
||||
"resolved": "https://registry.npmjs.org/react-navigation-stack/-/react-navigation-stack-2.5.1.tgz",
|
||||
"integrity": "sha512-LNMIIt1B22IohL7Nbyk7Jk4y8lSvFrA6nna1pqx8wwEDlylT9U1NZ719HZibegr3CPJBZKjqpdGCGUd8sE6b8A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"color": "^3.1.2",
|
||||
@ -8885,9 +9080,9 @@
|
||||
}
|
||||
},
|
||||
"yarn": {
|
||||
"version": "1.21.1",
|
||||
"resolved": "https://registry.npmjs.org/yarn/-/yarn-1.21.1.tgz",
|
||||
"integrity": "sha512-dQgmJv676X/NQczpbiDtc2hsE/pppGDJAzwlRiADMTvFzYbdxPj2WO4PcNyriSt2c4jsCMpt8UFRKHUozt21GQ=="
|
||||
"version": "1.22.4",
|
||||
"resolved": "https://registry.npmjs.org/yarn/-/yarn-1.22.4.tgz",
|
||||
"integrity": "sha512-oYM7hi/lIWm9bCoDMEWgffW8aiNZXCWeZ1/tGy0DWrN6vmzjCXIKu2Y21o8DYVBUtiktwKcNoxyGl/2iKLUNGA=="
|
||||
}
|
||||
}
|
||||
}
|
||||
|
16
package.json
16
package.json
@ -11,28 +11,30 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-native-community/async-storage": "^1.7.1",
|
||||
"@react-native-community/masked-view": "^0.1.6",
|
||||
"@react-native-community/masked-view": "^0.1.10",
|
||||
"i18n-js": "^3.5.1",
|
||||
"react": "16.9.0",
|
||||
"react-addons-update": "^15.6.2",
|
||||
"react-native": "0.61.5",
|
||||
"react-native-fs": "^2.16.4",
|
||||
"react-native-gesture-handler": "^1.5.3",
|
||||
"react-native-gesture-handler": "^1.6.1",
|
||||
"react-native-image-crop-picker": "^0.28.0",
|
||||
"react-native-localize": "^1.4.0",
|
||||
"react-native-safe-area-context": "^0.6.4",
|
||||
"react-native-screens": "^2.0.0-alpha.32",
|
||||
"react-native-screens": "^2.8.0",
|
||||
"react-native-vector-icons": "^6.6.0",
|
||||
"react-navigation": "^4.1.0",
|
||||
"yarn": "^1.21.1"
|
||||
"yarn": "^1.22.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.6.2",
|
||||
"@babel/runtime": "^7.6.2",
|
||||
"@babel/core": "^7.10.0",
|
||||
"@babel/runtime": "^7.10.0",
|
||||
"@react-native-community/eslint-config": "^0.0.5",
|
||||
"babel-jest": "^24.9.0",
|
||||
"eslint": "^6.5.1",
|
||||
"jest": "^24.9.0",
|
||||
"metro-react-native-babel-preset": "^0.56.0",
|
||||
"react-navigation-stack": "^2.0.16",
|
||||
"react-navigation-stack": "^2.5.1",
|
||||
"react-test-renderer": "16.9.0"
|
||||
},
|
||||
"jest": {
|
||||
|
39
src/locales/en.js
Normal file
39
src/locales/en.js
Normal file
@ -0,0 +1,39 @@
|
||||
|
||||
export default {
|
||||
header_home: 'Home',
|
||||
header_add: 'Add',
|
||||
header_edit: 'Edit',
|
||||
|
||||
main_empty_string: 'Touch + button on top right to add a card',
|
||||
|
||||
edit_random: 'Random Generate',
|
||||
edit_preview: 'Preview',
|
||||
edit_sid_notice: 'SID is 16-digit hexadecimal number. Note that it is not a card number!',
|
||||
|
||||
edit_background: 'Background',
|
||||
edit_background_empty: 'Touch here to select the background image',
|
||||
edit_background_selected: 'The image has been selected',
|
||||
|
||||
edit_name: 'Name',
|
||||
|
||||
alert_delete_title: 'Delete',
|
||||
alert_delete_content: 'Do you want to delete this card?',
|
||||
alert_delete_yes: 'Yes',
|
||||
alert_delete_no: 'No',
|
||||
|
||||
alert_save_content: 'Card saved successfully.',
|
||||
alert_save_yes: 'OK',
|
||||
|
||||
alert_not_support_title: 'This device is not supported',
|
||||
alert_not_support_content: 'This device does not have the feature to emulate card.',
|
||||
alert_not_support_yes: 'OK',
|
||||
|
||||
alert_nfc_title: 'NFC is disabled',
|
||||
alert_nfc_content: 'NFC is required to emulate card. Please enable NFC in the settings and restart the app.',
|
||||
alert_nfc_yes: 'OK',
|
||||
|
||||
card_touch_to_enable: 'Touch to enable',
|
||||
card_touch_to_disable: 'Touch to disable',
|
||||
card_delete: 'Delete',
|
||||
card_edit: 'Edit',
|
||||
}
|
40
src/locales/ko.js
Normal file
40
src/locales/ko.js
Normal file
@ -0,0 +1,40 @@
|
||||
|
||||
export default {
|
||||
header_home: '홈',
|
||||
header_add: '카드 추가',
|
||||
header_edit: '카드 편집',
|
||||
|
||||
main_empty_string: '우측 상단의 +를 눌러 카드를 추가해주세요',
|
||||
|
||||
edit_random: '랜덤 생성',
|
||||
edit_preview: '미리보기',
|
||||
edit_sid_notice: 'SID는 16진수 16자리 입니다. 카드 번호가 아님에 유의하세요!',
|
||||
|
||||
edit_background: '카드 배경',
|
||||
edit_background_empty: '여기를 눌러 사진을 선택할 수 있습니다.',
|
||||
edit_background_selected: '사진이 선택되었습니다.',
|
||||
|
||||
edit_name: '카드 이름',
|
||||
|
||||
alert_delete_title: '삭제',
|
||||
alert_delete_content: '카드를 삭제하시겠습니까?',
|
||||
alert_delete_yes: '예',
|
||||
alert_delete_no: '아니오',
|
||||
|
||||
alert_save_content: '카드를 저장했습니다.',
|
||||
alert_save_yes: '확인',
|
||||
|
||||
alert_not_support_title: '이 기기는 지원되지 않습니다.',
|
||||
alert_not_support_content: '이 기기는 카드를 에뮬레이션 하기 위해 필요한 기능을 가지고 있지 않습니다.',
|
||||
alert_not_support_yes: '확인',
|
||||
|
||||
alert_nfc_title: 'NFC가 활성화 되어있지 않습니다.',
|
||||
alert_nfc_content: '카드를 에뮬레이션 하기 위해서 NFC가 필요합니다. 설정에서 NFC를 활성화하고 앱을 재실행해주세요.',
|
||||
alert_nfc_yes: '확인',
|
||||
|
||||
card_touch_to_enable: '터치하여 활성화',
|
||||
card_touch_to_disable: '터치하여 비활성화',
|
||||
card_delete: '삭제',
|
||||
card_edit: '편집',
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ import update from 'react-addons-update';
|
||||
import Icon from 'react-native-vector-icons/MaterialIcons';
|
||||
import ImagePicker from 'react-native-image-crop-picker';
|
||||
import CardConv from '../module/CardConv';
|
||||
import i18n from 'i18n-js';
|
||||
|
||||
class CardPreview extends React.Component {
|
||||
render() {
|
||||
@ -37,7 +38,7 @@ class CardPreview extends React.Component {
|
||||
}
|
||||
</Text>
|
||||
<Text style={{paddingTop: 8, textAlign: 'center', alignSelf: 'center', fontSize: 24, color:'#FAFAFA', fontWeight: '500', letterSpacing:-0.5}}>
|
||||
{'터치하여 활성화'}
|
||||
{i18n.t('card_touch_to_enable')}
|
||||
</Text>
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
@ -49,7 +50,7 @@ class CardPreview extends React.Component {
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
}}>
|
||||
<Text style={{fontSize: 14, color:'#FAFAFA'}}>편집</Text>
|
||||
<Text style={{fontSize: 14, color:'#FAFAFA'}}>{i18n.t('card_edit')}</Text>
|
||||
</TouchableOpacity>
|
||||
<View style={{width: 1, backgroundColor: '#FAFAFA'}}/>
|
||||
<TouchableOpacity style={{
|
||||
@ -57,7 +58,7 @@ class CardPreview extends React.Component {
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
}}>
|
||||
<Text style={{fontSize: 14, color:'#ffffff'}}>삭제</Text>
|
||||
<Text style={{fontSize: 14, color:'#ffffff'}}>{i18n.t('card_delete')}</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
</View>
|
||||
@ -292,7 +293,7 @@ class CardEditScreen extends React.Component {
|
||||
fontWeight: 'bold',
|
||||
textAlignVertical: 'center',
|
||||
}}>
|
||||
{this.state.mode === 'add' ? '카드 추가' : '카드 편집'}
|
||||
{this.state.mode === 'add' ? i18n.t('header_add') : i18n.t('header_edit')}
|
||||
</Text>
|
||||
|
||||
<TouchableOpacity style={{
|
||||
@ -309,9 +310,9 @@ class CardEditScreen extends React.Component {
|
||||
</View>
|
||||
</View>
|
||||
<ScrollView style={{flex: 1, paddingHorizontal: 24, paddingTop: 16,}}>
|
||||
<ETextInput title={'카드 이름'} value={this.state.name} onChangeText={text => this.setState({name: text})} ref={ref => this.nameInput = ref}/>
|
||||
<ETextInput title={i18n.t('edit_name')} value={this.state.name} onChangeText={text => this.setState({name: text})} ref={ref => this.nameInput = ref}/>
|
||||
<TouchableOpacity onPress={() => this.selectPhoto()}>
|
||||
<ETextInput style={{marginTop: 24,}} title={'카드 배경'} value={this.state.image ? '사진이 선택되었습니다.' : '여기를 눌러 사진을 선택할 수 있습니다.'} editable={false}/>
|
||||
<ETextInput style={{marginTop: 24,}} title={i18n.t('edit_background')} value={this.state.image ? i18n.t('edit_background_selected') : i18n.t('edit_background_empty')} editable={false}/>
|
||||
</TouchableOpacity>
|
||||
|
||||
<View style={{marginTop: 24, flexDirection: 'row'}}>
|
||||
@ -366,15 +367,15 @@ class CardEditScreen extends React.Component {
|
||||
/>
|
||||
</View>
|
||||
<Text style={{marginTop: 8, fontSize: 14, letterSpacing: -0.4, color: this.state.sidError ? '#F44336' : '#9E9E9E'}}>
|
||||
{'SID는 16진수 16자리 입니다. 카드 번호가 아님에 유의하세요!'}
|
||||
{i18n.t('edit_sid_notice')}
|
||||
</Text>
|
||||
<TouchableOpacity style={{marginTop: 24, height: 48, backgroundColor: '#03A9F4', borderRadius:8, alignItems:'center', justifyContent:'center',}}
|
||||
onPress={() => this.setRandomSid()}
|
||||
>
|
||||
<Text style={{fontSize: 17, color: '#ffffff', fontWeight: '500'}}>랜덤 생성</Text>
|
||||
<Text style={{fontSize: 17, color: '#ffffff', fontWeight: '500'}}>{i18n.t('edit_random')}</Text>
|
||||
</TouchableOpacity>
|
||||
|
||||
<Text style={{fontSize: 14, color: '#9E9E9E', marginTop: 20, fontWeight: 'bold'}}>미리보기</Text>
|
||||
<Text style={{fontSize: 14, color: '#9E9E9E', marginTop: 20, fontWeight: 'bold'}}>{i18n.t('edit_preview')}</Text>
|
||||
<CardPreview name={this.state.name} uid={this.state.uid} image={this.state.image} cardHeight={this.state.cardHeight ?? 0}/>
|
||||
|
||||
<View style={{height: 50}}/>
|
||||
|
@ -18,6 +18,7 @@ import Hcef from '../module/Hcef';
|
||||
import CardConv from '../module/CardConv';
|
||||
import AsyncStorage from '@react-native-community/async-storage';
|
||||
import Icon from 'react-native-vector-icons/MaterialIcons';
|
||||
import i18n from 'i18n-js';
|
||||
|
||||
|
||||
const RNFS = require('react-native-fs');
|
||||
@ -33,9 +34,7 @@ class Card extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
let cardContent = (
|
||||
|
||||
<View style={{flex: 1, backgroundColor:'rgba(0,0,0,0.3)', borderRadius:8}}>
|
||||
<View style={{flex: 1,}}>
|
||||
<TouchableOpacity style={{flex: 1}} onPress={this.onPress.bind(this)}>
|
||||
@ -48,7 +47,7 @@ class Card extends React.Component {
|
||||
{this.props.card.uid.substr(0,4)+'-'+this.props.card.uid.substr(4,4)+'-'+this.props.card.uid.substr(8,4)+'-'+this.props.card.uid.substr(12,4)}
|
||||
</Text>
|
||||
<Text style={{paddingTop: 8, textAlign: 'center', alignSelf: 'center', fontSize: 24, color:'#FAFAFA', fontWeight: '500', letterSpacing:-0.5}}>
|
||||
{this.props.card.enabled ? '터치하여 비활성화' : '터치하여 활성화'}
|
||||
{this.props.card.enabled ? i18n.t('card_touch_to_disable') : i18n.t('card_touch_to_enable')}
|
||||
</Text>
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
@ -60,7 +59,7 @@ class Card extends React.Component {
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
}} onPress={() => this.props.navigation.navigate('CardEditScreen', {name: this.props.card.name, sid: this.props.card.sid, image: this.props.card.image, index: this.props.index, update: this.props.update})}>
|
||||
<Text style={{fontSize: 14, color:'#FAFAFA'}}>편집</Text>
|
||||
<Text style={{fontSize: 14, color:'#FAFAFA'}}>{i18n.t('card_edit')}</Text>
|
||||
</TouchableOpacity>
|
||||
<View style={{width: 1, backgroundColor: '#FAFAFA'}}/>
|
||||
<TouchableOpacity style={{
|
||||
@ -68,11 +67,12 @@ class Card extends React.Component {
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
}} onPress={() => this.props.delete(this.props.index)}>
|
||||
<Text style={{fontSize: 14, color:'#ffffff'}}>삭제</Text>
|
||||
<Text style={{fontSize: 14, color:'#ffffff'}}>{i18n.t('card_delete')}</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
|
||||
return (
|
||||
<View style={[{
|
||||
borderRadius: 8,
|
||||
@ -114,7 +114,6 @@ class MainScreen extends React.Component {
|
||||
cards: [],
|
||||
cardHeight: 1,
|
||||
support: false,
|
||||
history: {},
|
||||
};
|
||||
|
||||
async loadCards(){
|
||||
@ -122,23 +121,18 @@ class MainScreen extends React.Component {
|
||||
this.setState({cards: cardsJson ? JSON.parse(cardsJson) : []});
|
||||
}
|
||||
|
||||
async loadHistory(){
|
||||
let historyJson = await AsyncStorage.getItem('history');
|
||||
this.setState({history: historyJson ? JSON.parse(historyJson) : {}});
|
||||
}
|
||||
|
||||
componentDidMount(){
|
||||
this.prevCard = null;
|
||||
this.prevIndex = -1;
|
||||
this.loadCards();
|
||||
this.loadHistory();
|
||||
|
||||
if(Hcef.support !== true){
|
||||
Alert.alert("이 기기는 지원하지 않습니다.", "이 기기는 앱을 실행하기 위해 필요한 기능을 가지고 있지 않습니다. 앱을 사용해도 카드를 에뮬레이션 할 수 없습니다.",
|
||||
[{text: '확인', onPress: () => {}}]);
|
||||
Alert.alert(i18n.t('alert_not_support_title'), i18n.t('alert_not_support_content'),
|
||||
[{text: i18n.t('alert_not_support_yes')}]);
|
||||
}
|
||||
else if(Hcef.enabled !== true){
|
||||
Alert.alert("NFC가 활성화 되어있지 않습니다.", "이 앱을 사용하기 위해서는 NFC가 필요합니다. 설정에서 NFC를 활성화하고 기본 NFC 설정이 존재한다면 안드로이드 운영체제 혹은 자동 선택으로 설정하고 앱을 재실행해주세요.");
|
||||
Alert.alert(i18n.t('alert_nfc_title'), i18n.t('alert_nfc_content'),
|
||||
[{text: i18n.t('alert_nfc_yes')}]);
|
||||
}
|
||||
|
||||
if(Hcef.support && Hcef.enabled){
|
||||
@ -210,52 +204,31 @@ class MainScreen extends React.Component {
|
||||
internalPath = 'file://' + internalPath;
|
||||
}
|
||||
|
||||
let remain = 5;
|
||||
|
||||
let nowDate = new Date();
|
||||
let key = nowDate.getFullYear() + '-' + nowDate.getMonth() + '-' + nowDate.getDate();
|
||||
|
||||
if(index === null || this.state.cards[index].sid !== sid){
|
||||
if(this.state.history[key] === undefined){
|
||||
this.state.history[key] = 1;
|
||||
}
|
||||
else if(this.state.history[key] < 5){
|
||||
this.state.history[key] += 1;
|
||||
}
|
||||
else{
|
||||
Alert.alert("", "오늘 생성할 수 있는 카드번호를 모두 생성했습니다. 나중에 다시 시도해주세요.",
|
||||
[{text: '확인', onPress: () => {navigation.goBack();}}]);
|
||||
return ;
|
||||
}
|
||||
}
|
||||
|
||||
remain = 5 - this.state.history[key] ;
|
||||
|
||||
if(index === null){
|
||||
this.setState({cards: update(this.state.cards, { $push: [{name: name, sid: sid, uid: uid, image: internalPath}]})},
|
||||
async () => {
|
||||
await AsyncStorage.setItem('cards', JSON.stringify(this.state.cards));
|
||||
await AsyncStorage.setItem('history', JSON.stringify(this.state.history));
|
||||
});
|
||||
}
|
||||
else{
|
||||
this.setState({cards: update(this.state.cards, { [index]: { name: {$set: name}, sid: {$set: sid}, uid: {$set: uid}, image: {$set: internalPath} }})},
|
||||
async () =>{
|
||||
await AsyncStorage.setItem('cards', JSON.stringify(this.state.cards));
|
||||
await AsyncStorage.setItem('history', JSON.stringify(this.state.history));
|
||||
});
|
||||
}
|
||||
|
||||
Alert.alert("", "카드를 저장했습니다. 오늘 앞으로 " + remain + "개의 카드를 추가하거나, 번호를 변경할 수 있습니다.",
|
||||
[{text: '확인', onPress: () => {navigation.goBack();}}]);
|
||||
Alert.alert("", i18n.t('alert_save_content'),
|
||||
[{text: i18n.t('alert_save_yes'), onPress: () => {navigation.goBack();}}]);
|
||||
}
|
||||
|
||||
cardListDelete(index){
|
||||
Alert.alert('','카드를 삭제하시겠습니까?'
|
||||
Alert.alert(i18n.t('alert_delete_title'),i18n.t('alert_delete_content')
|
||||
, [
|
||||
{text: '아니오'},
|
||||
{text: '예', onPress: () => {
|
||||
RNFS.unlink(this.state.cards[index].image);
|
||||
{text: i18n.t('alert_delete_no')},
|
||||
{text: i18n.t('alert_delete_yes'), onPress: () => {
|
||||
if(this.state.cards[index].image !== '' ){
|
||||
RNFS.unlink(this.state.cards[index].image);
|
||||
}
|
||||
this.setState({
|
||||
cards: update(this.state.cards, {
|
||||
$splice: [[index, 1]]
|
||||
@ -303,7 +276,7 @@ class MainScreen extends React.Component {
|
||||
fontWeight: 'bold',
|
||||
textAlignVertical: 'center',
|
||||
}}>
|
||||
홈
|
||||
{i18n.t('header_home')}
|
||||
</Text>
|
||||
|
||||
<TouchableOpacity style={{
|
||||
@ -326,7 +299,7 @@ class MainScreen extends React.Component {
|
||||
</ScrollView>
|
||||
) : (
|
||||
<View style={{flex:1, justifyContent: 'center', alignItems:'center'}}>
|
||||
<Text style={{fontSize: 17, color: '#9E9E9E', }}>{'우측 상단의 +를 눌러 카드를 추가해주세요'}</Text>
|
||||
<Text style={{fontSize: 17, color: '#9E9E9E', }}>{i18n.t('main_empty_string')}</Text>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user