From e05d8f3b15df2f98fbfba7b9937e0a4ecd4d0a77 Mon Sep 17 00:00:00 2001 From: Kelly Campbell Date: Wed, 19 Feb 2020 05:16:45 -0500 Subject: [PATCH 001/149] Return error if isProtectedDataAvailable = false Addresses issue #72 where SecItemCOpyMatching doesn't return data and doesn't give an error when the protected files are not yet available. This will now give an error instead of empty results, allowing the caller to retry after some delay. --- ios/RNSensitiveInfo/RNSensitiveInfo.m | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ios/RNSensitiveInfo/RNSensitiveInfo.m b/ios/RNSensitiveInfo/RNSensitiveInfo.m index 0c77b7c0..b3361046 100644 --- a/ios/RNSensitiveInfo/RNSensitiveInfo.m +++ b/ios/RNSensitiveInfo/RNSensitiveInfo.m @@ -215,7 +215,15 @@ - (NSString *)messageForError:(NSError *)error return; } - [self getItemWithQuery:query resolver:resolve rejecter:reject]; + dispatch_async(dispatch_get_main_queue(), ^{ + if (UIApplication.sharedApplication.protectedDataAvailable) { + [self getItemWithQuery:query resolver:resolve rejecter:reject]; + } else { + // TODO: could change to instead of erroring out, listen for protectedDataDidBecomeAvailable and call getItemWIthQuery when it does + // Experiment for now by returning an error and let the js side retry + reject(@"protected_data_unavailable", @"Protected data not available yet. Retry operation", nil); + } + }); } - (void)getItemWithQuery:(NSDictionary *)query resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject { From b8fc4cb234d9ebb15954b4acd59f709a53fa4de0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 14 Mar 2020 08:41:52 +0000 Subject: [PATCH 002/149] Bump acorn from 5.7.3 to 5.7.4 in /example Bumps [acorn](https://github.com/acornjs/acorn) from 5.7.3 to 5.7.4. - [Release notes](https://github.com/acornjs/acorn/releases) - [Commits](https://github.com/acornjs/acorn/compare/5.7.3...5.7.4) Signed-off-by: dependabot[bot] --- example/yarn.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/example/yarn.lock b/example/yarn.lock index 6334f0c7..2da1db7f 100644 --- a/example/yarn.lock +++ b/example/yarn.lock @@ -1137,9 +1137,9 @@ acorn-walk@^6.0.1: integrity sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA== acorn@^5.5.3: - version "5.7.3" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" - integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== + version "5.7.4" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.4.tgz#3e8d8a9947d0599a1796d10225d7432f4a4acf5e" + integrity sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg== acorn@^6.0.1: version "6.3.0" @@ -5164,7 +5164,7 @@ react-is@^16.8.1, react-is@^16.8.4, react-is@^16.9.0: integrity sha512-INBT1QEgtcCCgvccr5/86CfD71fw9EPmDxgiJX4I2Ddr6ZsV6iFXsuby+qWJPtmNuMY0zByTsG4468P7nHuNWA== "react-native-sensitive-info@file:..": - version "5.5.3" + version "5.5.5" react-native@0.61.2: version "0.61.2" From bcab2c96d5e03a517f5fbe2dfe059d531129d5fa Mon Sep 17 00:00:00 2001 From: Philip Shen Date: Fri, 20 Mar 2020 11:07:13 -0700 Subject: [PATCH 003/149] Allow kSecAttrSynchronizable to be set from deleteItem --- ios/RNSensitiveInfo/RNSensitiveInfo.m | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/ios/RNSensitiveInfo/RNSensitiveInfo.m b/ios/RNSensitiveInfo/RNSensitiveInfo.m index 0c77b7c0..34fe0a92 100644 --- a/ios/RNSensitiveInfo/RNSensitiveInfo.m +++ b/ios/RNSensitiveInfo/RNSensitiveInfo.m @@ -116,19 +116,20 @@ - (NSString *)messageForError:(NSError *)error if (keychainService == NULL) { keychainService = @"app"; } + + NSNumber *sync = options[@"kSecAttrSynchronizable"]; + if (sync == NULL) + sync = (__bridge id)kSecAttrSynchronizableAny; NSData* valueData = [value dataUsingEncoding:NSUTF8StringEncoding]; NSMutableDictionary* search = [NSMutableDictionary dictionaryWithObjectsAndKeys: (__bridge id)(kSecClassGenericPassword), kSecClass, keychainService, kSecAttrService, + sync, kSecAttrSynchronizable, key, kSecAttrAccount, nil]; NSMutableDictionary *query = [search mutableCopy]; [query setValue: valueData forKey: kSecValueData]; - if([RCTConvert BOOL:options[@"kSecAttrSynchronizable"]]){ - [query setValue:@YES forKey:(NSString *)kSecAttrSynchronizable]; - } - if([RCTConvert BOOL:options[@"touchID"]]){ CFStringRef kSecAccessControlValue = convertkSecAccessControl([RCTConvert NSString:options[@"kSecAccessControl"]]); SecAccessControlRef sac = SecAccessControlCreateWithFlags(kCFAllocatorDefault, kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly, kSecAccessControlValue, NULL); @@ -305,11 +306,15 @@ - (void)getItemWithQuery:(NSDictionary *)query resolver:(RCTPromiseResolveBlock) if (keychainService == NULL) { keychainService = @"app"; } + + NSNumber *sync = options[@"kSecAttrSynchronizable"]; + if (sync == NULL) + sync = (__bridge id)kSecAttrSynchronizableAny; // Create dictionary of search parameters NSDictionary* query = [NSDictionary dictionaryWithObjectsAndKeys: (__bridge id)(kSecClassGenericPassword), kSecClass, - (__bridge id)(kSecAttrSynchronizableAny), kSecAttrSynchronizable, + sync, kSecAttrSynchronizable, keychainService, kSecAttrService, key, kSecAttrAccount, kCFBooleanTrue, kSecReturnAttributes, From 583a887d45729b0ab779adde7843719d5f53ce7a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 4 Apr 2020 13:15:03 +0000 Subject: [PATCH 004/149] Bump acorn from 7.1.0 to 7.1.1 Bumps [acorn](https://github.com/acornjs/acorn) from 7.1.0 to 7.1.1. - [Release notes](https://github.com/acornjs/acorn/releases) - [Commits](https://github.com/acornjs/acorn/compare/7.1.0...7.1.1) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2d65ce6c..3f43c5a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -167,9 +167,9 @@ acorn-jsx@^5.1.0: integrity sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw== acorn@^7.1.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.0.tgz#949d36f2c292535da602283586c2477c57eb2d6c" - integrity sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ== + version "7.1.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.1.tgz#e35668de0b402f359de515c5482a1ab9f89a69bf" + integrity sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg== ajv@^6.10.0, ajv@^6.10.2: version "6.12.0" From 51619c78999948a27ad6e52bddd36ff26ed9b1df Mon Sep 17 00:00:00 2001 From: Mateus Andrade Date: Wed, 10 Jun 2020 16:58:01 -0300 Subject: [PATCH 005/149] added stale bot --- .github/stale.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/stale.yml diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 00000000..d9f65632 --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,17 @@ +# Number of days of inactivity before an issue becomes stale +daysUntilStale: 60 +# Number of days of inactivity before a stale issue is closed +daysUntilClose: 7 +# Issues with these labels will never be considered stale +exemptLabels: + - pinned + - security +# Label to use when marking an issue as stale +staleLabel: wontfix +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: false \ No newline at end of file From 28b6cdb7eb934d29ac662dda611029b5212531fe Mon Sep 17 00:00:00 2001 From: Mateus Andrade Date: Wed, 10 Jun 2020 17:43:08 -0300 Subject: [PATCH 006/149] generating docusaurs website structure --- .dockerignore | 2 + Dockerfile | 10 + docker-compose.yml | 18 + docs/installation.md | 38 + website/README.md | 198 + website/core/Footer.js | 126 + website/i18n/en.json | 25 + website/package.json | 14 + website/pages/en/help.js | 54 + website/pages/en/index.js | 212 + website/pages/en/users.js | 48 + website/sidebars.json | 5 + website/siteConfig.js | 105 + website/static/css/custom.css | 23 + website/static/img/favicon.ico | Bin 0 -> 766 bytes website/static/img/oss_logo.png | Bin 0 -> 4370 bytes website/static/img/undraw_code_review.svg | 1 + website/static/img/undraw_monitor.svg | 1 + website/static/img/undraw_note_list.svg | 1 + website/static/img/undraw_online.svg | 1 + website/static/img/undraw_open_source.svg | 1 + .../static/img/undraw_operating_system.svg | 1 + website/static/img/undraw_react.svg | 1 + website/static/img/undraw_tweetstorm.svg | 1 + .../static/img/undraw_youtube_tutorial.svg | 1 + website/yarn.lock | 6632 +++++++++++++++++ 26 files changed, 7519 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 docs/installation.md create mode 100644 website/README.md create mode 100644 website/core/Footer.js create mode 100644 website/i18n/en.json create mode 100644 website/package.json create mode 100644 website/pages/en/help.js create mode 100644 website/pages/en/index.js create mode 100644 website/pages/en/users.js create mode 100644 website/sidebars.json create mode 100644 website/siteConfig.js create mode 100644 website/static/css/custom.css create mode 100644 website/static/img/favicon.ico create mode 100644 website/static/img/oss_logo.png create mode 100644 website/static/img/undraw_code_review.svg create mode 100644 website/static/img/undraw_monitor.svg create mode 100644 website/static/img/undraw_note_list.svg create mode 100644 website/static/img/undraw_online.svg create mode 100644 website/static/img/undraw_open_source.svg create mode 100644 website/static/img/undraw_operating_system.svg create mode 100644 website/static/img/undraw_react.svg create mode 100644 website/static/img/undraw_tweetstorm.svg create mode 100644 website/static/img/undraw_youtube_tutorial.svg create mode 100644 website/yarn.lock diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..27d2dae2 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +*/node_modules +*.log diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..c7f1856c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM node:lts + +WORKDIR /app/website + +EXPOSE 3000 35729 +COPY ./docs /app/docs +COPY ./website /app/website +RUN yarn install + +CMD ["yarn", "start"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..6711192a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +version: "3" + +services: + docusaurus: + build: . + ports: + - 3000:3000 + - 35729:35729 + volumes: + - ./docs:/app/docs + - ./website/blog:/app/website/blog + - ./website/core:/app/website/core + - ./website/i18n:/app/website/i18n + - ./website/pages:/app/website/pages + - ./website/static:/app/website/static + - ./website/sidebars.json:/app/website/sidebars.json + - ./website/siteConfig.js:/app/website/siteConfig.js + working_dir: /app/website diff --git a/docs/installation.md b/docs/installation.md new file mode 100644 index 00000000..fffbae50 --- /dev/null +++ b/docs/installation.md @@ -0,0 +1,38 @@ +--- +id: installation +title: Installation +sidebar_label: Installation +--- + +Check the [documentation](https://docusaurus.io) for how to use Docusaurus. + +## Lorem + +First of all, install it using `npm` or `yarn` + +``` +npm install --save react-native-sensitive-info +``` + +``` +yarn add react-native-sensitive-info +``` + + +## Mauris In Code + +``` +Mauris vestibulum ullamcorper nibh, ut semper purus pulvinar ut. Donec volutpat orci sit amet mauris malesuada, non pulvinar augue aliquam. Vestibulum ultricies at urna ut suscipit. Morbi iaculis, erat at imperdiet semper, ipsum nulla sodales erat, eget tincidunt justo dui quis justo. Pellentesque dictum bibendum diam at aliquet. Sed pulvinar, dolor quis finibus ornare, eros odio facilisis erat, eu rhoncus nunc dui sed ex. Nunc gravida dui massa, sed ornare arcu tincidunt sit amet. Maecenas efficitur sapien neque, a laoreet libero feugiat ut. +``` + +## Nulla + +Nulla facilisi. Maecenas sodales nec purus eget posuere. Sed sapien quam, pretium a risus in, porttitor dapibus erat. Sed sit amet fringilla ipsum, eget iaculis augue. Integer sollicitudin tortor quis ultricies aliquam. Suspendisse fringilla nunc in tellus cursus, at placerat tellus scelerisque. Sed tempus elit a sollicitudin rhoncus. Nulla facilisi. Morbi nec dolor dolor. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Cras et aliquet lectus. Pellentesque sit amet eros nisi. Quisque ac sapien in sapien congue accumsan. Nullam in posuere ante. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin lacinia leo a nibh fringilla pharetra. + +## Orci + +Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Proin venenatis lectus dui, vel ultrices ante bibendum hendrerit. Aenean egestas feugiat dui id hendrerit. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur in tellus laoreet, eleifend nunc id, viverra leo. Proin vulputate non dolor vel vulputate. Curabitur pretium lobortis felis, sit amet finibus lorem suscipit ut. Sed non mollis risus. Duis sagittis, mi in euismod tincidunt, nunc mauris vestibulum urna, at euismod est elit quis erat. Phasellus accumsan vitae neque eu placerat. In elementum arcu nec tellus imperdiet, eget maximus nulla sodales. Curabitur eu sapien eget nisl sodales fermentum. + +## Phasellus + +Phasellus pulvinar ex id commodo imperdiet. Praesent odio nibh, sollicitudin sit amet faucibus id, placerat at metus. Donec vitae eros vitae tortor hendrerit finibus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Quisque vitae purus dolor. Duis suscipit ac nulla et finibus. Phasellus ac sem sed dui dictum gravida. Phasellus eleifend vestibulum facilisis. Integer pharetra nec enim vitae mattis. Duis auctor, lectus quis condimentum bibendum, nunc dolor aliquam massa, id bibendum orci velit quis magna. Ut volutpat nulla nunc, sed interdum magna condimentum non. Sed urna metus, scelerisque vitae consectetur a, feugiat quis magna. Donec dignissim ornare nisl, eget tempor risus malesuada quis. diff --git a/website/README.md b/website/README.md new file mode 100644 index 00000000..6477a55a --- /dev/null +++ b/website/README.md @@ -0,0 +1,198 @@ +This website was created with [Docusaurus](https://docusaurus.io/). + +# What's In This Document + +- [Get Started in 5 Minutes](#get-started-in-5-minutes) +- [Directory Structure](#directory-structure) +- [Editing Content](#editing-content) +- [Adding Content](#adding-content) +- [Full Documentation](#full-documentation) + +# Get Started in 5 Minutes + +1. Make sure all the dependencies for the website are installed: + +```sh +# Install dependencies +$ yarn +``` + +2. Run your dev server: + +```sh +# Start the site +$ yarn start +``` + +## Directory Structure + +Your project file structure should look something like this + +``` +my-docusaurus/ + docs/ + doc-1.md + doc-2.md + doc-3.md + website/ + blog/ + 2016-3-11-oldest-post.md + 2017-10-24-newest-post.md + core/ + node_modules/ + pages/ + static/ + css/ + img/ + package.json + sidebars.json + siteConfig.js +``` + +# Editing Content + +## Editing an existing docs page + +Edit docs by navigating to `docs/` and editing the corresponding document: + +`docs/doc-to-be-edited.md` + +```markdown +--- +id: page-needs-edit +title: This Doc Needs To Be Edited +--- + +Edit me... +``` + +For more information about docs, click [here](https://docusaurus.io/docs/en/navigation) + +## Editing an existing blog post + +Edit blog posts by navigating to `website/blog` and editing the corresponding post: + +`website/blog/post-to-be-edited.md` + +```markdown +--- +id: post-needs-edit +title: This Blog Post Needs To Be Edited +--- + +Edit me... +``` + +For more information about blog posts, click [here](https://docusaurus.io/docs/en/adding-blog) + +# Adding Content + +## Adding a new docs page to an existing sidebar + +1. Create the doc as a new markdown file in `/docs`, example `docs/newly-created-doc.md`: + +```md +--- +id: newly-created-doc +title: This Doc Needs To Be Edited +--- + +My new content here.. +``` + +1. Refer to that doc's ID in an existing sidebar in `website/sidebars.json`: + +```javascript +// Add newly-created-doc to the Getting Started category of docs +{ + "docs": { + "Getting Started": [ + "quick-start", + "newly-created-doc" // new doc here + ], + ... + }, + ... +} +``` + +For more information about adding new docs, click [here](https://docusaurus.io/docs/en/navigation) + +## Adding a new blog post + +1. Make sure there is a header link to your blog in `website/siteConfig.js`: + +`website/siteConfig.js` + +```javascript +headerLinks: [ + ... + { blog: true, label: 'Blog' }, + ... +] +``` + +2. Create the blog post with the format `YYYY-MM-DD-My-Blog-Post-Title.md` in `website/blog`: + +`website/blog/2018-05-21-New-Blog-Post.md` + +```markdown +--- +author: Frank Li +authorURL: https://twitter.com/foobarbaz +authorFBID: 503283835 +title: New Blog Post +--- + +Lorem Ipsum... +``` + +For more information about blog posts, click [here](https://docusaurus.io/docs/en/adding-blog) + +## Adding items to your site's top navigation bar + +1. Add links to docs, custom pages or external links by editing the headerLinks field of `website/siteConfig.js`: + +`website/siteConfig.js` + +```javascript +{ + headerLinks: [ + ... + /* you can add docs */ + { doc: 'my-examples', label: 'Examples' }, + /* you can add custom pages */ + { page: 'help', label: 'Help' }, + /* you can add external links */ + { href: 'https://github.com/facebook/docusaurus', label: 'GitHub' }, + ... + ], + ... +} +``` + +For more information about the navigation bar, click [here](https://docusaurus.io/docs/en/navigation) + +## Adding custom pages + +1. Docusaurus uses React components to build pages. The components are saved as .js files in `website/pages/en`: +1. If you want your page to show up in your navigation header, you will need to update `website/siteConfig.js` to add to the `headerLinks` element: + +`website/siteConfig.js` + +```javascript +{ + headerLinks: [ + ... + { page: 'my-new-custom-page', label: 'My New Custom Page' }, + ... + ], + ... +} +``` + +For more information about custom pages, click [here](https://docusaurus.io/docs/en/custom-pages). + +# Full Documentation + +Full documentation can be found on the [website](https://docusaurus.io/). diff --git a/website/core/Footer.js b/website/core/Footer.js new file mode 100644 index 00000000..c2b317c9 --- /dev/null +++ b/website/core/Footer.js @@ -0,0 +1,126 @@ +/** + * Copyright (c) 2017-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const React = require('react'); + +class Footer extends React.Component { + docUrl(doc, language) { + const baseUrl = this.props.config.baseUrl; + const docsUrl = this.props.config.docsUrl; + const docsPart = `${docsUrl ? `${docsUrl}/` : ''}`; + const langPart = `${language ? `${language}/` : ''}`; + return `${baseUrl}${docsPart}${langPart}${doc}`; + } + + pageUrl(doc, language) { + const baseUrl = this.props.config.baseUrl; + return baseUrl + (language ? `${language}/` : '') + doc; + } + + render() { + return ( + + ); + } +} + +module.exports = Footer; diff --git a/website/i18n/en.json b/website/i18n/en.json new file mode 100644 index 00000000..80c6c575 --- /dev/null +++ b/website/i18n/en.json @@ -0,0 +1,25 @@ +{ + "_comment": "This file is auto-generated by write-translations.js", + "localized-strings": { + "next": "Next", + "previous": "Previous", + "tagline": "A website for testing", + "docs": { + "installation": { + "title": "Installation", + "sidebar_label": "Installation" + } + }, + "links": { + "Docs": "Docs" + }, + "categories": { + "Introduction": "Introduction" + } + }, + "pages-strings": { + "Help Translate|recruit community translators for your project": "Help Translate", + "Edit this Doc|recruitment message asking to edit the doc source": "Edit", + "Translate this Doc|recruitment message asking to translate the docs": "Translate" + } +} diff --git a/website/package.json b/website/package.json new file mode 100644 index 00000000..1f87392a --- /dev/null +++ b/website/package.json @@ -0,0 +1,14 @@ +{ + "scripts": { + "examples": "docusaurus-examples", + "start": "docusaurus-start", + "build": "docusaurus-build", + "publish-gh-pages": "docusaurus-publish", + "write-translations": "docusaurus-write-translations", + "version": "docusaurus-version", + "rename-version": "docusaurus-rename-version" + }, + "devDependencies": { + "docusaurus": "^1.14.4" + } +} diff --git a/website/pages/en/help.js b/website/pages/en/help.js new file mode 100644 index 00000000..2b790e46 --- /dev/null +++ b/website/pages/en/help.js @@ -0,0 +1,54 @@ +/** + * Copyright (c) 2017-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const React = require('react'); + +const CompLibrary = require('../../core/CompLibrary.js'); + +const Container = CompLibrary.Container; +const GridBlock = CompLibrary.GridBlock; + +function Help(props) { + const {config: siteConfig, language = ''} = props; + const {baseUrl, docsUrl} = siteConfig; + const docsPart = `${docsUrl ? `${docsUrl}/` : ''}`; + const langPart = `${language ? `${language}/` : ''}`; + const docUrl = doc => `${baseUrl}${docsPart}${langPart}${doc}`; + + const supportLinks = [ + { + content: `Learn more using the [documentation on this site.](${docUrl( + 'doc1.html', + )})`, + title: 'Browse Docs', + }, + { + content: 'Ask questions about the documentation and project', + title: 'Join the community', + }, + { + content: "Find out what's new with this project", + title: 'Stay up to date', + }, + ]; + + return ( +
+ +
+
+

Need help?

+
+

This project is maintained by a dedicated group of people.

+ +
+
+
+ ); +} + +module.exports = Help; diff --git a/website/pages/en/index.js b/website/pages/en/index.js new file mode 100644 index 00000000..1e03b771 --- /dev/null +++ b/website/pages/en/index.js @@ -0,0 +1,212 @@ +/** + * Copyright (c) 2017-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const React = require('react'); + +const CompLibrary = require('../../core/CompLibrary.js'); + +const MarkdownBlock = CompLibrary.MarkdownBlock; /* Used to read markdown */ +const Container = CompLibrary.Container; +const GridBlock = CompLibrary.GridBlock; + +class HomeSplash extends React.Component { + render() { + const {siteConfig, language = ''} = this.props; + const {baseUrl, docsUrl} = siteConfig; + const docsPart = `${docsUrl ? `${docsUrl}/` : ''}`; + const langPart = `${language ? `${language}/` : ''}`; + const docUrl = doc => `${baseUrl}${docsPart}${langPart}${doc}`; + + const SplashContainer = props => ( +
+
+
{props.children}
+
+
+ ); + + const Logo = props => ( +
+ Project Logo +
+ ); + + const ProjectTitle = props => ( +

+ {props.title} + {props.tagline} +

+ ); + + const PromoSection = props => ( +
+
+
{props.children}
+
+
+ ); + + const Button = props => ( + + ); + + return ( + + +
+ + + + + + +
+
+ ); + } +} + +class Index extends React.Component { + render() { + const {config: siteConfig, language = ''} = this.props; + const {baseUrl} = siteConfig; + + const Block = props => ( + + + + ); + + const FeatureCallout = () => ( +
+

Feature Callout

+ These are features of this project +
+ ); + + const TryOut = () => ( + + {[ + { + content: + 'To make your landing page more attractive, use illustrations! Check out ' + + '[**unDraw**](https://undraw.co/) which provides you with customizable illustrations which are free to use. ' + + 'The illustrations you see on this page are from unDraw.', + image: `${baseUrl}img/undraw_code_review.svg`, + imageAlign: 'left', + title: 'Wonderful SVG Illustrations', + }, + ]} + + ); + + const Description = () => ( + + {[ + { + content: + 'This is another description of how this project is useful', + image: `${baseUrl}img/undraw_note_list.svg`, + imageAlign: 'right', + title: 'Description', + }, + ]} + + ); + + const LearnHow = () => ( + + {[ + { + content: + 'Each new Docusaurus project has **randomly-generated** theme colors.', + image: `${baseUrl}img/undraw_youtube_tutorial.svg`, + imageAlign: 'right', + title: 'Randomly Generated Theme Colors', + }, + ]} + + ); + + const Features = () => ( + + {[ + { + content: 'This is the content of my feature', + image: `${baseUrl}img/undraw_react.svg`, + imageAlign: 'top', + title: 'Feature One', + }, + { + content: 'The content of my second feature', + image: `${baseUrl}img/undraw_operating_system.svg`, + imageAlign: 'top', + title: 'Feature Two', + }, + ]} + + ); + + const Showcase = () => { + if ((siteConfig.users || []).length === 0) { + return null; + } + + const showcase = siteConfig.users + .filter(user => user.pinned) + .map(user => ( + + {user.caption} + + )); + + const pageUrl = page => baseUrl + (language ? `${language}/` : '') + page; + + return ( +
+

Who is Using This?

+

This project is used by all these people

+
{showcase}
+ +
+ ); + }; + + return ( +
+ +
+ + + + + + +
+
+ ); + } +} + +module.exports = Index; diff --git a/website/pages/en/users.js b/website/pages/en/users.js new file mode 100644 index 00000000..039dc39f --- /dev/null +++ b/website/pages/en/users.js @@ -0,0 +1,48 @@ +/** + * Copyright (c) 2017-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const React = require('react'); + +const CompLibrary = require('../../core/CompLibrary.js'); + +const Container = CompLibrary.Container; + +class Users extends React.Component { + render() { + const {config: siteConfig} = this.props; + if ((siteConfig.users || []).length === 0) { + return null; + } + + const editUrl = `${siteConfig.repoUrl}/edit/master/website/siteConfig.js`; + const showcase = siteConfig.users.map(user => ( + + {user.caption} + + )); + + return ( +
+ +
+
+

Who is Using This?

+

This project is used by many folks

+
+
{showcase}
+

Are you using this project?

+ + Add your company + +
+
+
+ ); + } +} + +module.exports = Users; diff --git a/website/sidebars.json b/website/sidebars.json new file mode 100644 index 00000000..cab23536 --- /dev/null +++ b/website/sidebars.json @@ -0,0 +1,5 @@ +{ + "docs": { + "Introduction": ["installation"] + } +} diff --git a/website/siteConfig.js b/website/siteConfig.js new file mode 100644 index 00000000..1b2cd4fc --- /dev/null +++ b/website/siteConfig.js @@ -0,0 +1,105 @@ +/** + * Copyright (c) 2017-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// See https://docusaurus.io/docs/site-config for all the possible +// site configuration options. + +// List of projects/orgs using your project for the users page. +const users = [ + { + caption: 'User1', + // You will need to prepend the image path with your baseUrl + // if it is not '/', like: '/test-site/img/image.jpg'. + image: '/img/undraw_open_source.svg', + infoLink: 'https://www.facebook.com', + pinned: true, + }, +]; + +const siteConfig = { + title: 'React-Native-Sensitive-Info', // Title for your website. + tagline: 'A website for testing', + url: 'https://your-docusaurus-test-site.com', // Your website URL + baseUrl: '/', // Base URL for your project */ + // For github.io type URLs, you would set the url and baseUrl like: + // url: 'https://facebook.github.io', + // baseUrl: '/test-site/', + + // Used for publishing and more + projectName: 'react-native-sensitive-info', + organizationName: 'mCodex', + // For top-level user or org sites, the organization is still the same. + // e.g., for the https://JoelMarcey.github.io site, it would be set like... + // organizationName: 'JoelMarcey' + + // For no header links in the top nav bar -> headerLinks: [], + headerLinks: [{doc: 'installation', label: 'Docs'}], + + // If you have users set above, you add it here: + users, + + /* path to images for header/footer */ + headerIcon: 'img/favicon.ico', + footerIcon: 'img/favicon.ico', + favicon: 'img/favicon.ico', + + /* Colors for website */ + colors: { + primaryColor: '#284b27', + secondaryColor: '#1c341b', + }, + + /* Custom fonts for website */ + /* + fonts: { + myFont: [ + "Times New Roman", + "Serif" + ], + myOtherFont: [ + "-apple-system", + "system-ui" + ] + }, + */ + + // This copyright info is used in /core/Footer.js and blog RSS/Atom feeds. + copyright: `Made with ❤️ by mCodex and the awesome community`, + + highlight: { + // Highlight.js theme to use for syntax highlighting in code blocks. + theme: 'default', + }, + + // Add custom scripts here that would be placed in