Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1427 from Qwant/QMAPS-2828
Browse files Browse the repository at this point in the history
  • Loading branch information
pascaloliv authored Nov 23, 2022
2 parents b80eded + 79adf29 commit b65c669
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 11 deletions.
2 changes: 1 addition & 1 deletion language/message/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,7 @@ msgid "Your position"
msgstr "Ihr Standort"

msgid "Back to Qwant.com"
msgstr "Zurück zu Qwant.com"
msgstr "Search"

msgid "Qwant Maps uses OpenStreetMap data."
msgstr "Qwant Maps verwendet OpenStreetMap-Daten."
Expand Down
2 changes: 1 addition & 1 deletion language/message/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ msgid "Your position"
msgstr ""

msgid "Back to Qwant.com"
msgstr ""
msgstr "Search"

msgid "Qwant Maps uses OpenStreetMap data."
msgstr ""
Expand Down
2 changes: 1 addition & 1 deletion language/message/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ msgid "Your position"
msgstr "Tu localización"

msgid "Back to Qwant.com"
msgstr "Volver a Qwant.com"
msgstr "Search"

msgid "Qwant Maps uses OpenStreetMap data."
msgstr "Qwant Maps usa datos de OpenStreetMaps."
Expand Down
2 changes: 1 addition & 1 deletion language/message/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ msgid "Your position"
msgstr "Votre position"

msgid "Back to Qwant.com"
msgstr "Retour à Qwant.com"
msgstr "Search"

msgid "Qwant Maps uses OpenStreetMap data."
msgstr "Qwant Maps utilise les données OpenStreetMap."
Expand Down
2 changes: 1 addition & 1 deletion language/message/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ msgid "Your position"
msgstr "La tua posizione"

msgid "Back to Qwant.com"
msgstr "Torna su Qwant.com"
msgstr "Search"

msgid "Qwant Maps uses OpenStreetMap data."
msgstr "Qwant Maps usa i dati di OpenStreetMap."
Expand Down
6 changes: 6 additions & 0 deletions public/images/qwant-search-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/components/BackToQwantButton.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useEffect } from 'react';
import { Button, IconArrowLeftLine } from '@qwant/qwant-ponents';
import { QwantLogoBlue } from 'src/components/ui/icons';
import { useI18n } from 'src/hooks';

const hiddenAttributeClassName = 'map_control__scale_attribute_container--hidden';
Expand All @@ -24,6 +25,7 @@ export const BackToQwantButton = ({ isMobile }) => {
onClick={() => window.history.back()}
>
<IconArrowLeftLine />
<QwantLogoBlue className="qwant-logo" />
{_('Back to Qwant.com')}
</Button>
);
Expand Down
21 changes: 18 additions & 3 deletions src/components/TopBar/TopBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ import React, { useEffect, useState, useRef } from 'react';
import cx from 'classnames';
import Telemetry from 'src/libs/telemetry';
import { Suggest } from 'src/components/ui';
import { IconArrowBackward, IconCloseCircled, IconDirectionsArrow } from 'src/components/ui/icons';
import {
IconArrowBackward,
IconCloseCircled,
IconDirectionsArrow,
QwantLogoBlue,
} from 'src/components/ui/icons';
import { IconClose, Flex, IconMenu, IconApps } from '@qwant/qwant-ponents';

import { useConfig, useDevice, useI18n } from 'src/hooks';
import { handleFocus } from 'src/libs/input';
import { selectItem, fetchSuggests } from 'src/libs/suggest';
Expand Down Expand Up @@ -199,10 +205,19 @@ const TopBar = ({ value, setUserInputValue, inputRef, onSuggestToggle, backButto
})}
onClick={() => setProductsDrawerOpen(!isProductsDrawerOpen)}
>
<IconApps className="u-mr-xxs" />
{_('Products', 'menu')}
<IconApps />
</button>
)}
{!isMobile && (
<a
className={cx('u-mr-xs', 'menu__button', 'menu__button--icon')}
target="_self"
href={window.location.origin}
>
<QwantLogoBlue />
{_('Back to Qwant.com')}
</a>
)}
</Flex>
</div>
{config.direction.enabled && (
Expand Down
1 change: 1 addition & 0 deletions src/components/ui/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ export { ReactComponent as IconDirectionsArrow } from '../../../public/images/di

export { ReactComponent as IconAndroid } from '../../../public/images/mobile/android.svg';
export { ReactComponent as IconApple } from '../../../public/images/mobile/i-os.svg';
export { ReactComponent as QwantLogoBlue } from '../../../public/images/qwant-search-logo.svg';
2 changes: 1 addition & 1 deletion src/libs/url_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function updateQueryString(queriesObject) {

export function shouldShowBackToQwant() {
const params = parseQueryString(window.location.search);
return params.client && params.client === 'search-ia-maps-multi';
return params?.client === 'search-ia-maps-multi' || params?.client === 'search-ia-maps-single';
}

const getDrawerUrl = drawer => getAppRelativePathname() + updateQueryString({ drawer });
Expand Down
9 changes: 9 additions & 0 deletions src/scss/includes/components/backToQwantButton.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
.backToQwantButton {
border-radius: 18px;
padding: var(--spacing-xxs) var(--spacing-s) !important;

.qwant-logo {
width: 24px;
height: 24px;
margin: 0 var(--spacing-xs) 0 0;
}

@media (max-width: 640px) {
background-color: white !important;
box-shadow: 0 1px 4px 0 rgba(12, 12, 14, 0.2), 0 0 2px 0 rgba(12, 12, 14, 0.12);
Expand Down
12 changes: 10 additions & 2 deletions src/scss/includes/menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ $productDrawerWidth: 744px;
&-appButton {
&:not(:first-child) {
margin-left: 8px;
}
}
}
}

Expand All @@ -171,7 +171,6 @@ $productDrawerWidth: 744px;
text-align: center;
margin-bottom: $spacing-s;
padding: $spacing-xxl-3 $spacing-l;

}

@media (max-width: 640px) {
Expand Down Expand Up @@ -228,6 +227,7 @@ $productDrawerWidth: 744px;
padding: $spacing-s;
border-radius: 8px;
box-shadow: $shadow;
text-decoration: none !important;

&:hover {
color: $grey-black;
Expand All @@ -243,6 +243,14 @@ $productDrawerWidth: 744px;
&--noShadow {
box-shadow: none;
}

&--icon {
padding: var(--spacing-xs);

svg {
margin-right: var(--spacing-xxs);
}
}
}

.menu-top {
Expand Down

0 comments on commit b65c669

Please sign in to comment.