-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
publish: Merge pull request #281 from cozy/feat/add-translate-apps
generated from commit 7e07ec9
- Loading branch information
Travis CI User
committed
Nov 14, 2024
1 parent
e580d57
commit 9088327
Showing
6 changed files
with
513 additions
and
455 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
en/cozy-home/src/assistant/ResultMenu/SuggestionItemTextSecondary.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* Code copied and adapted from cozy-drive | ||
* | ||
* See source: https://github.com/cozy/cozy-drive/blob/fbe2df67199683b23a40f476ccdacb00ee027459/src/modules/search/components/SuggestionItemTextSecondary.jsx | ||
*/ | ||
import React from 'react' | ||
|
||
import AppLinker from 'cozy-ui/transpiled/react/AppLinker' | ||
import SuggestionItemTextHighlighted from './SuggestionItemTextHighlighted' | ||
import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints' | ||
import Link from 'cozy-ui/transpiled/react/Link' | ||
|
||
const SuggestionItemTextSecondary = ({ text, query, url, slug }) => { | ||
const { isMobile } = useBreakpoints() | ||
|
||
if (isMobile || !url) { | ||
return <SuggestionItemTextHighlighted text={text} query={query} /> | ||
} | ||
|
||
const app = { slug } | ||
return ( | ||
<AppLinker app={app} href={url}> | ||
{({ href, onClick }) => ( | ||
<Link | ||
color="textSecondary" | ||
underline="hover" | ||
href={href} | ||
onClick={e => { | ||
e.stopPropagation() | ||
if (typeof onClick == 'function') { | ||
onClick(e) | ||
} | ||
}} | ||
> | ||
<SuggestionItemTextHighlighted | ||
text={text} | ||
query={query} | ||
slug={slug} | ||
/> | ||
</Link> | ||
)} | ||
</AppLinker> | ||
) | ||
} | ||
|
||
export default SuggestionItemTextSecondary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.