This repository has been archived by the owner. It is now read-only.
Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Lumen search (#394)
* Implement Search with onboarding on lumen * adding missing file * search engine icons and working cliqz integration * translations
- Loading branch information
Showing
with
529 additions
and 74 deletions.
- +8 −0 Client.xcodeproj/project.pbxproj
- +1 −1 Cliqz/React Components/Engine.swift
- +3 −2 Cliqz/React Components/Modules/JSBridge.swift
- +7 −1 Cliqz/React Components/Modules/NativeDrawable.m
- +27 −0 Cliqz/React Components/Modules/Onboarding.swift
- +15 −0 Cliqz/React Components/Modules/OnboardingBridge.m
- +23 −0 Cliqz/Resources/Common.xcassets/ReactCards/ic_ez_bing.imageset/Contents.json
- BIN Cliqz/Resources/Common.xcassets/ReactCards/ic_ez_bing.imageset/bing@1x.png
- BIN Cliqz/Resources/Common.xcassets/ReactCards/ic_ez_bing.imageset/bing@2x.png
- BIN Cliqz/Resources/Common.xcassets/ReactCards/ic_ez_bing.imageset/bing@3x.png
- +23 −0 Cliqz/Resources/Common.xcassets/ReactCards/ic_ez_ddg.imageset/Contents.json
- BIN Cliqz/Resources/Common.xcassets/ReactCards/ic_ez_ddg.imageset/ddg@1x.png
- BIN Cliqz/Resources/Common.xcassets/ReactCards/ic_ez_ddg.imageset/ddg@2x.png
- BIN Cliqz/Resources/Common.xcassets/ReactCards/ic_ez_ddg.imageset/ddg@3x.png
- +23 −0 Cliqz/Resources/Common.xcassets/ReactCards/ic_ez_google.imageset/Contents.json
- BIN Cliqz/Resources/Common.xcassets/ReactCards/ic_ez_google.imageset/google@1x.png
- BIN Cliqz/Resources/Common.xcassets/ReactCards/ic_ez_google.imageset/google@2x.png
- BIN Cliqz/Resources/Common.xcassets/ReactCards/ic_ez_google.imageset/google@3x.png
- +9 −13 README.md
- +25 −0 js/i18n.js
- +35 −0 js/localization/de.json
- +35 −0 js/localization/en.json
- +112 −0 js/lumen-onboarding.js
- +144 −38 lumen.js
- +37 −18 package-lock.json
- +2 −1 package.json
| @@ -0,0 +1,27 @@ | ||
| // | ||
| // Onboarding.swift | ||
| // Client | ||
| // | ||
| // Created by Khaled Tantawy on 17.07.19. | ||
| // Copyright © 2019 Cliqz. All rights reserved. | ||
| // | ||
| import React | ||
|
|
||
| @objc(Onboarding) | ||
| class Onboarding: RCTEventEmitter { | ||
|
|
||
| override static func requiresMainQueueSetup() -> Bool { | ||
| return false | ||
| } | ||
|
|
||
| @objc(tryLumenSearch:) | ||
| func tryLumenSearch(accepted: Bool) { | ||
| debugPrint("tryLumenSearch -- \(accepted)") | ||
| if accepted { | ||
| // TODO: PK this is try now case. Change Lumen to default search engine. UI will be handled by extenstion | ||
| } else { | ||
| // TODO: PK close cliqz search and open queary with default search engine | ||
| } | ||
| } | ||
| } |
| @@ -0,0 +1,15 @@ | ||
| // | ||
| // OnboardingBridge.m | ||
| // Client | ||
| // | ||
| // Created by Khaled Tantawy on 17.07.19. | ||
| // Copyright © 2019 Cliqz. All rights reserved. | ||
| // | ||
|
|
||
| #import <Foundation/Foundation.h> | ||
| #import <React/RCTBridgeModule.h> | ||
| @interface RCT_EXTERN_MODULE(Onboarding, NSObject) | ||
| RCT_EXTERN_METHOD(tryLumenSearch:(BOOL) accepted) | ||
| @end | ||
|
|
||
|
|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "images" : [ | ||
| { | ||
| "idiom" : "universal", | ||
| "filename" : "bing@1x.png", | ||
| "scale" : "1x" | ||
| }, | ||
| { | ||
| "idiom" : "universal", | ||
| "filename" : "bing@2x.png", | ||
| "scale" : "2x" | ||
| }, | ||
| { | ||
| "idiom" : "universal", | ||
| "filename" : "bing@3x.png", | ||
| "scale" : "3x" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "version" : 1, | ||
| "author" : "xcode" | ||
| } | ||
| } |
Binary file not shown.
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "images" : [ | ||
| { | ||
| "idiom" : "universal", | ||
| "filename" : "ddg@1x.png", | ||
| "scale" : "1x" | ||
| }, | ||
| { | ||
| "idiom" : "universal", | ||
| "filename" : "ddg@2x.png", | ||
| "scale" : "2x" | ||
| }, | ||
| { | ||
| "idiom" : "universal", | ||
| "filename" : "ddg@3x.png", | ||
| "scale" : "3x" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "version" : 1, | ||
| "author" : "xcode" | ||
| } | ||
| } |
Binary file not shown.
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "images" : [ | ||
| { | ||
| "idiom" : "universal", | ||
| "filename" : "google@1x.png", | ||
| "scale" : "1x" | ||
| }, | ||
| { | ||
| "idiom" : "universal", | ||
| "filename" : "google@2x.png", | ||
| "scale" : "2x" | ||
| }, | ||
| { | ||
| "idiom" : "universal", | ||
| "filename" : "google@3x.png", | ||
| "scale" : "3x" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "version" : 1, | ||
| "author" : "xcode" | ||
| } | ||
| } |
Binary file not shown.
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1,25 @@ | ||
| import { NativeModules } from 'react-native'; | ||
| import console from 'browser-core-lumen-ios/build/modules/core/console'; | ||
|
|
||
| let translations; | ||
|
|
||
| export default function t(key) { | ||
| if (!translations) { | ||
| const locale = NativeModules.LocaleConstants.lang; | ||
| switch (locale) { | ||
| case 'de': | ||
| translations = require('./localization/de.json'); | ||
| break; | ||
| default: | ||
| translations = require('./localization/en.json'); | ||
| } | ||
| } | ||
| const translation = translations[key]; | ||
|
|
||
| if (!translation) { | ||
| console.warn(`Cannot find translation for key "${key}"`); | ||
| return key; | ||
| } | ||
|
|
||
| return translation.message; | ||
| } |
| @@ -0,0 +1,35 @@ | ||
| { | ||
| "search_no_results": { | ||
| "message": "KEINE TREFFER GEFUNDEN" | ||
| }, | ||
| "search_footer": { | ||
| "message": "DIESE SUCHANFRAGE IST ANONYM" | ||
| }, | ||
| "search_alternative_search_engines_info": { | ||
| "message": "Lumen Suche verlassen?" | ||
| }, | ||
| "onboarding_title": { | ||
| "message": "Neu: Anonyme Suche" | ||
| }, | ||
| "onboarding_description_line1": { | ||
| "message": "Jetzt aktivieren um anonym zu suchen." | ||
| }, | ||
| "onboarding_description_line2": { | ||
| "message": "Dies kann jederzeit in den Einstellungen geändert werden." | ||
| }, | ||
| "onboarding_action_accept": { | ||
| "message": "AUSPROBIEREN" | ||
| }, | ||
| "onboarding_action_reject": { | ||
| "message": "NEIN, DANKE" | ||
| }, | ||
| "onboarding_result_with_query": { | ||
| "message": "SUCHE AKTIVIERT" | ||
| }, | ||
| "onboarding_result_without_query": { | ||
| "message": "EINFACH LOSTIPPEN" | ||
| }, | ||
| "test": { | ||
| "message": "de" | ||
| } | ||
| } |
| @@ -0,0 +1,35 @@ | ||
| { | ||
| "search_no_results": { | ||
| "message": "NO RESULTS FOUND" | ||
| }, | ||
| "search_footer": { | ||
| "message": "THIS SEARCH QUERY IS ANONYMOUS" | ||
| }, | ||
| "search_alternative_search_engines_info": { | ||
| "message": "Leave Lumen Search?" | ||
| }, | ||
| "onboarding_title": { | ||
| "message": "New: Anonymous Search" | ||
| }, | ||
| "onboarding_description_line1": { | ||
| "message": "Activate now to search anonymously." | ||
| }, | ||
| "onboarding_description_line2": { | ||
| "message": "This can be changed anytime in settings." | ||
| }, | ||
| "onboarding_action_accept": { | ||
| "message": "TRY NOW" | ||
| }, | ||
| "onboarding_action_reject": { | ||
| "message": "NO, THANKS" | ||
| }, | ||
| "onboarding_result_with_query": { | ||
| "message": "SEARCH ACTIVATED" | ||
| }, | ||
| "onboarding_result_without_query": { | ||
| "message": "START TYPING" | ||
| }, | ||
| "test": { | ||
| "message": "de" | ||
| } | ||
| } |
Oops, something went wrong.