-
Notifications
You must be signed in to change notification settings - Fork 920
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Tab Page Sponsored Image Clickbox (#17356)
- Loading branch information
1 parent
97576bf
commit d2d8407
Showing
3 changed files
with
72 additions
and
2 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
46 changes: 46 additions & 0 deletions
46
components/brave_new_tab_ui/components/default/sponsoredImage/sponsoredImageClickArea.tsx
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 @@ | ||
// Copyright (c) 2023 The Brave Authors. All rights reserved. | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
// You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
import { OpenNewIcon } from 'brave-ui/components/icons' | ||
import * as React from 'react' | ||
import styled from 'styled-components' | ||
|
||
const Indicator = styled.span` | ||
display: none; | ||
position: absolute; | ||
top: 8px; | ||
right: 8px; | ||
width: 20px; | ||
height: 20px; | ||
color: white; | ||
` | ||
|
||
const Link = styled.a` | ||
position: absolute; | ||
top: 8px; | ||
left: 8px; | ||
right: 56px; | ||
bottom: 8px; | ||
display: block; | ||
&:hover { | ||
cursor: pointer; | ||
${Indicator} { | ||
display: block; | ||
} | ||
} | ||
` | ||
|
||
export default function SponsoredImageClickArea(props: { sponsoredImageUrl: string, onClick: () => void }) { | ||
return ( | ||
<Link href={props.sponsoredImageUrl} rel="noreferrer noopener" onClick={props.onClick}> | ||
<Indicator> | ||
<OpenNewIcon /> | ||
</Indicator> | ||
</Link> | ||
) | ||
} |
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